1 ## Makefile for miscellaneous stuff
3 ## No proper build system here. Just kludgy hacks.
9 cdb-assign cdb-map cdb-list check-sender unfwd \
10 splitconf z buf create inplace
11 SBINSCRIPTS = shadowfix
12 SCRIPTS = $(BINSCRIPTS) $(SBINSCRIPTS)
13 BINPROGS = not cdb-probe cdb-check-domain gorp locking if-mtu pause stamp
14 SBINPROGS = qmail-checkspam
15 PROGS = $(BINPROGS) $(SBINPROGS)
19 not.1 z.1 cdb-assign.1 cdb-map.1 cdb-list.1 cdb-probe.1 \
21 gorp.1 unfwd.1 splitconf.1 locking.1 if-mtu.1 pause.1 stamp.1 \
22 buf.1 create.1 inplace.1
24 DISTMAN8 = qmail-checkspam.8
25 MAN8 = $(DISTMAN8) shadowfix.8
26 BUILDFILES = shadowfix.8
28 not.c cdb-probe.c cdb-check-domain.c gorp.c locking.c if-mtu.c \
29 qmail-checkspam.c xtitle.c pause.c
33 CFLAGS = -O2 -g -pedantic -Wall -DVERSION=\"$(VERSION)\"
34 LINK = $(LD) $(LDFLAGS) -o $@ $^
38 bindir = $(prefix)/bin
39 sbindir = $(prefix)/sbin
40 mandir = $(prefix)/man
41 man1dir = $(mandir)/man1
42 man8dir = $(mandir)/man8
43 libdir = $(prefix)/lib
44 perllibdir = $(libdir)/site_perl
46 all: $(BUILDFILES) $(PROGS) $(LIBS)
49 [ -d $(INST)$(libdir) ] || install -d $(INST)$(libdir)
50 install -m644 $(LIBS) $(INST)$(libdir)
51 [ -d $(INST)$(perllibdir) ] || install -d $(INST)$(perllibdir)
52 install -m644 $(PERLLIBS) $(INST)$(perllibdir)
53 [ -d $(INST)$(bindir) ] || install -d $(INST)$(bindir)
54 install -m775 $(BINPROGS) $(BINSCRIPTS) $(INST)$(bindir)
55 [ -d $(INST)$(sbindir) ] || install -d $(INST)$(sbindir)
56 install -m775 $(SBINPROGS) $(SBINSCRIPTS) $(INST)$(sbindir)
57 [ -d $(INST)$(man1dir) ] || install -d $(INST)$(man1dir)
58 install -m644 $(MAN1) $(INST)$(man1dir)
59 [ -d $(INST)$(man8dir) ] || install -d $(INST)$(man8dir)
60 install -m644 $(MAN8) $(INST)$(man8dir)
63 for i in $(LIBS); do rm -f $(INST)$(libdir)/$$i; done
64 for i in $(PERLLIBS); do rm -f $(INST)$(perllibdir)/$$i; done
65 for i in $(BINPROGS) $(BINSCRIPTS); do \
66 rm -f $(INST)$(bindir)/$$i; done
67 for i in $(SBINPROGS) $(SBINSCRIPTS); do \
68 rm -f $(INST)$(sbindir)/$$i; done
69 for i in $(MAN1); do rm -f $(INST)$(man1dir)/$$i; done
70 for i in $(MAN8); do rm -f $(INST)$(man8dir)/$$i; done
72 qmail-checkspam: qmail-checkspam.o
75 cdb-probe: cdb-probe.o
78 cdb-check-domain: cdb-check-domain.o
85 $(CC) $(CFLAGS) -c -fpic -I/usr/include/bash -DBASH_BUILTIN -o $@ $^
90 $(LINK) -lcatacomb -lmLib
104 shadowfix.8: shadowfix
105 pod2man --section 8 shadowfix >shadowfix.8.new
106 mv shadowfix.8.new shadowfix.8
108 clean:; rm -f *.o *~ $(PROGS) $(OTHERS)
110 DISTDIR = $(PACKAGE)-$(VERSION)
113 $(SCRIPTS) $(DISTMAN1) $(DISTMAN8) $(SOURCES) $(PERLLIBS) \
114 debian/changelog debian/control debian/copyright \
115 debian/rules debian/inst
116 distdir: $(DISTFILES)
118 mkdir $(DISTDIR) $(DISTDIR)/debian
119 for i in $(DISTFILES); do \
123 up=`echo $$dir | sed 's:[^/]\+:..:g'`; \
124 mkdir -p $(DISTDIR)/$$dir;; \
127 ln -s ../$$up/$$i $(DISTDIR)/$$i; \
130 tar chofz $(INST)$(DISTDIR).tar.gz $(DISTDIR)
134 @echo "*** Packing..."
136 @echo "*** Unpacking..."
137 tar xfz $(DISTDIR).tar.gz
138 @echo "*** Test building..."
143 $(MAKE) install INST=inst; \
145 @echo "*** Tidying up..."
149 .PHONY: all clean install dist distdir disttar