comparison mk/hostprog.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 # hostprog.mk - build a program on the cross-compile host, in portable make.
3 #
4 # Before including, set:
5 # PROG program to build
6 # SRCS sources
7 # SYNS (optional) AG syntax files
8 # SYNOUTPUTEXT (optional) output suffix for AG files
9 # AGFILEDEST (optional) destination for AG files ("here" or "srcdir")
10 #
11
12 SYNOUTPUTEXT?=.cpp
13 AGFILEDEST?=srcdir
14
15 include $(BUILDTOP)/config.mk
16
17 # beforeall used by: none
18 # afterall used by: none
19
20 all: beforeall doall afterall
21 beforeall afterall:;
22 doall: $(PROG)
23
24 # BSD make has .WAIT to make beforeall/afterall work, but gmake doesn't.
25 .NOTPARALLEL:
26
27 include rules.mk
28 include depend.mk
29
30 $(PROG)$(HOST_EXEEXT): $(OBJS)
31 @echo ' [DEP]'
32 @$(HOST_MKDEP)
33 @echo ' [LINK] $(PROG)$(HOST_EXEEXT)'
34 @$(HOST_LDCC) $(HOST_LDFLAGS) $(OBJS) $(HOST_LIBS) -o $@
35
36 rules:
37 @$(TOP)/mk/hostprog-rules.sh '$(SRCS)' > rules.mk
38 @$(TOP)/mk/agfile-rules.sh $(AGFILEDEST) '$(SYNS)' '$(SYNOUTPUTEXT)' \
39 >> rules.mk
40 # @echo ' [RULES]'
41
42 depend:
43 @echo ' [DEP]'
44 @$(HOST_MKDEP)
45
46 clean distclean:
47 @echo ' [RM] $(PROG)$(HOST_EXEEXT) $(HOST_CLEANFILES) *~'
48 @rm -f $(PROG)$(HOST_EXEEXT) $(HOST_CLEANFILES) *~
49
50 .PHONY: all depend clean distclean
51 .PHONY: beforeall doall afterall