Index: make/compilers/gcc-no_bsp.cfg
===================================================================
--- make/compilers/gcc-no_bsp.cfg	(revision 7d0dbf1a6c7e69a82bca33ce6555ef321249f4b6)
+++ make/compilers/gcc-no_bsp.cfg	(revision a110b68252d6fad61fc36f08257bb8659c17a693)
@@ -91,5 +91,5 @@
 # dynamic libraries
 CFLAGS_DYNAMIC_V=-fpic
-ASFLAGS_DYNAMIC_V=
+# ASFLAGS_DYNAMIC_V=
 
 CFLAGS=$(CFLAGS_DEFAULT) $(CFLAGS_OPTIMIZE) $(CFLAGS_DEBUG) $(CFLAGS_PROFILE) \
@@ -150,5 +150,4 @@
 
 ASFLAGS=
-ASM4FLAGS := -I $(PROJECT_INCLUDE)
 
 
Index: make/compilers/gcc-portsw.cfg
===================================================================
--- make/compilers/gcc-portsw.cfg	(revision 7d0dbf1a6c7e69a82bca33ce6555ef321249f4b6)
+++ make/compilers/gcc-portsw.cfg	(revision a110b68252d6fad61fc36f08257bb8659c17a693)
@@ -72,5 +72,5 @@
 # dynamic libraries
 CFLAGS_DYNAMIC_V=-fpic
-ASFLAGS_DYNAMIC_V=
+#ASFLAGS_DYNAMIC_V=
 
 CFLAGS=$(CFLAGS_DEFAULT) $(CFLAGS_OPTIMIZE) $(CFLAGS_DEBUG) $(CFLAGS_PROFILE)
@@ -130,6 +130,4 @@
 
 ASFLAGS=-l -fcgimosx
-ASM4FLAGS := -I $(PROJECT_INCLUDE)
-
 
 # NOTE: should never use full path .. but there is no guarantee ld, etc
Index: make/compilers/gcc-target-default.cfg
===================================================================
--- make/compilers/gcc-target-default.cfg	(revision 7d0dbf1a6c7e69a82bca33ce6555ef321249f4b6)
+++ make/compilers/gcc-target-default.cfg	(revision a110b68252d6fad61fc36f08257bb8659c17a693)
@@ -4,8 +4,4 @@
 #  $Id$
 # 
-
-CPPFLAGS=$(CFLAGS) $(XCPPFLAGS)
-
-CPLUS_CPPFLAGS=$(CFLAGS) $(XCPPFLAGS)
 
 ##
@@ -18,4 +14,12 @@
 
 # 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.
@@ -31,12 +35,7 @@
 
 # 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
@@ -44,12 +43,9 @@
 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
 
@@ -99,5 +95,5 @@
 # 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)
@@ -108,8 +104,8 @@
 
 # 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
@@ -157,8 +153,6 @@
 
 # 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.
@@ -174,4 +168,5 @@
 MKLIB=$(RANLIB)
 
+
 #
 # How to compile stuff into ${ARCH} subdirectory
@@ -180,6 +175,6 @@
 #
 
-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
@@ -192,23 +187,6 @@
 ${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
