source: trunk/SL/Makefile

Last change on this file was 19447, checked in by westram, 16 months ago
  • suppression of warnings for source-subtrees:
    • comment + warn when suppressed (currently suppressed in GDE)
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.3 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))
8
9# when you attempt to remove a subdir of SL, make will fail on targets 'depends', 'clean' and 'proto'
10# next line manually excludes the removed subdir (which is still present in WC until commit)
11ARCHS:=$(subst ROOTED_TREE/ROOTED_TREE,,$(ARCHS))
12
13ARCHS:=$(ARCHS:%=%.dummy)
14
15# --------------------------------------------------------------------------------
16# warnings in this subtree?
17
18RAISE_WARNINGS=1# raise warnings in this subtree?
19
20ifeq ($(RAISE_WARNINGS),0)
21cflags:=$(cflags:-W -Wall=-w)
22$(warning Warning: All compiler warnings were disabled in subtree SL. Doing so is not recommended!)
23endif
24
25include $(ARBHOME)/SOURCE_TOOLS/export2sub
26
27# --------------------------------------------------------------------------------
28
29nosuchtarget:
30        false
31
32depends: $(ARCHS:.dummy=.depend)
33
34clean: $(ARCHS:.dummy=.clean)
35
36proto:  TREEDISP/TREEDISP.proto \
37        INSDEL/INSDEL.proto \
38
39%.depend:
40        @cp -p $(@D)/Makefile $(@D)/Makefile.old # save old Makefile
41        @$(MAKE) -C $(@D) -r  depends
42        @grep "^# DO NOT DELETE" $(@D)/Makefile >/dev/null # check whether sub Makefile has dependencies
43        @cat $(@D)/Makefile \
44                | ../SOURCE_TOOLS/fix_depends.pl "(from SL)" \
45                >$(@D)/Makefile.2
46        @mv $(@D)/Makefile.old $(@D)/Makefile # restore old Makefile
47        @$(ARBHOME)/SOURCE_TOOLS/mv_if_diff $(@D)/Makefile.2 $(@D)/Makefile # update Makefile if changed
48
49%.dummy:
50        @(($(MAKE) -C $(@D) -r \
51                "ARB  = yes" \
52                "MAIN = $(@F:.dummy=.a)" \
53                "cflags = $(cflags) -DIN_ARB_$(@D:/=)" \
54                >$(@D).log 2>&1 && (cat $(@D).log;rm $(@D).log)) || (cat $(@D).log;rm $(@D).log;false))
55
56# the logging through files is done to avoid that the output of parallel calls gets mixed up (make -j..)
57
58%.clean:
59        @$(MAKE) -C $(@D) \
60                clean
61
62%.proto:
63        @$(MAKE) -C $(@D) \
64                proto
65
66
67# DO NOT DELETE
68
69# Do not add dependencies manually - use 'make depend' in $ARBHOME
70# For formatting issues see SOURCE_TOOLS/fix_depends.pl (from main)
Note: See TracBrowser for help on using the repository browser.