source: rtems/cpukit/automake/compile.am @ fd5e23a

4.104.114.84.95
Last change on this file since fd5e23a was fd5e23a, checked in by Ralf Corsepius <ralf.corsepius@…>, on 11/20/02 at 02:57:45

2002-11-19 Ralf Corsepius <corsepiu@…>

  • automake/compile.am: Remove CFLAGS_DEBUG_OPTIMIZE_V (Unused).
  • Property mode set to 100644
File size: 4.9 KB
Line 
1##
2## $Id$
3##
4
5## -------------------------------------------------------------------------
6## NOTE: This file is rather immature and has to be considered to be
7## almost experimental.
8##
9## Expect frequent changes -- It deserves to be cleaned up :(
10## -------------------------------------------------------------------------
11
12## The section below is based on make/compilers/gcc-target-default.cfg
13## used in former versions of RTEMS.
14
15##
16## Set up the flags for the toolchains:
17##
18## We are considering 3 different building schemes here:
19## * Using gcc's being able to accept -specs (aka gcc-2.8 building scheme)
20## * Using gcc's not being able to accept -specs (aka gcc-2.7.2 building
21##   scheme)
22## * Using third party toolchains (aka non-gcc building scheme)
23##
24## Automake conditionals in use:
25## RTEMS_USE_GCC     .. if we are using GCC
26
27## NOTES:
28## * The gcc-2.8 building scheme is the nominal building scheme and
29##   is actively supported.
30## * The non-gcc building scheme requires manually setting up environment
31##   variables and is hardly tested at all
32
33## CFLAGS_OPTIMIZE_V, CFLAGS_DEBUG_V, CFLAGS_PROFILE_V are the values we
34## would want the corresponding macros to be set to.
35##
36## CFLAGS_OPTIMIZE, CFLAGS_DEBUG, CFLAGS_PROFILE are set by the
37## 'VARIANT=<OPTIMIZE|DEBUG|PROFILE>' targets to their _V values.
38
39## XCPPFLAGS, XCFLAGS, XASFLAGS
40## are used to add flags from the shell
41## cf. make.info ("Implicit rules/variables" for details)
42
43if RTEMS_USE_GCC
44## All the stuff below is specific to gcc
45## gcc >= 2.8.x
46GCCSPECS = $(GCC_SPECS)
47else
48## fall back to the old style compilers/*.cfg
49## CONFIG.CC is supposed to be provided by <BSP>.cfg
50include $(CONFIG.CC)
51endif # RTEMS_USE_GCC
52
53DEFS = @DEFS@
54
55CPPFLAGS = @CPPFLAGS@ $(CPU_DEFINES) \
56   $(DEFINES) $(XCPPFLAGS) $(CPPFLAGS_GCC)
57CFLAGS   = @CFLAGS@ $(CPU_CFLAGS) $(XCFLAGS)
58ASFLAGS  = $(CPU_ASFLAGS) $(CPU_CFLAGS) $(XASFLAGS)
59
60# profile flag; use gprof(1)
61CFLAGS_PROFILE_V=-pg
62
63#
64# How to compile stuff into ${ARCH} subdirectory
65#
66
67COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
68        $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
69CCLD = $(CC)
70
71CCASCOMPILE = $(CCAS) $(AM_CCASFLAGS) $(CCASFLAGS)
72
73${ARCH}/%.$(OBJEXT): %.c
74        ${COMPILE} -o $@ -c $<
75
76${ARCH}/%.$(OBJEXT): %.S
77        ${CCASCOMPILE} -o $@ -c $<
78
79# Make foo.rel from foo.$(OBJEXT)
80${ARCH}/%.rel: ${ARCH}/%.$(OBJEXT)
81        ${make-rel}
82
83# Dependency files for use by gmake
84# NOTE: we don't put them into $(ARCH)
85#       so that 'make clean' doesn't blow it away
86
87DEPEND=Depends-${ARCH}
88
89CLEAN_DEPEND=$(DEPEND).tmp
90CLOBBER_DEPEND=$(DEPEND)
91
92# We deliberately don't have anything depend on the
93# $(DEPEND) file; otherwise it will get rebuilt even
94# on 'make clean'
95#
96
97## HACK: Specific to gcc
98## FIXME: The approach below is known to be conceptionally broken.
99depend-am: $(C_FILES) $(CC_FILES) $(S_FILES)
100##       Use gcc -M to generate dependencies
101##       Replace foo.$(OBJEXT) with $(ARCH)/foo.$(OBJEXT)
102##       Replace $(ARCH) value with string $(ARCH)
103##           so that it will for debug and profile cases
104        $(COMPILE) -M   $^    |  \
105        sed -e 's?^\(.*\)\.o[ ]*:?$$(ARCH)/\1.o:?' \
106            -e 's?$(ARCH)/?$$(ARCH)/?'   >$(DEPEND).tmp
107        mv $(DEPEND).tmp $(DEPEND)
108depend: depend-am
109
110# pull in dependencies if they exist 
111ifeq (${DEPEND},$(wildcard ${DEPEND}))
112include ${DEPEND}
113@ENDIF@
114
115## -------------------------------------------------------------------------
116
117## translate VARIANT into VARIANT_V
118VARIANT = OPTIMIZE
119
120VARIANT_OPTIMIZE_V = OPTIMIZE
121VARIANT_DEBUG_V = DEBUG
122VARIANT_PROFILE_V = PROFILE
123VARIANT_optimize_V = OPTIMIZE
124VARIANT_debug_V = DEBUG
125VARIANT_profile_V = PROFILE
126
127VARIANT_V = $(VARIANT_$(VARIANT)_V)
128
129## Setup the variant build subdirectory
130ARCH_OPTIMIZE_V = o-optimize
131ARCH_DEBUG_V = o-debug
132ARCH_PROFILE_V = o-profile
133
134ARCH__V = $(ARCH_OPTIMIZE_V)
135ARCH = $(ARCH_$(VARIANT_V)_V)
136
137## Setup the library suffix
138LIBSUFFIX_OPTIMIZE_V =
139LIBSUFFIX_DEBUG_V = _g
140LIBSUFFIX_PROFILE_V = _p
141LIBSUFFIX__V = $(LIBSUFFIX_OPTIMIZE_V)
142
143LIB_VARIANT = $(LIBSUFFIX_$(VARIANT_V)_V)
144LIBSUFFIX_VA = $(LIB_VARIANT).a
145
146## These are supposed to be set in make/custom/<bsp>.cfg
147## CFLAGS_OPTIMIZE_V =
148## CFLAGS_DEBUG_V =
149## CFLAGS_PROFILE_V =
150CFLAGS__V = $(CFLAGS_OPTIMIZE_V)
151
152## ------------------------------------------------------------------------
153## Setup hard-coded flags
154if RTEMS_USE_GCC
155## gcc >= gcc-2.8
156RTEMS_CFLAGS_OPTIMIZE_V =
157RTEMS_CFLAGS_DEBUG_V = -Wno-unused
158RTEMS_CFLAGS_PROFILE_V =
159
160## non-gcc
161## We can't guess what flags might be required here.
162## Pass the values from the environment if you want to apply them.
163endif
164RTEMS_CFLAGS__V = $(RTEMS_CFLAGS_OPTIMIZE_V)
165
166## -------------------------------------------------------------------------
167
168CC = @CC@ $(GCCSPECS)
169CPP = @CPP@ $(GCCSPECS)
170
171##
172AM_CPPFLAGS = $(RTEMS_CPPFLAGS)
173
174AM_CFLAGS = $(RTEMS_CFLAGS_$(VARIANT_V)_V) $(CFLAGS_$(VARIANT_V)_V)
175
176# AM_CFLAGS = $(RTEMS_BSP_CFLAGS) $(RTEMS_CFLAGS)
177AM_CCASFLAGS = $(RTEMS_BSP_CFLAGS) $(RTEMS_CPPFLAGS) $(RTEMS_ASFLAGS)
Note: See TracBrowser for help on using the repository browser.