source: tags/old_import_filter/SL/Makefile

Last change on this file was 9633, checked in by westram, 11 years ago
  • reintegrated branch 'sai'
    • providing basic insert/delete by SAI
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.6 KB
Line 
1# --------------------------------------------------------------------------------
2# when adding a new library (in a new SUBDIR), perform the following steps:
3#
4# - create new subdir and copy a recent Makefile into there             e.g. use ./REFENTRIES/Makefile
5# - add a dependency vs 'links' or 'links_non_perl'                     in ../Makefile@ADD_links_non_perl
6# - add it to the ARCHS_... definitions used for linking                in ../Makefile@Individual_Programs_Section
7# - add all externally visible headers                                  in ../SOURCE_TOOLS/generate_all_links.sh@ALIVIEW
8# - add a stub for (nonexisting) unit tests                             in ../Makefile@UNITS_WORKING
9#   or activate existing unit tests                                     in ../Makefile@UNITS_TESTED
10#
11# --------------------------------------------------------------------------------
12
13# automatically handles all subdirectories
14ARCHS:=$(shell find . -maxdepth 1 -type d)# find all direct sub-directories
15ARCHS:=$(sort $(filter-out . .svn,$(subst ./,,$(ARCHS))))# remove prefix './' and get rid of '.' and '.svn'
16ARCHS:=$(shell echo $(ARCHS) | perl -pn -e 's/([A-Za-z0-9_]+)/\1\/\1/g;')# replace not possible $(patsubst %,%/%,$(ARCHS))
17ARCHS:=$(ARCHS:%=%.dummy)
18
19# --------------------------------------------------------------------------------
20# warnings in this subtree?
21
22RAISE_WARNINGS=1
23
24ifeq ($(RAISE_WARNINGS),0)
25CPP:=$(CPP:-W -Wall=-w)
26ACC:=$(ACC:-W -Wall=-w)
27endif
28
29include $(ARBHOME)/SOURCE_TOOLS/export2sub
30
31# --------------------------------------------------------------------------------
32
33nosuchtarget:
34        false
35
36depends: $(ARCHS:.dummy=.depend)
37
38clean: $(ARCHS:.dummy=.clean)
39
40proto:  TREEDISP/TREEDISP.proto \
41        INSDEL/INSDEL.proto \
42
43%.depend:
44        @cp -p $(@D)/Makefile $(@D)/Makefile.old # save old Makefile
45        @$(MAKE) -C $(@D) -r  depends
46        @grep "^# DO NOT DELETE" $(@D)/Makefile >/dev/null # check whether sub Makefile has dependencies
47        @cat $(@D)/Makefile \
48                | ../SOURCE_TOOLS/fix_depends.pl "(from SL)" \
49                >$(@D)/Makefile.2
50        @mv $(@D)/Makefile.old $(@D)/Makefile # restore old Makefile
51        @$(ARBHOME)/SOURCE_TOOLS/mv_if_diff $(@D)/Makefile.2 $(@D)/Makefile # update Makefile if changed
52
53%.dummy:
54        @(($(MAKE) -C $(@D) -r \
55                "ARB  = yes" \
56                "MAIN = $(@F:.dummy=.a)" \
57                "cflags = $(cflags) -DIN_ARB_$(@D:/=)" \
58                >$(@D).log 2>&1 && (cat $(@D).log;rm $(@D).log)) || (cat $(@D).log;rm $(@D).log;false))
59
60# the logging through files is done to avoid that the output of parallel calls gets mixed up (make -j..)
61
62%.clean:
63        @$(MAKE) -C $(@D) \
64                clean
65
66%.proto:
67        @$(MAKE) -C $(@D) \
68                proto
69
70
71# DO NOT DELETE
72
73# Do not add dependencies manually - use 'make depend' in $ARBHOME
74# For formatting issues see SOURCE_TOOLS/fix_depends.pl (from main)
Note: See TracBrowser for help on using the repository browser.