3 # This script will set up a Makefile fragment with
4 # platform specifics. This fragement can be used by
5 # the automatically generated Makefile (via the script
8 # Copied from 'makefile' in the "install" tree
10 ECOS_BUILD_DIR=${1-`pwd`}
11 ECOS_INSTALL_DIR=`echo ${ECOS_BUILD_DIR}/install`
12 if [ ! -d ${ECOS_BUILD_DIR}/install ]; then
13 if [ ! -d ${ECOS_BUILD_DIR}/*_build ]; then
14 echo "Not an eCos install tree"
15 echo "usage: <eCos_repository>/build_Make.params [<eCos_install_dir>]"
16 echo "... where <eCos_install_dir> is the directory which contains"
17 echo " the *.ecc configuration file used to build the kernel"
20 ECOS_INSTALL_DIR=`echo ${ECOS_BUILD_DIR}/*_install`
21 ECOS_BUILD_DIR=`echo ${ECOS_BUILD_DIR}/*_build`
25 cat <<EOF >Make.params
27 # Copied from 'makefile' in the "install" tree
31 grep export ${ECOS_BUILD_DIR}/makefile >>Make.params
33 cat <<EOF >>Make.params
36 # Target specific flags, etc.
41 cat ${ECOS_INSTALL_DIR}/include/pkgconf/ecos.mak >>Make.params
44 # Add CFLAGS manipulation - this should match <ecos>/packages/pkgconf/rules.mak
47 cat <<EOF >>Make.params
50 # Modify CFLAGS to match newer compilers
52 ACTUAL_CFLAGS = \$(ECOS_GLOBAL_CFLAGS)
53 ACTUAL_CXXFLAGS = \$(ECOS_GLOBAL_CFLAGS)
54 ACTUAL_LDFLAGS = \$(ECOS_GLOBAL_LDFLAGS)
56 # GCC since 2.95 does -finit-priority by default so remove it from old HALs
57 ACTUAL_CFLAGS := \$(subst -finit-priority,,\$(ACTUAL_CFLAGS))
59 # -fvtable-gc is known to be broken in all recent GCC.
60 ACTUAL_CFLAGS := \$(subst -fvtable-gc,,\$(ACTUAL_CFLAGS))
62 # Expand inline functions
63 ACTUAL_CFLAGS := -finline-limit=7000 \$(ACTUAL_CFLAGS)
65 # Separate C++ flags out from C flags.
66 ACTUAL_CFLAGS := \$(subst -fno-rtti,,\$(ACTUAL_CFLAGS))
67 ACTUAL_CFLAGS := \$(subst -frtti,,\$(ACTUAL_CFLAGS))
68 ACTUAL_CFLAGS := \$(subst -Woverloaded-virtual,,\$(ACTUAL_CFLAGS))
69 ACTUAL_CFLAGS := \$(subst -fvtable-gc,,\$(ACTUAL_CFLAGS))
71 ACTUAL_CXXFLAGS := \$(subst -Wstrict-prototypes,,\$(ACTUAL_CXXFLAGS))