Back to home page

LXR

 
 

    


Warning, /make/leaf.cfg is written in an unsupported language. File is not indexed.

0001 # make/leaf.cfg
0002 #
0003 #   Make(1) configuration file include'd by all leaf-node Makefiles
0004 #
0005 
0006 #
0007 # LIBSUFFIX_VA, will "index" into LIBSUFF-*-v macros and
0008 #   convert our ${ARCH} back into .a or _g.a or _p.a based on debug.
0009 #   Useful for installing libraries.
0010 #
0011 
0012 LIBSUFFIX_OPTIMIZE_V=
0013 LIBSUFFIX_DEBUG_V=_g
0014 
0015 LIB_VARIANT=$(LIBSUFFIX_$(VARIANT_V)_V)
0016 LIBSUFFIX_VA = $(LIB_VARIANT).a
0017 
0018 # Pull in the desired "target" compiler
0019 # Programs built on the host use automake generated rules.
0020 # This will not change $(ARCH) -- binaries will still be placed as per target
0021 include ${CONFIG.CC}
0022 ifeq (${DEPEND},$(wildcard ${DEPEND}))
0023 include ${DEPEND}                    # pull in dependencies if they exist
0024 endif
0025 
0026 ifndef AUTOMAKE
0027 #
0028 # Builtin targets for compilation variants
0029 #
0030 debug:
0031         $(MAKE) -f $(MAKEFILE) MAKEFILE=$(MAKEFILE) VARIANT=DEBUG
0032 endif
0033 
0034 #
0035 # VARIANT_VA will convert our ${ARCH} back to "" or "debug".
0036 #   Handy when one makefile wants to hop over into a peer's tree and
0037 #   build something "the same" way.
0038 #
0039 
0040 VARIANT-OPTIMIZE-v =
0041 VARIANT-DEBUG-v = debug
0042 
0043 VARIANT_VA = $(VARIANT-$(VARIANT_V)-v)
0044 
0045 #
0046 # TARGET_VA will convert $@ (expected to be 'debug' etc.)
0047 #   into "" or "install" as appropriate.
0048 #   Used for variant recursion.
0049 #
0050 
0051 TARGET_debug_V = all
0052 
0053 TARGET_VA = $(TARGET_$@_V)
0054 
0055 #
0056 # Builtin clean and distclean rules
0057 # Individual makefiles can add stuff via CLEAN_ADDITIONS and CLOBBER_ADDITIONS
0058 # If desperate to save something, they can override CLEAN_OS, CLEAN_CC, etc.
0059 #
0060 
0061 clean-am: clean-generic
0062         -$(RM) -r $(CLEAN_OS) $(CLEAN_CC) $(CLEAN_DEPEND)
0063         -$(RM) -r $(VARIANTS)
0064 
0065 distclean-am: distclean-generic clean-am
0066         -$(RM) -r $(CLOBBER_OS) $(CLOBBER_CC) $(CLOBBER_DEPEND)
0067 
0068 ifndef AUTOMAKE
0069 preinstall-am:
0070 preinstall: preinstall-am
0071 
0072 distclean: distclean-am
0073         -$(RM) ./config.status
0074 
0075 clean: clean-am
0076 
0077 .PHONY: distclean distclean-am
0078 .PHONY: clean clean-am
0079 endif
0080 
0081 EXEEXT?=.exe
0082 DOWNEXT?=.ralf
0083 
0084 define bsp-link-c
0085         $(LINK.c) $(CPU_CFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) \
0086             -o $(basename $@)$(EXEEXT) $(LINK_OBJS) $(LINK_LIBS)
0087 endef
0088 
0089 define bsp-link-cxx
0090         $(LINK.cc) $(CPU_CFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) \
0091             -o $(basename $@)$(EXEEXT) $(LINK_OBJS) $(LINK_LIBS)
0092 endef
0093 
0094 define default-bsp-post-link
0095         $(NM) -g -n $@ > $(basename $@).num
0096         $(SIZE) $@
0097 endef
0098 
0099 ifndef bsp-post-link
0100 define bsp-post-link
0101         $(default-bsp-post-link)
0102         cp $(basename $@)$(EXEEXT) $(basename $@)$(DOWNEXT)
0103 endef
0104 endif
0105 
0106 define make-exe
0107        $(bsp-link-c)
0108        $(bsp-post-link)
0109 endef
0110 
0111 define make-cxx-exe
0112        $(bsp-link-cxx)
0113        $(bsp-post-link)
0114 endef