summaryrefslogtreecommitdiff
path: root/tools/makefile
diff options
context:
space:
mode:
Diffstat (limited to 'tools/makefile')
-rw-r--r--tools/makefile27
1 files changed, 25 insertions, 2 deletions
diff --git a/tools/makefile b/tools/makefile
index 5dc7952..08bf17c 100644
--- a/tools/makefile
+++ b/tools/makefile
@@ -10,12 +10,33 @@ CC= /usr/bin/g++ -Wall -g -I $(HOME)/lib/include
.SECONDARY : # do not remove any intermediate files
-qprogs = pido hi-q skrewt hi-test mail-scan greylist wripper
+# sources for main programs that go in /var/qmail/bin
+qmain = pido.c hi-q.c skrewt.c hi-test.c mail-scan.c greylist.c wripper.c
+qprogs = $(qmain:%.c=%)
-moreprogs = wripper bash-c
+# sources for other main programs:
+moremain = wripper.c bash-c.c
+moreprogs = $(moremain:%.c=%)
+
+nonmain =
+
+sources = $(qmain) $(moremain) $(nonmain)
+
+beware_other = checkpassword.c spamc.c
+
+## dependency-finding scheme (with local mods) based on:
+## http://www.gnu.org/manual/make-3.77/html_mono/make.html#SEC42
+## (see also include statement at end of this makefile)
+%.d : %.c
+ @$(SHELL) -ec '$(CXX) -MM $(CXXFLAGS) $< \
+ | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
+ [ -s $@ ] || rm -f $@'
all: $(qprogs) $(moreprogs)
+show:
+ : --- $(qprogs) +++ $(moreprogs)
+
greylist: greylist.o
$(CC) $< -lboost_filesystem-mt -o $@
@@ -70,3 +91,5 @@ ALWAYS:
##?? include $(chapters:.htm=.d)
##?? include $(fancy:%.htm=aux/%.fig)
+
+include $(sources:.c=.d)