comparison mk/progs.mk @ 0:13d2b8934445

Import AnaGram (near-)release tree into Mercurial.
author David A. Holland
date Sat, 22 Dec 2007 17:52:45 -0500
parents
children bb115deb6fb2
comparison
equal deleted inserted replaced
-1:000000000000 0:13d2b8934445
1 #
2 # progs.mk - compile multiple programs, in portable make.
3 #
4 # Before including, set:
5 # SRCS sources of programs to build
6 # SYNS (optional) AG syntax files
7 # SYNOUTPUTEXT (optional) output suffix for AG files
8 # AGFILEDEST (optional) destination for AG files ("here" or "srcdir")
9 #
10
11 SYNOUTPUTEXT?=.cpp
12 AGFILEDEST?=srcdir
13
14 include $(BUILDTOP)/config.mk
15
16 # beforeall used by: agfile-rules.sh when AGFILEDEST==here
17 # afterall used by: nobody
18
19 all: beforeall doall afterall
20 beforeall doall afterall:;
21
22 # BSD make has .WAIT to make beforeall/afterall work, but gmake doesn't.
23 .NOTPARALLEL:
24
25 TYPE=PROG
26
27 include rules.mk
28 include depend.mk
29
30 rules:
31 @$(TOP)/mk/include-defs.sh '$(INCDIRS)' > rules.mk
32 @$(TOP)/mk/progs-rules.sh '$(SRCS)' >> rules.mk
33 @$(TOP)/mk/compile-rules.sh '$(SRCS)' '' >> rules.mk
34 @$(TOP)/mk/agfile-rules.sh $(AGFILEDEST) '$(SYNS)' '$(SYNOUTPUTEXT)' \
35 >> rules.mk
36 # @echo ' [RULES]'
37
38 depend:
39 @echo ' [DEP]'
40 @$(MKDEP)
41
42 clean:
43 @echo ' [RM] $(CLEANFILES) *~'
44 @rm -f $(PROGS) $(CLEANFILES) *~
45
46 distclean: clean
47 @echo ' [RM] $(DISTCLEANFILES) *~'
48 @rm -f $(DISTCLEANFILES) *~
49
50 .PHONY: all rules depend clean distclean