aboutsummaryrefslogtreecommitdiffstats
path: root/GNUmakefile
diff options
context:
space:
mode:
Diffstat (limited to 'GNUmakefile')
-rw-r--r--GNUmakefile91
1 files changed, 91 insertions, 0 deletions
diff --git a/GNUmakefile b/GNUmakefile
new file mode 100644
index 0000000..b2c62c1
--- /dev/null
+++ b/GNUmakefile
@@ -0,0 +1,91 @@
+# config
+srcdir = .
+VPATH = $(srcdir)
+-include Make.config
+include $(srcdir)/mk/Variables.mk
+
+resdir = $(DESTDIR)$(RESDIR)
+
+# fixup flags
+CFLAGS += -DVERSION='"$(VERSION)"' -I$(srcdir)
+
+# default target
+all: build
+
+# what to build
+TARGETS := mover autojuke unload
+ifeq ($(HAVE_MOTIF),yes)
+ TARGETS += xmover
+endif
+
+
+#################################################################
+# poor man's autoconf ;-)
+
+include $(srcdir)/mk/Autoconf.mk
+
+define make-config
+LIB := $(LIB)
+RESDIR := $(call ac_resdir)
+HAVE_MOTIF := $(call ac_lib,XmStringGenerate,Xm,-L/usr/X11R6/$(LIB) -lXpm -lXt -lXext -lX11)
+endef
+
+# for X11 + Motif
+xmover : CFLAGS += -I/usr/X11R6/include
+xmover : LDFLAGS += -L/usr/X11R6/$(LIB)
+xmover : LDLIBS += -lXm -lXpm -lXt -lXext -lX11
+
+# RegEdit.c is good old K&R ...
+RegEdit.o : CFLAGS += -Wno-missing-prototypes -Wno-strict-prototypes
+
+
+########################################################################
+# targets
+
+unload: unload.o
+
+mover: mover.o
+
+xmover: xmover.o man.o RegEdit.o
+
+xmover.o: xmover.c xmover.h
+
+xmover.h: xmover.ad $(srcdir)/fallback.pl
+ perl $(srcdir)/fallback.pl < $< > $@
+
+load: unload
+ ln -s unload load
+
+
+########################################################################
+# general rules
+
+.PHONY: build install clean distclean realclean
+build: $(TARGETS)
+
+install: build
+ $(INSTALL_DIR) $(bindir)
+ $(INSTALL_DIR) $(mandir)/man1
+ $(INSTALL_DIR) $(mandir)/man8
+ $(INSTALL_BINARY) $(TARGETS) $(bindir)
+ $(INSTALL_DATA) $(srcdir)/mover.man $(mandir)/man1/mover.1
+ $(INSTALL_DATA) $(srcdir)/xmover.man $(mandir)/man1/xmover.1
+ $(INSTALL_DATA) $(srcdir)/autojuke.man $(mandir)/man8/autojuke.8
+ $(INSTALL_DATA) -m644 autojuke.conf $(etc)
+
+clean:
+ -rm -f *.o $(depfiles) core core.*
+
+realclean distclean: clean
+ -rm -f Make.config
+ -rm -f $(TARGETS) *~ rd/*~ wr/*~ xpm/*~ Ida.ad.h logo.h
+
+include $(srcdir)/mk/Compile.mk
+-include $(depfiles)
+
+
+########################################################################
+# maintainer stuff
+
+include $(srcdir)/mk/Maintainer.mk
+