summaryrefslogtreecommitdiffstats
path: root/make/compilers/gcc-target-default.cfg
diff options
context:
space:
mode:
Diffstat (limited to 'make/compilers/gcc-target-default.cfg')
-rw-r--r--make/compilers/gcc-target-default.cfg20
1 files changed, 13 insertions, 7 deletions
diff --git a/make/compilers/gcc-target-default.cfg b/make/compilers/gcc-target-default.cfg
index 88b5e58c0d..fb5dfbad62 100644
--- a/make/compilers/gcc-target-default.cfg
+++ b/make/compilers/gcc-target-default.cfg
@@ -93,21 +93,21 @@ ifeq ($(RTEMS_USE_GCC272),no)
CFLAGS_DEBUG_V+=-qrtems_debug
endif
-# when debugging, optimize flag: typically empty
-# some compilers do allow optimization with their "-g"
-CFLAGS_DEBUG_OPTIMIZE_V=-g
-
# profile flag; use gprof(1)
CFLAGS_PROFILE_V=-pg
+ifndef AUTOMAKE
# default is to optimize
CFLAGS_OPTIMIZE=$(CFLAGS_OPTIMIZE_V)
+endif
# dynamic libraries
#CFLAGS_DYNAMIC_V=-fpic
#ASFLAGS_DYNAMIC_V=
+ifndef AUTOMAKE
CFLAGS += $(CFLAGS_OPTIMIZE) $(CFLAGS_DEBUG) $(CFLAGS_PROFILE)
+endif
# List of library paths without -L
LD_PATHS= $(PROJECT_RELEASE)/lib
@@ -186,7 +186,7 @@ ${ARCH}/%.o: %.S
# Make foo.rel from foo.o
${ARCH}/%.rel: ${ARCH}/%.o
- ${LD} $(LDFLAGS_INCOMPLETE) -o $@ $^
+ ${make-rel}
# create $(ARCH)/pgm from pgm.sh
${ARCH}/%: %.sh
@@ -214,7 +214,7 @@ ifneq ($(words $(C_FILES) $(CC_FILES) $(S_FILES)), 0)
# Replace foo.o with $(ARCH)/foo.o
# Replace $(ARCH) value with string $(ARCH)
# so that it will for debug and profile cases
- $(COMPILE.c) -M $^ | \
+ $(COMPILE.c) $(AM_CPPFLAGS) $(AM_CFLAGS) -M $^ | \
$(SED) -e 's?^\(.*\)\.o[ ]*:?$$(ARCH)/\1.o:?' \
-e 's?$(ARCH)/?$$(ARCH)/?' >$(DEPEND).tmp
$(MV) $(DEPEND).tmp $(DEPEND)
@@ -289,7 +289,13 @@ ifndef LINKCMDS
LINKCMDS=$(PROJECT_RELEASE)/lib/linkcmds
endif
-
+ifeq ($(RTEMS_USE_GCC272),yes)
define make-rel
$(LD) $(LDFLAGS_INCOMPLETE) $(XLDFLAGS) -o $@ $^
endef
+else
+define make-rel
+ $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) \
+ -qnolinkcmds -nostdlib -Wl,-r $(XLDFLAGS) -o $@ $^
+endef
+endif