[bffb938] | 1 | # |
---|
| 2 | # $Id$ |
---|
| 3 | # |
---|
| 4 | # make/leaf.cfg |
---|
| 5 | # |
---|
| 6 | # Make(1) configuration file include'd by all leaf-node Makefiles |
---|
| 7 | # |
---|
| 8 | |
---|
| 9 | # |
---|
| 10 | # list of all known managers |
---|
| 11 | # This list is used, along with $(MANAGERS) (set by app makefile) |
---|
| 12 | # to build the list of *not wanted* drivers. |
---|
| 13 | # |
---|
| 14 | # ref: target compiler config file for usage |
---|
| 15 | # |
---|
| 16 | |
---|
| 17 | MANAGER_LIST=dpmem event io msg mp part region sem signal timer rtmon ext |
---|
| 18 | |
---|
| 19 | # Convert *real* spellings in $(MANAGERS) (set |
---|
| 20 | # in application makefile) to their "correct" name. |
---|
| 21 | # (I hate abbreviations :-) |
---|
| 22 | |
---|
| 23 | MANAGERS := $(patsubst message, msg, $(MANAGERS)) |
---|
| 24 | MANAGERS := $(patsubst multi_processor, mp, $(MANAGERS)) |
---|
| 25 | MANAGERS := $(patsubst partition, part, $(MANAGERS)) |
---|
| 26 | MANAGERS := $(patsubst rate_monotonic, rtmon, $(MANAGERS)) |
---|
| 27 | MANAGERS := $(patsubst semaphore, sem, $(MANAGERS)) |
---|
| 28 | MANAGERS := $(patsubst dual_ported_memory, dpmem, $(MANAGERS)) |
---|
| 29 | MANAGERS := $(patsubst extension, ext, $(MANAGERS)) |
---|
| 30 | |
---|
| 31 | # allow 'all' to mean all managers |
---|
| 32 | MANAGERS := $(patsubst all, $(MANAGER_LIST), $(MANAGERS)) |
---|
| 33 | |
---|
| 34 | # and finally rip out duplicates |
---|
| 35 | MANAGERS := $(sort $(MANAGERS)) |
---|
| 36 | |
---|
[65a60cd] | 37 | # Pull in the desired "target" compiler |
---|
| 38 | # Programs built on the host use automake generated rules. |
---|
[bffb938] | 39 | # This will not change $(ARCH) -- binaries will still be place as per target |
---|
[d6c83529] | 40 | include ${CONFIG.CC} |
---|
[bffb938] | 41 | ifeq (${DEPEND},$(wildcard ${DEPEND})) |
---|
| 42 | include ${DEPEND} # pull in dependencies if they exist |
---|
| 43 | endif |
---|
| 44 | |
---|
[df49c60] | 45 | ifndef AUTOMAKE |
---|
[bffb938] | 46 | # |
---|
| 47 | # Builtin targets for compilation variants |
---|
| 48 | # |
---|
[29e68b75] | 49 | debug: |
---|
[d6c83529] | 50 | $(MAKE) -f $(MAKEFILE) MAKEFILE=$(MAKEFILE) "ARCH=o-debug" \ |
---|
[bffb938] | 51 | "CFLAGS_DEBUG=$(CFLAGS_DEBUG_V)" \ |
---|
[8ef3818] | 52 | "CXXFLAGS_DEBUG=$(CXXFLAGS_DEBUG_V)" \ |
---|
[93f79c0f] | 53 | "CFLAGS_OPTIMIZE=$(CFLAGS_OPTIMIZE_V)" \ |
---|
[bffb938] | 54 | "LDFLAGS_DEBUG=$(LDFLAGS_DEBUG_V)" $(TARGET_VA) |
---|
| 55 | |
---|
[29e68b75] | 56 | profile: |
---|
[bffb938] | 57 | $(MAKE) -f $(MAKEFILE) \ |
---|
[d6c83529] | 58 | MAKEFILE=$(MAKEFILE) "ARCH=o-profile" \ |
---|
[bffb938] | 59 | "CFLAGS_PROFILE=$(CFLAGS_PROFILE_V)" \ |
---|
[8ef3818] | 60 | "CXXFLAGS_PROFILE=$(CXXFLAGS_PROFILE_V)" \ |
---|
[bffb938] | 61 | "LDFLAGS_PROFILE=$(LDFLAGS_PROFILE_V)" $(TARGET_VA) |
---|
[df49c60] | 62 | endif |
---|
[bffb938] | 63 | |
---|
| 64 | # |
---|
| 65 | # VARIANT_VA will convert our ${ARCH} back into "" or "debug" or "profile". |
---|
| 66 | # Handy when one makefile wants to hop over into a peer's tree and |
---|
| 67 | # build something "the same" way. |
---|
| 68 | # |
---|
| 69 | |
---|
[d6c83529] | 70 | VARIANT-o-optimize-v = |
---|
| 71 | VARIANT-o-debug-v = debug |
---|
| 72 | VARIANT-o-profile-v = profile |
---|
[bffb938] | 73 | |
---|
| 74 | VARIANT_VA = $(VARIANT-$(ARCH)-v) |
---|
| 75 | |
---|
| 76 | # |
---|
[29e68b75] | 77 | # TARGET_VA will convert $@ (expected to be 'debug' or 'profile' etc.) |
---|
[bffb938] | 78 | # into "" or "install" as appropriate. |
---|
| 79 | # Used for variant recursion. |
---|
| 80 | # |
---|
| 81 | |
---|
| 82 | TARGET_debug_V = all |
---|
| 83 | TARGET_profile_V = all |
---|
| 84 | |
---|
| 85 | TARGET_VA = $(TARGET_$@_V) |
---|
| 86 | |
---|
| 87 | # |
---|
| 88 | # LIBSUFFIX_VA, will "index" into LIBSUFF-*-v macros and |
---|
| 89 | # convert our ${ARCH} back into .a or _g.a or _p.a based on debug or profile. |
---|
| 90 | # Useful for installing libraries. |
---|
| 91 | # |
---|
| 92 | |
---|
[d6c83529] | 93 | LIBSUFFIX_o-optimize_V= |
---|
| 94 | LIBSUFFIX_o-debug_V=_g |
---|
| 95 | LIBSUFFIX_o-profile_V=_p |
---|
[bffb938] | 96 | |
---|
| 97 | LIB_VARIANT=$(LIBSUFFIX_$(ARCH)_V) |
---|
| 98 | LIBSUFFIX_VA = $(LIB_VARIANT).a |
---|
| 99 | |
---|
| 100 | # |
---|
[29e68b75] | 101 | # Builtin clean and distclean rules |
---|
[bffb938] | 102 | # Individual makefiles can add stuff via CLEAN_ADDITIONS and CLOBBER_ADDITIONS |
---|
| 103 | # If desperate to save something, they can override CLEAN_OS, CLEAN_CC, etc. |
---|
| 104 | # |
---|
| 105 | |
---|
[29e68b75] | 106 | clean-am: clean-generic |
---|
| 107 | -$(RM) -r $(CLEAN_OS) $(CLEAN_CC) $(CLEAN_DEPEND) |
---|
| 108 | -$(RM) -r $(VARIANTS) |
---|
[bffb938] | 109 | |
---|
[29e68b75] | 110 | distclean-am: distclean-generic clean-am |
---|
| 111 | -$(RM) -r $(CLOBBER_OS) $(CLOBBER_CC) $(CLOBBER_DEPEND) |
---|
[6693a68] | 112 | |
---|
[df49c60] | 113 | ifndef AUTOMAKE |
---|
[6693a68] | 114 | preinstall-am: |
---|
| 115 | preinstall: preinstall-am |
---|
[29e68b75] | 116 | |
---|
| 117 | distclean: distclean-am |
---|
[7dd4054] | 118 | -$(RM) ./config.status |
---|
| 119 | |
---|
[29e68b75] | 120 | clean: clean-am |
---|
| 121 | |
---|
| 122 | .PHONY: distclean distclean-am |
---|
| 123 | .PHONY: clean clean-am |
---|
[df49c60] | 124 | endif |
---|