Changeset a110b68 in rtems


Ignore:
Timestamp:
Feb 18, 1999, 5:55:49 PM (21 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
4cc89bd
Parents:
011677f
Message:

Part of automake VI patch from Ralf Corsepius <corsepiu@…>:

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 ;-.

Files:
6 edited

Legend:

Unmodified
Added
Removed
  • c/src/exec/score/cpu/unix/Makefile.in

    r011677f ra110b68  
    5151CLOBBER_ADDITIONS +=
    5252
    53 $(ARCH)/unixsize.h: $(ARCH) cpu.h $(PROJECT_RELEASE)/bin/gensize
     53$(ARCH)/unixsize.h: $(ARCH) cpu.h $(GENSIZE)
    5454        $(RM) $@
    55         $(PROJECT_RELEASE)/bin/gensize > $@
     55        $(GENSIZE) > $@
    5656        $(CHMOD) -w $@
    5757
  • c/src/make/compilers/gcc-target-default.cfg

    r011677f ra110b68  
    44#  $Id$
    55#
    6 
    7 CPPFLAGS=$(CFLAGS) $(XCPPFLAGS)
    8 
    9 CPLUS_CPPFLAGS=$(CFLAGS) $(XCPPFLAGS)
    106
    117##
     
    1814
    1915# default flags
     16# XCPPFLAGS, XCFLAGS, XCXXFLAGS, XASFLAGS
     17# are used to add flags from the shell
     18# cf. make.info ("Implicit rules/variables" for details)
     19
     20CPPFLAGS = $(CPU_DEFINES) $(DEFINES) $(XCPPFLAGS)
     21CFLAGS   = $(CPU_CFLAGS) -g -Wall -ansi -fasm $(XCFLAGS)
     22CXXFLAGS = $(CPU_CFLAGS) -g -Wall -ansi -fasm $(XCXXFLAGS)
     23ASFLAGS  = $(CPU_ASFLAGS) $(XASFLAGS)
    2024
    2125# We only include the header files for networking if it is enabled.
     
    3135
    3236# Used for posix bsps
    33 CFLAGS_DEFAULT = $(CPU_DEFINES) $(CPU_CFLAGS) -Wall -ansi -fasm -g \
    34   -I$(PROJECT_INCLUDE) \
    35   $(INCLUDE_NETWORKING) \
    36   $(RTEMS_LIBC_INCLUDES) $(DEFINES)
    37 
    38 ASMFLAGS=$(CPU_DEFINES) $(CPU_CFLAGS) -g \
    39   -I$(PROJECT_INCLUDE) \
    40   $(RTEMS_LIBC_INCLUDES) $(DEFINES)
     37CPPFLAGS += \
     38  -I$(PROJECT_INCLUDE) $(INCLUDE_NETWORKING) \
     39  $(RTEMS_LIBC_INCLUDES)
    4140else
    4241# Used for embedded bsps
     
    4443GCC_INCLUDE=$(shell $(CC) $(CPU_CFLAGS) -print-file-name=include $(GCCSED))
    4544
    46 CFLAGS_DEFAULT = $(CPU_DEFINES) $(CPU_CFLAGS) -Wall -ansi -fasm -g \
    47   -nostdinc -I$(PROJECT_INCLUDE) \
    48   $(INCLUDE_NETWORKING) \
    49   -I$(RTEMS_LIBC_DIR)/include -I$(GCC_INCLUDE) $(DEFINES)
    50 
    51 ASMFLAGS=$(CPU_DEFINES) $(CPU_CFLAGS) -g \
    52   -nostdinc -I$(PROJECT_INCLUDE) \
    53   -I$(RTEMS_LIBC_DIR)/include -I$(GCC_INCLUDE) $(DEFINES)
     45CPPFLAGS += -nostdinc \
     46  -I$(PROJECT_INCLUDE) $(INCLUDE_NETWORKING) \
     47  -I$(GCC_INCLUDE) \
     48  -I$(RTEMS_LIBC_DIR)/sys-include \
     49  -I$(RTEMS_LIBC_DIR)/include
    5450endif
    5551
     
    9995# when debugging, optimize flag: typically empty
    10096# some compilers do allow optimization with their "-g"
    101 #CFLAGS_DEBUG_OPTIMIZE_V=
     97CFLAGS_DEBUG_OPTIMIZE_V=-g
    10298
    10399# profile flag; use gprof(1)
     
    108104
    109105# dynamic libraries
    110 CFLAGS_DYNAMIC_V=-fpic
     106#CFLAGS_DYNAMIC_V=-fpic
    111107#ASFLAGS_DYNAMIC_V=
    112108
    113 CFLAGS=$(CFLAGS_DEFAULT) $(CFLAGS_OPTIMIZE) $(CFLAGS_DEBUG) $(CFLAGS_PROFILE)
     109CFLAGS += $(CFLAGS_OPTIMIZE) $(CFLAGS_DEBUG) $(CFLAGS_PROFILE)
    114110
    115111# List of library paths without -L
     
    157153
    158154# flags set by cc when running cpp
    159 CPP_CC_FLAGS=-D__STDC__
    160 
    161 ASFLAGS= $(CPU_ASFLAGS)
    162 ASM4FLAGS := -I $(PROJECT_INCLUDE)
     155# NOTE: CPP_CC_FLAGS does not seem to be used anywhere
     156# CPP_CC_FLAGS=-D__STDC__
    163157
    164158# egrep regexp to ignore symbol table entries in ar archives.
     
    174168MKLIB=$(RANLIB)
    175169
     170
    176171#
    177172# How to compile stuff into ${ARCH} subdirectory
     
    180175#
    181176
    182 COMPILE.c=$(CC) $(CFLAGS) $(XCFLAGS) -c
    183 COMPILE.cc=$(CXX) $(CFLAGS) $(CXXFLAGS) $(XCFLAGS) -c
     177COMPILE.c=$(CC) $(CPPFLAGS) $(CFLAGS) -c
     178COMPILE.cc=$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c
    184179
    185180${ARCH}/%.o: %.c
     
    192187${ARCH}/%.o: %.S
    193188        sed -e 's/\/\/.*$$//' < $< | \
    194             $(CPP) $(ASMFLAGS) -I. -I$(srcdir) -DASM - >$(ARCH)/$*.i
     189            $(CPP) $(CPPFLAGS) -I. -I$(srcdir) -DASM - >$(ARCH)/$*.i
    195190        $(AS) $(ASFLAGS) -o $@ $(ARCH)/$*.i
    196 
    197 # Specify our own default rule for this to prevent having CFLAGS and
    198 #  CPPFLAGS being passed to linker
    199 #
    200 #
    201 # NOTE (Ralf): Having this rule is a bug, IMO.
    202 # I have only kept it for the moment because some (broken) Makefiles
    203 # might need it.
    204 #
    205 # ${ARCH}/%: ${ARCH}/%.o
    206 #       ${CC} ${LDFLAGS} -o $@ $@.o ${LD_LIBS}
    207 #
    208 # Anyway, the rule above is wrong. The one below should be correct
    209 # (But this one should also not be necessary. If something breaks now,
    210 # have a look at the Makefile or custom/*.cfg :-)
    211 # $(ARCH)/%.exe: $(ARCH)/%.o
    212 #       $(make-exe)
    213191
    214192# Make foo.rel from foo.o
  • make/compilers/gcc-no_bsp.cfg

    r011677f ra110b68  
    9191# dynamic libraries
    9292CFLAGS_DYNAMIC_V=-fpic
    93 ASFLAGS_DYNAMIC_V=
     93# ASFLAGS_DYNAMIC_V=
    9494
    9595CFLAGS=$(CFLAGS_DEFAULT) $(CFLAGS_OPTIMIZE) $(CFLAGS_DEBUG) $(CFLAGS_PROFILE) \
     
    150150
    151151ASFLAGS=
    152 ASM4FLAGS := -I $(PROJECT_INCLUDE)
    153152
    154153
  • make/compilers/gcc-portsw.cfg

    r011677f ra110b68  
    7272# dynamic libraries
    7373CFLAGS_DYNAMIC_V=-fpic
    74 ASFLAGS_DYNAMIC_V=
     74#ASFLAGS_DYNAMIC_V=
    7575
    7676CFLAGS=$(CFLAGS_DEFAULT) $(CFLAGS_OPTIMIZE) $(CFLAGS_DEBUG) $(CFLAGS_PROFILE)
     
    130130
    131131ASFLAGS=-l -fcgimosx
    132 ASM4FLAGS := -I $(PROJECT_INCLUDE)
    133 
    134132
    135133# NOTE: should never use full path .. but there is no guarantee ld, etc
  • make/compilers/gcc-target-default.cfg

    r011677f ra110b68  
    44#  $Id$
    55#
    6 
    7 CPPFLAGS=$(CFLAGS) $(XCPPFLAGS)
    8 
    9 CPLUS_CPPFLAGS=$(CFLAGS) $(XCPPFLAGS)
    106
    117##
     
    1814
    1915# default flags
     16# XCPPFLAGS, XCFLAGS, XCXXFLAGS, XASFLAGS
     17# are used to add flags from the shell
     18# cf. make.info ("Implicit rules/variables" for details)
     19
     20CPPFLAGS = $(CPU_DEFINES) $(DEFINES) $(XCPPFLAGS)
     21CFLAGS   = $(CPU_CFLAGS) -g -Wall -ansi -fasm $(XCFLAGS)
     22CXXFLAGS = $(CPU_CFLAGS) -g -Wall -ansi -fasm $(XCXXFLAGS)
     23ASFLAGS  = $(CPU_ASFLAGS) $(XASFLAGS)
    2024
    2125# We only include the header files for networking if it is enabled.
     
    3135
    3236# Used for posix bsps
    33 CFLAGS_DEFAULT = $(CPU_DEFINES) $(CPU_CFLAGS) -Wall -ansi -fasm -g \
    34   -I$(PROJECT_INCLUDE) \
    35   $(INCLUDE_NETWORKING) \
    36   $(RTEMS_LIBC_INCLUDES) $(DEFINES)
    37 
    38 ASMFLAGS=$(CPU_DEFINES) $(CPU_CFLAGS) -g \
    39   -I$(PROJECT_INCLUDE) \
    40   $(RTEMS_LIBC_INCLUDES) $(DEFINES)
     37CPPFLAGS += \
     38  -I$(PROJECT_INCLUDE) $(INCLUDE_NETWORKING) \
     39  $(RTEMS_LIBC_INCLUDES)
    4140else
    4241# Used for embedded bsps
     
    4443GCC_INCLUDE=$(shell $(CC) $(CPU_CFLAGS) -print-file-name=include $(GCCSED))
    4544
    46 CFLAGS_DEFAULT = $(CPU_DEFINES) $(CPU_CFLAGS) -Wall -ansi -fasm -g \
    47   -nostdinc -I$(PROJECT_INCLUDE) \
    48   $(INCLUDE_NETWORKING) \
    49   -I$(RTEMS_LIBC_DIR)/include -I$(GCC_INCLUDE) $(DEFINES)
    50 
    51 ASMFLAGS=$(CPU_DEFINES) $(CPU_CFLAGS) -g \
    52   -nostdinc -I$(PROJECT_INCLUDE) \
    53   -I$(RTEMS_LIBC_DIR)/include -I$(GCC_INCLUDE) $(DEFINES)
     45CPPFLAGS += -nostdinc \
     46  -I$(PROJECT_INCLUDE) $(INCLUDE_NETWORKING) \
     47  -I$(GCC_INCLUDE) \
     48  -I$(RTEMS_LIBC_DIR)/sys-include \
     49  -I$(RTEMS_LIBC_DIR)/include
    5450endif
    5551
     
    9995# when debugging, optimize flag: typically empty
    10096# some compilers do allow optimization with their "-g"
    101 #CFLAGS_DEBUG_OPTIMIZE_V=
     97CFLAGS_DEBUG_OPTIMIZE_V=-g
    10298
    10399# profile flag; use gprof(1)
     
    108104
    109105# dynamic libraries
    110 CFLAGS_DYNAMIC_V=-fpic
     106#CFLAGS_DYNAMIC_V=-fpic
    111107#ASFLAGS_DYNAMIC_V=
    112108
    113 CFLAGS=$(CFLAGS_DEFAULT) $(CFLAGS_OPTIMIZE) $(CFLAGS_DEBUG) $(CFLAGS_PROFILE)
     109CFLAGS += $(CFLAGS_OPTIMIZE) $(CFLAGS_DEBUG) $(CFLAGS_PROFILE)
    114110
    115111# List of library paths without -L
     
    157153
    158154# flags set by cc when running cpp
    159 CPP_CC_FLAGS=-D__STDC__
    160 
    161 ASFLAGS= $(CPU_ASFLAGS)
    162 ASM4FLAGS := -I $(PROJECT_INCLUDE)
     155# NOTE: CPP_CC_FLAGS does not seem to be used anywhere
     156# CPP_CC_FLAGS=-D__STDC__
    163157
    164158# egrep regexp to ignore symbol table entries in ar archives.
     
    174168MKLIB=$(RANLIB)
    175169
     170
    176171#
    177172# How to compile stuff into ${ARCH} subdirectory
     
    180175#
    181176
    182 COMPILE.c=$(CC) $(CFLAGS) $(XCFLAGS) -c
    183 COMPILE.cc=$(CXX) $(CFLAGS) $(CXXFLAGS) $(XCFLAGS) -c
     177COMPILE.c=$(CC) $(CPPFLAGS) $(CFLAGS) -c
     178COMPILE.cc=$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c
    184179
    185180${ARCH}/%.o: %.c
     
    192187${ARCH}/%.o: %.S
    193188        sed -e 's/\/\/.*$$//' < $< | \
    194             $(CPP) $(ASMFLAGS) -I. -I$(srcdir) -DASM - >$(ARCH)/$*.i
     189            $(CPP) $(CPPFLAGS) -I. -I$(srcdir) -DASM - >$(ARCH)/$*.i
    195190        $(AS) $(ASFLAGS) -o $@ $(ARCH)/$*.i
    196 
    197 # Specify our own default rule for this to prevent having CFLAGS and
    198 #  CPPFLAGS being passed to linker
    199 #
    200 #
    201 # NOTE (Ralf): Having this rule is a bug, IMO.
    202 # I have only kept it for the moment because some (broken) Makefiles
    203 # might need it.
    204 #
    205 # ${ARCH}/%: ${ARCH}/%.o
    206 #       ${CC} ${LDFLAGS} -o $@ $@.o ${LD_LIBS}
    207 #
    208 # Anyway, the rule above is wrong. The one below should be correct
    209 # (But this one should also not be necessary. If something breaks now,
    210 # have a look at the Makefile or custom/*.cfg :-)
    211 # $(ARCH)/%.exe: $(ARCH)/%.o
    212 #       $(make-exe)
    213191
    214192# Make foo.rel from foo.o
  • make/custom/ods68302.cfg

    r011677f ra110b68  
    2121#  and (hopefully) optimize for it.
    2222#
    23 CPU_CFLAGS=-g -m68302 -msoft-float \
    24                 -DVARIANT=$(BSP_VARIANT) -DMC68302_BASE=$(MC68302_BASE) \
    25                 -DRAM_BASE=$(RAM_BASE) -DRAM_SIZE=$(RAM_SIZE) \
    26                 -DROM_BASE=$(ROM_BASE) -DROM_SIZE=$(ROM_SIZE)
     23CPU_CFLAGS =-m68302 -msoft-float
     24CPU_DEFINES = \
     25-DVARIANT=$(BSP_VARIANT) -DMC68302_BASE=$(MC68302_BASE) \
     26-DRAM_BASE=$(RAM_BASE) -DRAM_SIZE=$(RAM_SIZE) \
     27-DROM_BASE=$(ROM_BASE) -DROM_SIZE=$(ROM_SIZE)
    2728
    2829# optimize flag: typically -0, could use -O4 or -fast
Note: See TracChangeset for help on using the changeset viewer.