Take contents of amcompile.am.

This commit is contained in:
Ralf Corsepius
2005-11-07 09:11:31 +00:00
parent 650b975051
commit d2ff8254ed

View File

@@ -2,82 +2,38 @@
## $Id$ ## $Id$
## ##
## ------------------------------------------------------------------------- ## RTEMS_USE_GCC .. if we are using GCC
## NOTE: This file is rather immature and has to be considered to be
## almost experimental.
##
## Expect frequent changes -- It deserves to be cleaned up :(
## -------------------------------------------------------------------------
if RTEMS_USE_GCC if RTEMS_USE_GCC
## All the stuff below is specific to gcc ## All the stuff below is specific to gcc
GCCSPECS = $(GCC_SPECS) $(RTEMS_BSP_SPECS) GCCSPECS = $(GCC_SPECS) $(RTEMS_BSP_SPECS)
endif # RTEMS_USE_GCC endif # RTEMS_USE_GCC
depend:
if RTEMS_USE_GCC
RTEMS_RELLDFLAGS = -qnolinkcmds -nostdlib -Wl,-r
endif
LINK_LIBS = $(LD_LIBS) LINK_LIBS = $(LD_LIBS)
#COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
# $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
#CCLD = $(CC)
#LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
# $(AM_LDFLAGS) $(LDFLAGS) -o $@
# #
# How to compile stuff into ${ARCH} subdirectory #CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
# $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
#CXXLD = $(CXX)
#CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \
# $(AM_LDFLAGS) $(LDFLAGS) -o $@
# #
#CCASCOMPILE = $(CCAS) $(AM_CCASFLAGS) $(CCASFLAGS)
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
CXXLD = $(CXX)
CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
CCASCOMPILE = $(CCAS) $(AM_CCASFLAGS) $(CCASFLAGS)
${ARCH}/%.o: %.c $(ARCH)/$(dirstamp)
${COMPILE} -o $@ -c $<
${ARCH}/%.o: %.cc $(ARCH)/$(dirstamp)
${CXXCOMPILE} -o $@ -c $<
${ARCH}/%.o: %.S $(ARCH)/$(dirstamp)
${CCASCOMPILE} -DASM -o $@ -c $<
${ARCH}/$(dirstamp): ${ARCH}/$(dirstamp):
@$(mkdir_p) $(ARCH) @$(mkdir_p) $(ARCH)
@: > $(ARCH)/$(dirstamp) @: > $(ARCH)/$(dirstamp)
# Dependency files for use by gmake
# NOTE: we don't put them into $(ARCH)
# so that 'make clean' doesn't blow it away
DEPEND=Depends-${ARCH}
# We deliberately don't have anything depend on the
# $(DEPEND) file; otherwise it will get rebuilt even
# on 'make clean'
#
if RTEMS_USE_GCC
## HACK: Specific to gcc
## FIXME: The approach below is known to be conceptionally broken.
depend-gcc: $(C_FILES) $(CC_FILES) $(S_FILES)
## Use gcc -M to generate dependencies
## Replace foo.o with $(ARCH)/foo.o
## Replace $(ARCH) value with string $(ARCH)
## so that it will for debug cases
$(COMPILE) -M $^ | \
sed -e 's?^\(.*\)\.o[ ]*:?$$(ARCH)/\1.o:?' \
-e 's?$(ARCH)/?$$(ARCH)/?' >$(DEPEND).tmp
mv $(DEPEND).tmp $(DEPEND)
# pull in dependencies if they exist
ifeq (${DEPEND},$(wildcard ${DEPEND}))
include ${DEPEND}
@ENDIF@
endif
depend: depend-am
# spell out all the LINK_FILE's, rather than using -lbsp, so # spell out all the LINK_FILE's, rather than using -lbsp, so
# that $(LINK_FILES) can be a dependency # that $(LINK_FILES) can be a dependency
@@ -91,7 +47,6 @@ LINK_FILES =\
$(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel) $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
## ------------------------------------------------------------------------- ## -------------------------------------------------------------------------
## Setup the variant build subdirectory
ARCH = o-optimize ARCH = o-optimize
## ------------------------------------------------------------------------- ## -------------------------------------------------------------------------
@@ -113,5 +68,4 @@ AM_CXXFLAGS = $(RTEMS_CXXFLAGS)
AM_CCASFLAGS = $(CPU_CFLAGS) $(RTEMS_CPPFLAGS) $(RTEMS_CCASFLAGS) AM_CCASFLAGS = $(CPU_CFLAGS) $(RTEMS_CPPFLAGS) $(RTEMS_CCASFLAGS)
clean-local: clean-local:
$(RM) -r o-optimize $(RM) -r ${ARCH}
$(RM) Depends-o-optimize.tmp