source: tags/arb-6.0/SL/Makefile

Last change on this file was 10956, checked in by westram, 11 years ago
  • made A_CC and A_CXX consistent
    • A_CXX previously contained cxxflags
    • cxxflags are now passed down and used separately
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.9 KB
Line 
1# --------------------------------------------------------------------------------
2# see README for "Howto add a new library"
3
4# automatically handles all subdirectories
5ARCHS:=$(shell find . -maxdepth 1 -type d)# find all direct sub-directories
6ARCHS:=$(sort $(filter-out . .svn,$(subst ./,,$(ARCHS))))# remove prefix './' and get rid of '.' and '.svn'
7ARCHS:=$(shell echo $(ARCHS) | perl -pn -e 's/([A-Za-z0-9_]+)/\1\/\1/g;')# replace not possible $(patsubst %,%/%,$(ARCHS))
8ARCHS:=$(ARCHS:%=%.dummy)
9
10# --------------------------------------------------------------------------------
11# warnings in this subtree?
12
13RAISE_WARNINGS=1
14
15ifeq ($(RAISE_WARNINGS),0)
16cflags:=$(cflags:-W -Wall=-w)
17endif
18
19include $(ARBHOME)/SOURCE_TOOLS/export2sub
20
21# --------------------------------------------------------------------------------
22
23nosuchtarget:
24        false
25
26depends: $(ARCHS:.dummy=.depend)
27
28clean: $(ARCHS:.dummy=.clean)
29
30proto:  TREEDISP/TREEDISP.proto \
31        INSDEL/INSDEL.proto \
32
33%.depend:
34        @cp -p $(@D)/Makefile $(@D)/Makefile.old # save old Makefile
35        @$(MAKE) -C $(@D) -r  depends
36        @grep "^# DO NOT DELETE" $(@D)/Makefile >/dev/null # check whether sub Makefile has dependencies
37        @cat $(@D)/Makefile \
38                | ../SOURCE_TOOLS/fix_depends.pl "(from SL)" \
39                >$(@D)/Makefile.2
40        @mv $(@D)/Makefile.old $(@D)/Makefile # restore old Makefile
41        @$(ARBHOME)/SOURCE_TOOLS/mv_if_diff $(@D)/Makefile.2 $(@D)/Makefile # update Makefile if changed
42
43%.dummy:
44        @(($(MAKE) -C $(@D) -r \
45                "ARB  = yes" \
46                "MAIN = $(@F:.dummy=.a)" \
47                "cflags = $(cflags) -DIN_ARB_$(@D:/=)" \
48                >$(@D).log 2>&1 && (cat $(@D).log;rm $(@D).log)) || (cat $(@D).log;rm $(@D).log;false))
49
50# the logging through files is done to avoid that the output of parallel calls gets mixed up (make -j..)
51
52%.clean:
53        @$(MAKE) -C $(@D) \
54                clean
55
56%.proto:
57        @$(MAKE) -C $(@D) \
58                proto
59
60
61# DO NOT DELETE
62
63# Do not add dependencies manually - use 'make depend' in $ARBHOME
64# For formatting issues see SOURCE_TOOLS/fix_depends.pl (from main)
Note: See TracBrowser for help on using the repository browser.