summaryrefslogtreecommitdiffstats
path: root/make
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1999-02-18 17:55:49 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1999-02-18 17:55:49 +0000
commita110b68252d6fad61fc36f08257bb8659c17a693 (patch)
tree73641ee46439facf7f80fb1096d9a6ac81c3b0a5 /make
parent011677f8fc6ce37832e88a65500b7c08e9dba73e (diff)
downloadrtems-a110b68252d6fad61fc36f08257bb8659c17a693.tar.bz2
Part of automake VI patch from Ralf Corsepius <corsepiu@faw.uni-ulm.de>:
> 2) rtems-rc-19990131-1.diff > > Rework of compilers/*.cfg files (esp. gcc-target-default.cfg) to adapt > the flags/makefile variables to automake and make standards (cf. > make.info - implicit rules/variables). > > This patch is rather risky and may probably break things, but is an > essential step towards automake. > > FWIW: It also reverts the i386-ASMFLAGS/ASFLAGS-patch, which was wrong, > as I had to experience ;-.
Diffstat (limited to 'make')
-rw-r--r--make/compilers/gcc-no_bsp.cfg3
-rw-r--r--make/compilers/gcc-portsw.cfg4
-rw-r--r--make/compilers/gcc-target-default.cfg72
-rw-r--r--make/custom/ods68302.cfg9
4 files changed, 32 insertions, 56 deletions
diff --git a/make/compilers/gcc-no_bsp.cfg b/make/compilers/gcc-no_bsp.cfg
index 6260eafe65..af2a88f580 100644
--- a/make/compilers/gcc-no_bsp.cfg
+++ b/make/compilers/gcc-no_bsp.cfg
@@ -90,7 +90,7 @@ CFLAGS_OPTIMIZE=$(CFLAGS_OPTIMIZE_V)
# dynamic libraries
CFLAGS_DYNAMIC_V=-fpic
-ASFLAGS_DYNAMIC_V=
+# ASFLAGS_DYNAMIC_V=
CFLAGS=$(CFLAGS_DEFAULT) $(CFLAGS_OPTIMIZE) $(CFLAGS_DEBUG) $(CFLAGS_PROFILE) \
-I $(PROJECT_INCLUDE)
@@ -149,7 +149,6 @@ AS=as
ASPP=ERROR_NO_ASPP
ASFLAGS=
-ASM4FLAGS := -I $(PROJECT_INCLUDE)
# NOTE: should never use full path .. but there is no guarantee ld, etc
diff --git a/make/compilers/gcc-portsw.cfg b/make/compilers/gcc-portsw.cfg
index 6b6f3c459f..2d67ebb099 100644
--- a/make/compilers/gcc-portsw.cfg
+++ b/make/compilers/gcc-portsw.cfg
@@ -71,7 +71,7 @@ CFLAGS_OPTIMIZE=$(CFLAGS_OPTIMIZE_V)
# dynamic libraries
CFLAGS_DYNAMIC_V=-fpic
-ASFLAGS_DYNAMIC_V=
+#ASFLAGS_DYNAMIC_V=
CFLAGS=$(CFLAGS_DEFAULT) $(CFLAGS_OPTIMIZE) $(CFLAGS_DEBUG) $(CFLAGS_PROFILE)
@@ -129,8 +129,6 @@ AS=/opt/29k/bin/as29
ASPP=ERROR_NO_ASPP
ASFLAGS=-l -fcgimosx
-ASM4FLAGS := -I $(PROJECT_INCLUDE)
-
# NOTE: should never use full path .. but there is no guarantee ld, etc
# will be in the same directory as gcc.. so hope they are in the path
diff --git a/make/compilers/gcc-target-default.cfg b/make/compilers/gcc-target-default.cfg
index a5db0ec730..cb82b41a46 100644
--- a/make/compilers/gcc-target-default.cfg
+++ b/make/compilers/gcc-target-default.cfg
@@ -4,10 +4,6 @@
# $Id$
#
-CPPFLAGS=$(CFLAGS) $(XCPPFLAGS)
-
-CPLUS_CPPFLAGS=$(CFLAGS) $(XCPPFLAGS)
-
##
# CFLAGS_OPTIMIZE_V, CFLAGS_DEBUG_V, CFLAGS_PROFILE_V are the values we
# would want the corresponding macros to be set to.
@@ -17,6 +13,14 @@ CPLUS_CPPFLAGS=$(CFLAGS) $(XCPPFLAGS)
#
# default flags
+# XCPPFLAGS, XCFLAGS, XCXXFLAGS, XASFLAGS
+# are used to add flags from the shell
+# cf. make.info ("Implicit rules/variables" for details)
+
+CPPFLAGS = $(CPU_DEFINES) $(DEFINES) $(XCPPFLAGS)
+CFLAGS = $(CPU_CFLAGS) -g -Wall -ansi -fasm $(XCFLAGS)
+CXXFLAGS = $(CPU_CFLAGS) -g -Wall -ansi -fasm $(XCXXFLAGS)
+ASFLAGS = $(CPU_ASFLAGS) $(XASFLAGS)
# We only include the header files for networking if it is enabled.
INCLUDE_NETWORKING_yes_V = -I$(PROJECT_INCLUDE)/networking
@@ -30,27 +34,19 @@ RTEMS_LIBC_INCLUDES := -I$(RTEMS_LIBC_DIR)/include
endif
# Used for posix bsps
-CFLAGS_DEFAULT = $(CPU_DEFINES) $(CPU_CFLAGS) -Wall -ansi -fasm -g \
- -I$(PROJECT_INCLUDE) \
- $(INCLUDE_NETWORKING) \
- $(RTEMS_LIBC_INCLUDES) $(DEFINES)
-
-ASMFLAGS=$(CPU_DEFINES) $(CPU_CFLAGS) -g \
- -I$(PROJECT_INCLUDE) \
- $(RTEMS_LIBC_INCLUDES) $(DEFINES)
+CPPFLAGS += \
+ -I$(PROJECT_INCLUDE) $(INCLUDE_NETWORKING) \
+ $(RTEMS_LIBC_INCLUDES)
else
# Used for embedded bsps
# Ask gcc where it finds its own include files
GCC_INCLUDE=$(shell $(CC) $(CPU_CFLAGS) -print-file-name=include $(GCCSED))
-CFLAGS_DEFAULT = $(CPU_DEFINES) $(CPU_CFLAGS) -Wall -ansi -fasm -g \
- -nostdinc -I$(PROJECT_INCLUDE) \
- $(INCLUDE_NETWORKING) \
- -I$(RTEMS_LIBC_DIR)/include -I$(GCC_INCLUDE) $(DEFINES)
-
-ASMFLAGS=$(CPU_DEFINES) $(CPU_CFLAGS) -g \
- -nostdinc -I$(PROJECT_INCLUDE) \
- -I$(RTEMS_LIBC_DIR)/include -I$(GCC_INCLUDE) $(DEFINES)
+CPPFLAGS += -nostdinc \
+ -I$(PROJECT_INCLUDE) $(INCLUDE_NETWORKING) \
+ -I$(GCC_INCLUDE) \
+ -I$(RTEMS_LIBC_DIR)/sys-include \
+ -I$(RTEMS_LIBC_DIR)/include
endif
# default location of Standard C Library
@@ -98,7 +94,7 @@ endif
# when debugging, optimize flag: typically empty
# some compilers do allow optimization with their "-g"
-#CFLAGS_DEBUG_OPTIMIZE_V=
+CFLAGS_DEBUG_OPTIMIZE_V=-g
# profile flag; use gprof(1)
CFLAGS_PROFILE_V=-pg
@@ -107,10 +103,10 @@ CFLAGS_PROFILE_V=-pg
CFLAGS_OPTIMIZE=$(CFLAGS_OPTIMIZE_V)
# dynamic libraries
-CFLAGS_DYNAMIC_V=-fpic
+#CFLAGS_DYNAMIC_V=-fpic
#ASFLAGS_DYNAMIC_V=
-CFLAGS=$(CFLAGS_DEFAULT) $(CFLAGS_OPTIMIZE) $(CFLAGS_DEBUG) $(CFLAGS_PROFILE)
+CFLAGS += $(CFLAGS_OPTIMIZE) $(CFLAGS_DEBUG) $(CFLAGS_PROFILE)
# List of library paths without -L
LD_PATHS= $(PROJECT_RELEASE)/lib
@@ -156,10 +152,8 @@ CLOBBER_CC =
CPP=$(CC) -E -ansi -w -Wp,-$$
# flags set by cc when running cpp
-CPP_CC_FLAGS=-D__STDC__
-
-ASFLAGS= $(CPU_ASFLAGS)
-ASM4FLAGS := -I $(PROJECT_INCLUDE)
+# NOTE: CPP_CC_FLAGS does not seem to be used anywhere
+# CPP_CC_FLAGS=-D__STDC__
# egrep regexp to ignore symbol table entries in ar archives.
# Only used to make sure we skip them when coalescing libraries.
@@ -173,14 +167,15 @@ ARFLAGS=ruv
# NOTE: Obsolete, use $(RANLIB) instead, MKLIB may disappear soon
MKLIB=$(RANLIB)
+
#
# How to compile stuff into ${ARCH} subdirectory
#
# NOTE: we override COMPILE.c
#
-COMPILE.c=$(CC) $(CFLAGS) $(XCFLAGS) -c
-COMPILE.cc=$(CXX) $(CFLAGS) $(CXXFLAGS) $(XCFLAGS) -c
+COMPILE.c=$(CC) $(CPPFLAGS) $(CFLAGS) -c
+COMPILE.cc=$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c
${ARCH}/%.o: %.c
${COMPILE.c} -o $@ $<
@@ -191,26 +186,9 @@ ${ARCH}/%.o: %.cc
# strip out C++ style comments.
${ARCH}/%.o: %.S
sed -e 's/\/\/.*$$//' < $< | \
- $(CPP) $(ASMFLAGS) -I. -I$(srcdir) -DASM - >$(ARCH)/$*.i
+ $(CPP) $(CPPFLAGS) -I. -I$(srcdir) -DASM - >$(ARCH)/$*.i
$(AS) $(ASFLAGS) -o $@ $(ARCH)/$*.i
-# Specify our own default rule for this to prevent having CFLAGS and
-# CPPFLAGS being passed to linker
-#
-#
-# NOTE (Ralf): Having this rule is a bug, IMO.
-# I have only kept it for the moment because some (broken) Makefiles
-# might need it.
-#
-# ${ARCH}/%: ${ARCH}/%.o
-# ${CC} ${LDFLAGS} -o $@ $@.o ${LD_LIBS}
-#
-# Anyway, the rule above is wrong. The one below should be correct
-# (But this one should also not be necessary. If something breaks now,
-# have a look at the Makefile or custom/*.cfg :-)
-# $(ARCH)/%.exe: $(ARCH)/%.o
-# $(make-exe)
-
# Make foo.rel from foo.o
${ARCH}/%.rel: ${ARCH}/%.o
${LD} $(LDFLAGS_INCOMPLETE) -o $@ $^
diff --git a/make/custom/ods68302.cfg b/make/custom/ods68302.cfg
index bb24d9b97a..abceb1f5e0 100644
--- a/make/custom/ods68302.cfg
+++ b/make/custom/ods68302.cfg
@@ -20,10 +20,11 @@ RTEMS_BSP_FAMILY=ods68302
# This contains the compiler options necessary to select the CPU model
# and (hopefully) optimize for it.
#
-CPU_CFLAGS=-g -m68302 -msoft-float \
- -DVARIANT=$(BSP_VARIANT) -DMC68302_BASE=$(MC68302_BASE) \
- -DRAM_BASE=$(RAM_BASE) -DRAM_SIZE=$(RAM_SIZE) \
- -DROM_BASE=$(ROM_BASE) -DROM_SIZE=$(ROM_SIZE)
+CPU_CFLAGS =-m68302 -msoft-float
+CPU_DEFINES = \
+-DVARIANT=$(BSP_VARIANT) -DMC68302_BASE=$(MC68302_BASE) \
+-DRAM_BASE=$(RAM_BASE) -DRAM_SIZE=$(RAM_SIZE) \
+-DROM_BASE=$(ROM_BASE) -DROM_SIZE=$(ROM_SIZE)
# optimize flag: typically -0, could use -O4 or -fast
# -O4 is ok for RTEMS