aboutsummaryrefslogtreecommitdiffstats
path: root/GNUmakefile
blob: e2c3a07a90c7e91f14a80d7efa30df2b0f373769 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# 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

autojuke: autojuke.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