source: rtems/make/leaf.cfg @ efdda565

4.11
Last change on this file since efdda565 was efdda565, checked in by Nick Withers <nick.withers@…>, on Aug 9, 2013 at 4:18:17 AM

Use $(EXEEXT) [defaults to "exe"] to generate binaries

  • Property mode set to 100644
File size: 2.4 KB
Line 
1# make/leaf.cfg
2#
3#   Make(1) configuration file include'd by all leaf-node Makefiles
4#
5
6#
7# LIBSUFFIX_VA, will "index" into LIBSUFF-*-v macros and
8#   convert our ${ARCH} back into .a or _g.a or _p.a based on debug.
9#   Useful for installing libraries.
10#
11
12LIBSUFFIX_OPTIMIZE_V=
13LIBSUFFIX_DEBUG_V=_g
14
15LIB_VARIANT=$(LIBSUFFIX_$(VARIANT_V)_V)
16LIBSUFFIX_VA = $(LIB_VARIANT).a
17
18# Pull in the desired "target" compiler
19# Programs built on the host use automake generated rules.
20# This will not change $(ARCH) -- binaries will still be place as per target
21include ${CONFIG.CC}
22ifeq (${DEPEND},$(wildcard ${DEPEND}))
23include ${DEPEND}                    # pull in dependencies if they exist
24endif
25
26ifndef AUTOMAKE
27#
28# Builtin targets for compilation variants
29#
30debug:
31        $(MAKE) -f $(MAKEFILE) MAKEFILE=$(MAKEFILE) VARIANT=DEBUG
32endif
33
34#
35# VARIANT_VA will convert our ${ARCH} back into "" or "debug".
36#   Handy when one makefile wants to hop over into a peer's tree and
37#   build something "the same" way.
38#
39
40VARIANT-OPTIMIZE-v =
41VARIANT-DEBUG-v = debug
42
43VARIANT_VA = $(VARIANT-$(VARIANT_V)-v)
44
45#
46# TARGET_VA will convert $@ (expected to be 'debug' etc.)
47#   into "" or "install" as appropriate.
48#   Used for variant recursion.
49#
50
51TARGET_debug_V = all
52
53TARGET_VA = $(TARGET_$@_V)
54
55#
56# Builtin clean and distclean rules
57# Individual makefiles can add stuff via CLEAN_ADDITIONS and CLOBBER_ADDITIONS
58# If desperate to save something, they can override CLEAN_OS, CLEAN_CC, etc.
59#
60
61clean-am: clean-generic
62        -$(RM) -r $(CLEAN_OS) $(CLEAN_CC) $(CLEAN_DEPEND)
63        -$(RM) -r $(VARIANTS)
64
65distclean-am: distclean-generic clean-am
66        -$(RM) -r $(CLOBBER_OS) $(CLOBBER_CC) $(CLOBBER_DEPEND)
67
68ifndef AUTOMAKE
69preinstall-am:
70preinstall: preinstall-am
71
72distclean: distclean-am
73        -$(RM) ./config.status
74
75clean: clean-am
76
77.PHONY: distclean distclean-am
78.PHONY: clean clean-am
79endif
80
81EXEEXT?=.exe
82DOWNEXT?=.ralf
83
84define bsp-link-c
85        $(LINK.c) $(CPU_CFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) \
86            -o $(basename $@)$(EXEEXT) $(LINK_OBJS) $(LINK_LIBS)
87endef
88
89define bsp-link-cxx
90        $(LINK.cc) $(CPU_CFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) \
91            -o $(basename $@)$(EXEEXT) $(LINK_OBJS) $(LINK_LIBS)
92endef
93
94define default-bsp-post-link
95        $(NM) -g -n $@ > $(basename $@).num
96        $(SIZE) $@
97endef
98
99ifndef bsp-post-link
100define bsp-post-link
101        $(default-bsp-post-link)
102        cp $(basename $@)$(EXEEXT) $(basename $@)$(DOWNEXT)
103endef
104endif
105
106define make-exe
107       $(bsp-link-c)
108       $(bsp-post-link)
109endef
110
111define make-cxx-exe
112       $(bsp-link-cxx)
113       $(bsp-post-link)
114endef
Note: See TracBrowser for help on using the repository browser.