1 ## Makefile for miscellaneous stuff
3 ## No proper build system here. Just kludgy hacks.
9 cdb-assign 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
14 SBINPROGS = qmail-checkspam
15 PROGS = $(BINPROGS) $(SBINPROGS)
19 not.1 z.1 cdb-assign.1 cdb-list.1 cdb-probe.1 cdb-check-domain.1 \
20 gorp.1 unfwd.1 splitconf.1 locking.1 if-mtu.1 pause.1 \
21 buf.1 create.1 inplace.1
23 DISTMAN8 = qmail-checkspam.8
24 MAN8 = $(DISTMAN8) shadowfix.8
25 BUILDFILES = shadowfix.8
27 not.c cdb-probe.c cdb-check-domain.c gorp.c locking.c if-mtu.c \
28 qmail-checkspam.c xtitle.c pause.c
32 CFLAGS = -O2 -g -pedantic -Wall -DVERSION=\"$(VERSION)\"
33 LINK = $(LD) $(LDFLAGS) -o $@ $^
37 bindir = $(prefix)/bin
38 sbindir = $(prefix)/sbin
39 mandir = $(prefix)/man
40 man1dir = $(mandir)/man1
41 man8dir = $(mandir)/man8
42 libdir = $(prefix)/lib
43 perllibdir = $(libdir)/site_perl
45 all: $(BUILDFILES) $(PROGS) $(LIBS)
48 [ -d $(INST)$(libdir) ] || install -d $(INST)$(libdir)
49 install -m644 $(LIBS) $(INST)$(libdir)
50 [ -d $(INST)$(perllibdir) ] || install -d $(INST)$(perllibdir)
51 install -m644 $(PERLLIBS) $(INST)$(perllibdir)
52 [ -d $(INST)$(bindir) ] || install -d $(INST)$(bindir)
53 install -m775 $(BINPROGS) $(BINSCRIPTS) $(INST)$(bindir)
54 [ -d $(INST)$(sbindir) ] || install -d $(INST)$(sbindir)
55 install -m775 $(SBINPROGS) $(SBINSCRIPTS) $(INST)$(sbindir)
56 [ -d $(INST)$(man1dir) ] || install -d $(INST)$(man1dir)
57 install -m644 $(MAN1) $(INST)$(man1dir)
58 [ -d $(INST)$(man8dir) ] || install -d $(INST)$(man8dir)
59 install -m644 $(MAN8) $(INST)$(man8dir)
62 for i in $(LIBS); do rm -f $(INST)$(libdir)/$$i; done
63 for i in $(PERLLIBS); do rm -f $(INST)$(perllibdir)/$$i; done
64 for i in $(BINPROGS) $(BINSCRIPTS); do \
65 rm -f $(INST)$(bindir)/$$i; done
66 for i in $(SBINPROGS) $(SBINSCRIPTS); do \
67 rm -f $(INST)$(sbindir)/$$i; done
68 for i in $(MAN1); do rm -f $(INST)$(man1dir)/$$i; done
69 for i in $(MAN8); do rm -f $(INST)$(man8dir)/$$i; done
71 qmail-checkspam: qmail-checkspam.o
74 cdb-probe: cdb-probe.o
77 cdb-check-domain: cdb-check-domain.o
84 $(CC) $(CFLAGS) -c -fpic -I/usr/include/bash -DBASH_BUILTIN -o $@ $^
89 $(LINK) -lcatacomb -lmLib
100 shadowfix.8: shadowfix
101 pod2man --section 8 shadowfix >shadowfix.8.new
102 mv shadowfix.8.new shadowfix.8
104 clean:; rm -f *.o *~ $(PROGS) $(OTHERS)
106 DISTDIR = $(PACKAGE)-$(VERSION)
109 $(SCRIPTS) $(DISTMAN1) $(DISTMAN8) $(SOURCES) $(PERLLIBS) \
110 debian/changelog debian/control debian/copyright \
111 debian/rules debian/inst
112 distdir: $(DISTFILES)
114 mkdir $(DISTDIR) $(DISTDIR)/debian
115 for i in $(DISTFILES); do \
119 up=`echo $$dir | sed 's:[^/]\+:..:g'`; \
120 mkdir -p $(DISTDIR)/$$dir;; \
123 ln -s ../$$up/$$i $(DISTDIR)/$$i; \
126 tar chofz $(INST)$(DISTDIR).tar.gz $(DISTDIR)
130 @echo "*** Packing..."
132 @echo "*** Unpacking..."
133 tar xfz $(DISTDIR).tar.gz
134 @echo "*** Test building..."
139 $(MAKE) install INST=inst; \
141 @echo "*** Tidying up..."
145 .PHONY: all clean install dist distdir disttar