1 # GLOBAL Makefile for all packages
3 # DO NOT EDIT -- Automatically generated by Adam's configuration system!!!
6 IGNORE_OBJDIR_TARGETS := up update diff
10 ALL_SUBDIRS := $(shell echo $(S) | tr ':,' ' ')
15 include $(L4DIR)/mk/Makeconf
18 include $(L4DIR)/mk/project.mk
19 PKGDEPS_IGNORE_MISSING :=
26 # default make action is "all" - build all packages
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.
34 examples: $(filter-out examples,$(BUILD_SUBDIRS))
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)\" ==="
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)
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;,) \
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\"";\
71 PKGDONE="$$PKGDONE $$checkpkg"; \
73 echo "Packages tested: $(CHECK_GOOD) $$PKGDONE"
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
81 $(VERBOSE)dot -Tps -o $@ $<
85 $(VERBOSE)dot -Tsvg -o $@ $<
89 $(VERBOSE)tred $< > $@
91 $(PKGDIR_OBJ)/depsrc.dot: FORCE
93 $(VERBOSE)$(PKGDEPS_CMD) dot $(L4DIR)/pkg > $@
95 $(PKGDIR_OBJ)/depobj.dot: FORCE
97 $(VERBOSE)$(L4DIR)/tool/bin/pkgdepsobj $(L4DIR_ABS) $(OBJ_BASE) $@
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 $@; \
114 .PHONY: TAGS tags depsrcgraph depobjgraph depgraph depcheck
115 .PHONY: $(foreach ext, .bin .lib .include .idl .headers,addsuffix $(ext), $(BUILD_SUBDIRS))
118 $(VERBOSE)$(MAKE) rm-old-links
121 $(VERBOSE)rm -i `find . -name "*~"` `find . -name "#*#"`
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) '{}' ';'
134 # Update Makefile on update.
135 ifneq ($(filter update up,$(MAKECMDGOALS)),)
138 $(SVN) up $@ 2>&1 | tee -a $(UPDATE_LOG)
141 UPDATE_LOG = $(call absfilename, $(L4DIR)/pkg/update.log)
144 $(VERBOSE)$(RM) $(UPDATE_LOG)
146 update up: update.log
147 $(VERBOSE)$(call UPDATE_MESSAGE,Packages)
149 $(SVN) update $(ALL_SUBDIRS) 2>&1 | tee -a $(UPDATE_LOG)
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"