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)
15 cdb-probe cdb-check-domain \
16 gorp locking if-mtu pause stamp
17 SBINPROGS = qmail-checkspam
18 PROGS = $(BINPROGS) $(SBINPROGS)
22 not.1 z.1 cdb-assign.1 cdb-map.1 cdb-list.1 cdb-probe.1 \
24 gorp.1 unfwd.1 splitconf.1 locking.1 if-mtu.1 pause.1 stamp.1 \
25 buf.1 create.1 inplace.1
27 DISTMAN8 = qmail-checkspam.8
28 MAN8 = $(DISTMAN8) shadowfix.8
29 BUILDFILES = shadowfix.8
31 not.c cdb-probe.c cdb-check-domain.c gorp.c locking.c if-mtu.c \
32 qmail-checkspam.c xtitle.c pause.c
36 CFLAGS = -O2 -g -pedantic -Wall -DVERSION=\"$(VERSION)\"
37 LINK = $(LD) $(LDFLAGS) -o $@ $^
41 bindir = $(prefix)/bin
42 sbindir = $(prefix)/sbin
43 mandir = $(prefix)/man
44 man1dir = $(mandir)/man1
45 man8dir = $(mandir)/man8
46 libdir = $(prefix)/lib
47 perllibdir = $(libdir)/site_perl
49 all: $(BUILDFILES) $(PROGS) $(LIBS)
52 [ -d $(INST)$(libdir) ] || install -d $(INST)$(libdir)
53 install -m644 $(LIBS) $(INST)$(libdir)
54 [ -d $(INST)$(perllibdir) ] || install -d $(INST)$(perllibdir)
55 install -m644 $(PERLLIBS) $(INST)$(perllibdir)
56 [ -d $(INST)$(bindir) ] || install -d $(INST)$(bindir)
57 install -m775 $(BINPROGS) $(BINSCRIPTS) $(INST)$(bindir)
58 [ -d $(INST)$(sbindir) ] || install -d $(INST)$(sbindir)
59 install -m775 $(SBINPROGS) $(SBINSCRIPTS) $(INST)$(sbindir)
60 [ -d $(INST)$(man1dir) ] || install -d $(INST)$(man1dir)
61 install -m644 $(MAN1) $(INST)$(man1dir)
62 [ -d $(INST)$(man8dir) ] || install -d $(INST)$(man8dir)
63 install -m644 $(MAN8) $(INST)$(man8dir)
66 for i in $(LIBS); do rm -f $(INST)$(libdir)/$$i; done
67 for i in $(PERLLIBS); do rm -f $(INST)$(perllibdir)/$$i; done
68 for i in $(BINPROGS) $(BINSCRIPTS); do \
69 rm -f $(INST)$(bindir)/$$i; done
70 for i in $(SBINPROGS) $(SBINSCRIPTS); do \
71 rm -f $(INST)$(sbindir)/$$i; done
72 for i in $(MAN1); do rm -f $(INST)$(man1dir)/$$i; done
73 for i in $(MAN8); do rm -f $(INST)$(man8dir)/$$i; done
75 qmail-checkspam: qmail-checkspam.o
78 cdb-probe: cdb-probe.o
81 cdb-check-domain: cdb-check-domain.o
91 $(CC) $(CFLAGS) -c -fpic -I/usr/include/bash -DBASH_BUILTIN -o $@ $^
96 $(LINK) -lcatacomb -lmLib
110 shadowfix.8: shadowfix
111 pod2man --section 8 shadowfix >shadowfix.8.new
112 mv shadowfix.8.new shadowfix.8
114 clean:; rm -f *.o *~ $(PROGS) $(OTHERS)
116 DISTDIR = $(PACKAGE)-$(VERSION)
119 $(SCRIPTS) $(DISTMAN1) $(DISTMAN8) $(SOURCES) $(PERLLIBS) \
120 debian/changelog debian/control debian/copyright \
121 debian/rules debian/inst
122 distdir: $(DISTFILES)
124 mkdir $(DISTDIR) $(DISTDIR)/debian
125 for i in $(DISTFILES); do \
129 up=`echo $$dir | sed 's:[^/]\+:..:g'`; \
130 mkdir -p $(DISTDIR)/$$dir;; \
133 ln -s ../$$up/$$i $(DISTDIR)/$$i; \
136 tar chofz $(INST)$(DISTDIR).tar.gz $(DISTDIR)
140 @echo "*** Packing..."
142 @echo "*** Unpacking..."
143 tar xfz $(DISTDIR).tar.gz
144 @echo "*** Test building..."
149 $(MAKE) install INST=inst; \
151 @echo "*** Tidying up..."
155 .PHONY: all clean install dist distdir disttar