[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 | |
---|
| 37 | # Pull in the desired compiler |
---|
| 38 | # This is almost always the "target" compiler. |
---|
| 39 | # But sometimes, you have to build something on the host. |
---|
| 40 | # Allow for that by allowing individual Makefiles specify $(USE_HOST_COMPILER) |
---|
| 41 | # This will not change $(ARCH) -- binaries will still be place as per target |
---|
| 42 | ifeq (,$(USE_HOST_COMPILER)) |
---|
| 43 | include ${CONFIG.$(TARGET_ARCH).CC} |
---|
| 44 | else |
---|
| 45 | include $(CONFIG.$(HOST_ARCH).CC) |
---|
| 46 | endif |
---|
| 47 | ifeq (${DEPEND},$(wildcard ${DEPEND})) |
---|
| 48 | include ${DEPEND} # pull in dependencies if they exist |
---|
| 49 | endif |
---|
| 50 | |
---|
| 51 | # |
---|
| 52 | # Builtin targets for compilation variants |
---|
| 53 | # |
---|
[29e68b75] | 54 | debug: |
---|
[bffb938] | 55 | $(MAKE) -f $(MAKEFILE) MAKEFILE=$(MAKEFILE) "ARCH=${TARGET_ARCH}-debug" \ |
---|
| 56 | "CFLAGS_DEBUG=$(CFLAGS_DEBUG_V)" \ |
---|
| 57 | "CFLAGS_OPTIMIZE=$(CFLAGS_DEBUG_OPTIMIZE_V)" \ |
---|
| 58 | "LDFLAGS_DEBUG=$(LDFLAGS_DEBUG_V)" $(TARGET_VA) |
---|
| 59 | |
---|
[29e68b75] | 60 | profile: |
---|
[bffb938] | 61 | $(MAKE) -f $(MAKEFILE) \ |
---|
| 62 | MAKEFILE=$(MAKEFILE) "ARCH=${TARGET_ARCH}-profile" \ |
---|
| 63 | "CFLAGS_PROFILE=$(CFLAGS_PROFILE_V)" \ |
---|
| 64 | "LDFLAGS_PROFILE=$(LDFLAGS_PROFILE_V)" $(TARGET_VA) |
---|
| 65 | |
---|
| 66 | # |
---|
| 67 | # VARIANT_VA will convert our ${ARCH} back into "" or "debug" or "profile". |
---|
| 68 | # Handy when one makefile wants to hop over into a peer's tree and |
---|
| 69 | # build something "the same" way. |
---|
| 70 | # |
---|
| 71 | |
---|
| 72 | VARIANT-$(TARGET_ARCH)-v = |
---|
| 73 | VARIANT-$(TARGET_ARCH)-debug-v = debug |
---|
| 74 | VARIANT-$(TARGET_ARCH)-profile-v = profile |
---|
| 75 | |
---|
| 76 | VARIANT_VA = $(VARIANT-$(ARCH)-v) |
---|
| 77 | |
---|
| 78 | # |
---|
[29e68b75] | 79 | # TARGET_VA will convert $@ (expected to be 'debug' or 'profile' etc.) |
---|
[bffb938] | 80 | # into "" or "install" as appropriate. |
---|
| 81 | # Used for variant recursion. |
---|
| 82 | # |
---|
| 83 | |
---|
| 84 | TARGET_debug_V = all |
---|
| 85 | TARGET_profile_V = all |
---|
| 86 | |
---|
| 87 | TARGET_VA = $(TARGET_$@_V) |
---|
| 88 | |
---|
| 89 | # |
---|
| 90 | # LIBSUFFIX_VA, will "index" into LIBSUFF-*-v macros and |
---|
| 91 | # convert our ${ARCH} back into .a or _g.a or _p.a based on debug or profile. |
---|
| 92 | # Useful for installing libraries. |
---|
| 93 | # |
---|
| 94 | |
---|
| 95 | LIBSUFFIX_$(TARGET_ARCH)_V= |
---|
| 96 | LIBSUFFIX_$(TARGET_ARCH)-debug_V=_g |
---|
| 97 | LIBSUFFIX_$(TARGET_ARCH)-profile_V=_p |
---|
| 98 | |
---|
| 99 | LIB_VARIANT=$(LIBSUFFIX_$(ARCH)_V) |
---|
| 100 | LIBSUFFIX_VA = $(LIB_VARIANT).a |
---|
| 101 | |
---|
| 102 | # |
---|
[29e68b75] | 103 | # Builtin clean and distclean rules |
---|
[bffb938] | 104 | # Individual makefiles can add stuff via CLEAN_ADDITIONS and CLOBBER_ADDITIONS |
---|
| 105 | # If desperate to save something, they can override CLEAN_OS, CLEAN_CC, etc. |
---|
| 106 | # |
---|
| 107 | |
---|
[29e68b75] | 108 | clean-am: clean-generic |
---|
| 109 | -$(RM) -r $(CLEAN_OS) $(CLEAN_CC) $(CLEAN_DEPEND) |
---|
| 110 | -$(RM) -r $(VARIANTS) |
---|
[bffb938] | 111 | |
---|
[29e68b75] | 112 | distclean-am: distclean-generic clean-am |
---|
| 113 | -$(RM) -r $(CLOBBER_OS) $(CLOBBER_CC) $(CLOBBER_DEPEND) |
---|
[6693a68] | 114 | |
---|
| 115 | preinstall-am: |
---|
| 116 | preinstall: preinstall-am |
---|
[29e68b75] | 117 | |
---|
| 118 | distclean: distclean-am |
---|
| 119 | -$(RM) config.status |
---|
| 120 | clean: clean-am |
---|
| 121 | |
---|
| 122 | .PHONY: distclean distclean-am |
---|
| 123 | .PHONY: clean clean-am |
---|