]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/Makefile
fiasco: drivers-frst: Get this code back to default state. Port interference problem...
[l4.git] / l4 / pkg / Makefile
1 # GLOBAL Makefile for all packages
2 #
3 # DO NOT EDIT -- Automatically generated by Adam's configuration system!!!
4 #
5
6 IGNORE_OBJDIR_TARGETS := up update diff
7
8 L4DIR ?= ..
9 ifneq ($(S),)
10   ALL_SUBDIRS := $(shell echo $(S) | tr ':,' ' ')
11 endif
12
13 all::
14
15 include $(L4DIR)/mk/Makeconf
16
17 ifneq ($(OBJ_BASE),)
18 include $(L4DIR)/mk/project.mk
19 PKGDEPS_IGNORE_MISSING :=
20 endif
21
22 #####################
23 # Rules begin.
24
25 #####################
26 # default make action is "all" - build all packages
27 #
28 # We build all l4env headers (idl+includes), then all l4env libs, then the
29 # l4env servers and examples. Then we build the other headers
30 # (idl+includes), the other libs, the other servers and examples. We use
31 # dependencies for this, witch might allow parallel build processes.
32 #
33
34 examples: $(filter-out examples,$(BUILD_SUBDIRS))
35
36 .PHONY: all ptest
37 .PHONY: rm-old-links
38
39 PURGE_INC_MESSAGE =echo "=== Purging pending links in $(L4DIR)/include ==="
40 PURGE_LIB_MESSAGE =echo "=== Purging pending links in $(L4DIR)/lib ==="
41 UPDATE_MESSAGE    =echo -e $(EMPHSTART)"=== Updating \"$(1)\" ==="$(EMPHSTOP)
42 DIFF_MESSAGE      =echo -e $(EMPHSTART)"=== Diffing \"$(1)\" ==="$(EMPHSTOP)
43 PTEST_MESSAGE     =echo "=== Testing Package \"$(1)\" ==="
44
45 # Check package dependencies.
46 #   CHECK_PKGS: if undefined, check all packages,
47 #               otherwise gives a list of space separated packages to check
48 #   CHECK_FULL: if set rebuild for every new package check
49 #                 (ccache recommended when using this flag)
50 depcheck:
51         $(VERBOSE)set -e; \
52         $(RM) -r $(filter-out $(OBJ_BASE)/pkg/Makefile,       \
53                               $(wildcard $(OBJ_BASE)/pkg/*)); \
54         for checkpkg in $(filter-out $(CHECK_GOOD),$(if $(CHECK_PKGS),$(CHECK_PKGS),$(BUILD_SUBDIRS))); do \
55           echo ==========================================================;     \
56           echo "Deleting all pkgs in build-dir";                               \
57           $(RM) -r $(OBJ_BASE)/lib $(OBJ_BASE)/bin $(OBJ_BASE)/include         \
58                    $(OBJ_BASE)/pc $(OBJ_BASE)/pkg/.Package.deps                \
59                    $(OBJ_BASE)/pkg/.Package.deps.pkgs;                         \
60           $(if $(CHECK_FULL),$(RM) -r $(OBJ_BASE)/pkg;,)                       \
61           echo "Done";                                                         \
62           echo ----------------------------------------------------------;     \
63           echo "Trying standalone build of '$$checkpkg'";                      \
64           $(MAKE) -C $(L4DIR) O=$(OBJ_BASE)                                    \
65             --no-print-directory silentoldconfig;                              \
66           echo $(MAKE) O=$(OBJ_BASE) --no-print-directory $$checkpkg;          \
67           $(MAKE) O=$(OBJ_BASE) --no-print-directory $$checkpkg                \
68             || (echo "Failed package: $$checkpkg";                             \
69                 echo "Good package(s): CHECK_GOOD=\"$(CHECK_GOOD) $$PKGDONE\"";\
70                 exit 1) || exit 1;                                             \
71           PKGDONE="$$PKGDONE $$checkpkg";                                      \
72         done;                                                                  \
73         echo "Packages     tested: $(CHECK_GOOD) $$PKGDONE"
74
75 depgraph: depsrcgraph depobjgraph
76 depsrcgraph: $(PKGDIR_OBJ)/depsrc.svg $(PKGDIR_OBJ)/depsrc.ps $(PKGDIR_OBJ)/depsrc.reduced.svg $(PKGDIR_OBJ)/depsrc.reduced.ps
77 depobjgraph: $(PKGDIR_OBJ)/depobj.svg $(PKGDIR_OBJ)/depobj.ps $(PKGDIR_OBJ)/depobj.reduced.svg $(PKGDIR_OBJ)/depobj.reduced.ps
78
79 %.ps: %.dot
80         @$(GEN_MESSAGE)
81         $(VERBOSE)dot -Tps -o $@ $<
82
83 %.svg: %.dot
84         @$(GEN_MESSAGE)
85         $(VERBOSE)dot -Tsvg -o $@ $<
86
87 %.reduced.dot: %.dot
88         @$(GEN_MESSAGE)
89         $(VERBOSE)tred $< > $@
90
91 $(PKGDIR_OBJ)/depsrc.dot: FORCE 
92         @$(GEN_MESSAGE)
93         $(VERBOSE)$(PKGDEPS_CMD) dot $(L4DIR)/pkg > $@
94
95 $(PKGDIR_OBJ)/depobj.dot: FORCE
96         @$(GEN_MESSAGE)
97         $(VERBOSE)$(L4DIR)/tool/bin/pkgdepsobj $(L4DIR_ABS) $(OBJ_BASE) $@
98
99 ptest:
100         $(VERBOSE)set -e; \
101         for d in $(BUILD_SUBDIRS); do \
102           if [ -n "$$(find $$d -type d -name $@)" ]; then \
103             $(call PTEST_MESSAGE,$(BID_DOLLARQUOTE)$$d); \
104             PWD=$(PWD)/$$d $(MAKE) -C $$d $@; \
105           fi; \
106         done
107
108 TAGS:
109         $(ETAGS)
110
111 tags:
112         $(CTAGS)
113
114 .PHONY: TAGS tags depsrcgraph depobjgraph depgraph depcheck
115 .PHONY: $(foreach ext, .bin .lib .include .idl .headers,addsuffix $(ext), $(BUILD_SUBDIRS))
116
117 clean cleanall::
118         $(VERBOSE)$(MAKE) rm-old-links
119
120 del-backup:
121         $(VERBOSE)rm -i `find . -name "*~"` `find . -name "#*#"`
122
123 rm-old-links:
124         @$(PURGE_INC_MESSAGE)
125         $(VERBOSE)test ! -d $(L4DIR)/include || \
126           find $(L4DIR)/include -type l -a ! -xtype f -a ! -xtype d \
127             -exec rm $(if $(VERBOSE),,-v) '{}' ';'
128         @$(PURGE_LIB_MESSAGE)
129         $(VERBOSE)test ! -d $(L4DIR)/lib || \
130           find $(L4DIR)/lib -type l -a ! -xtype f -a ! -xtype d \
131             -exec rm $(if $(VERBOSE),,-v) '{}' ';'
132
133
134 # Update Makefile on update.
135 ifneq ($(filter update up,$(MAKECMDGOALS)),)
136 .PHONY: Makefile
137 Makefile: update.log
138         $(SVN) up $@ 2>&1 | tee -a $(UPDATE_LOG)
139 endif
140
141 UPDATE_LOG = $(call absfilename, $(L4DIR)/pkg/update.log)
142 .PHONY: update.log
143 update.log:
144         $(VERBOSE)$(RM) $(UPDATE_LOG)
145
146 update up: update.log
147         $(VERBOSE)$(call UPDATE_MESSAGE,Packages)
148         $(VERBOSE)set -e; \
149           $(SVN) update $(ALL_SUBDIRS) 2>&1 | tee -a $(UPDATE_LOG)
150
151 # global defines
152
153 .PHONY: kernels
154
155 help::
156         @echo "Specify one of the following targets:"
157         @echo "del-backup      - remove temporary file in this tree"
158         @echo 'rm-old-links    - remove invalid symlinks in $$(L4DIR)/lib, $$(L4DIR)/include'
159         @echo "update          - update the packages currently checked out"
160         @echo "help            - this help"
161