summaryrefslogtreecommitdiff
path: root/tools/makefile
diff options
context:
space:
mode:
authorJohn Denker <jsd@av8n.com>2012-07-23 08:43:49 -0700
committerJohn Denker <jsd@av8n.com>2012-07-29 15:32:36 -0700
commit5543dfa42516a12403aaea93816bbd98fdf45318 (patch)
tree1cd1739164bd0b070d9ae470e622b71b60c15fc7 /tools/makefile
parentf8b0737d4ac6eb7152628a2c5fb8f30ae7fe2a24 (diff)
the usual automatic dependency-finder
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)