source: rtems/make/leaf.cfg @ 48e02af

4.115
Last change on this file since 48e02af was 50bb5c5f, checked in by Joel Sherrill <joel.sherrill@…>, on 12/08/11 at 21:39:13

2011-12-08 Joel Sherrill <joel.sherrill@…>

PR 1589/build

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