Trick should not modify TRICK_CFLAGS and TRICK_CXXFLAGS

Created TRICK_SYSTEM_CFLAGS, TRICK_SYSTEM_CXXFLAGS, and TRICK_SYSTEM_SFLAGS
that Trick uses to add the Trick system includes, defines and other
compilation flags.  TRICK_CFLAGS and TRICK_CXXFLAGS are now in
full control of the user.

refs 
This commit is contained in:
Alex Lin 2015-07-22 14:20:36 -05:00
parent d744eba557
commit 90c85c73fc
8 changed files with 49 additions and 43 deletions

View File

@ -58,7 +58,7 @@ print OUTFILE "Output for $0 version $version-$thread at " . localtime() . "\n\n
# if no python is specified, turn off the python InputProcessor sim_object in S_define. # if no python is specified, turn off the python InputProcessor sim_object in S_define.
if ( $sim{args}{p} == 0 ) { if ( $sim{args}{p} == 0 ) {
$ENV{TRICK_SFLAGS} .= " -DTRICK_NO_INPUTPROCESSOR" ; $ENV{TRICK_SYSTEM_SFLAGS} .= " -DTRICK_NO_INPUTPROCESSOR" ;
} }
#-------------------------------------------------------------- #--------------------------------------------------------------

View File

@ -302,27 +302,27 @@ foreach my $ext ( sort keys %object_files_by_type ) {
# Write out the compile rules for each type of file. # Write out the compile rules for each type of file.
print MAKEFILE "\${MODEL_c_OBJ} : \$(CURDIR)/build\%.o : \%.c\n" ; print MAKEFILE "\${MODEL_c_OBJ} : \$(CURDIR)/build\%.o : \%.c\n" ;
print MAKEFILE "\t\$(PRINT_COMPILE)\n\n" ; print MAKEFILE "\t\$(PRINT_COMPILE)\n\n" ;
print MAKEFILE "\t\$(ECHO_CMD)\$(TRICK_CC) \$(TRICK_CFLAGS) -I\${<D} -I\${<D}/../include -MMD -MP -c \$< -o \$\@\n\n" ; print MAKEFILE "\t\$(ECHO_CMD)\$(TRICK_CC) \$(TRICK_CFLAGS) \$(TRICK_SYSTEM_CFLAGS) -I\${<D} -I\${<D}/../include -MMD -MP -c \$< -o \$\@\n\n" ;
print MAKEFILE "\${MODEL_C_OBJ} : \$(CURDIR)/build\%.o : \%.C\n" ; print MAKEFILE "\${MODEL_C_OBJ} : \$(CURDIR)/build\%.o : \%.C\n" ;
print MAKEFILE "\t\$(PRINT_COMPILE)\n\n" ; print MAKEFILE "\t\$(PRINT_COMPILE)\n\n" ;
print MAKEFILE "\t\$(ECHO_CMD)\$(TRICK_CPPC) \$(TRICK_CXXFLAGS) -I\${<D} -I\${<D}/../include -MMD -MP -c \$< -o \$\@\n\n" ; print MAKEFILE "\t\$(ECHO_CMD)\$(TRICK_CPPC) \$(TRICK_CXXFLAGS) \$(TRICK_SYSTEM_CXXFLAGS) -I\${<D} -I\${<D}/../include -MMD -MP -c \$< -o \$\@\n\n" ;
print MAKEFILE "\${MODEL_cc_OBJ} : \$(CURDIR)/build\%.o : \%.cc\n" ; print MAKEFILE "\${MODEL_cc_OBJ} : \$(CURDIR)/build\%.o : \%.cc\n" ;
print MAKEFILE "\t\$(PRINT_COMPILE)\n\n" ; print MAKEFILE "\t\$(PRINT_COMPILE)\n\n" ;
print MAKEFILE "\t\$(ECHO_CMD)\$(TRICK_CPPC) \$(TRICK_CXXFLAGS) -I\${<D} -I\${<D}/../include -MMD -MP -c \$< -o \$\@\n\n" ; print MAKEFILE "\t\$(ECHO_CMD)\$(TRICK_CPPC) \$(TRICK_CXXFLAGS) \$(TRICK_SYSTEM_CXXFLAGS) -I\${<D} -I\${<D}/../include -MMD -MP -c \$< -o \$\@\n\n" ;
print MAKEFILE "\${MODEL_cpp_OBJ} : \$(CURDIR)/build\%.o : \%.cpp\n" ; print MAKEFILE "\${MODEL_cpp_OBJ} : \$(CURDIR)/build\%.o : \%.cpp\n" ;
print MAKEFILE "\t\$(PRINT_COMPILE)\n\n" ; print MAKEFILE "\t\$(PRINT_COMPILE)\n\n" ;
print MAKEFILE "\t\$(ECHO_CMD)\$(TRICK_CPPC) \$(TRICK_CXXFLAGS) -I\${<D} -I\${<D}/../include -MMD -MP -c \$< -o \$\@\n\n" ; print MAKEFILE "\t\$(ECHO_CMD)\$(TRICK_CPPC) \$(TRICK_CXXFLAGS) \$(TRICK_SYSTEM_CXXFLAGS) -I\${<D} -I\${<D}/../include -MMD -MP -c \$< -o \$\@\n\n" ;
print MAKEFILE "\${MODEL_cxx_OBJ} : \$(CURDIR)/build\%.o : \%.cxx\n" ; print MAKEFILE "\${MODEL_cxx_OBJ} : \$(CURDIR)/build\%.o : \%.cxx\n" ;
print MAKEFILE "\t\$(PRINT_COMPILE)\n\n" ; print MAKEFILE "\t\$(PRINT_COMPILE)\n\n" ;
print MAKEFILE "\t\$(ECHO_CMD)\$(TRICK_CPPC) \$(TRICK_CXXFLAGS) -I\${<D} -I\${<D}/../include -MMD -MP -c \$< -o \$\@\n\n" ; print MAKEFILE "\t\$(ECHO_CMD)\$(TRICK_CPPC) \$(TRICK_CXXFLAGS) \$(TRICK_SYSTEM_CXXFLAGS) -I\${<D} -I\${<D}/../include -MMD -MP -c \$< -o \$\@\n\n" ;
print MAKEFILE "\${MODEL_CPLUSPLUS_OBJ} : \$(CURDIR)/build\%.o : \%.c++\n" ; print MAKEFILE "\${MODEL_CPLUSPLUS_OBJ} : \$(CURDIR)/build\%.o : \%.c++\n" ;
print MAKEFILE "\t\$(PRINT_COMPILE)\n\n" ; print MAKEFILE "\t\$(PRINT_COMPILE)\n\n" ;
print MAKEFILE "\t\$(ECHO_CMD)\$(TRICK_CPPC) \$(TRICK_CXXFLAGS) -I\${<D} -I\${<D}/../include -MMD -MP -c \$< -o \$\@\n\n" ; print MAKEFILE "\t\$(ECHO_CMD)\$(TRICK_CPPC) \$(TRICK_CXXFLAGS) \$(TRICK_SYSTEM_CXXFLAGS) -I\${<D} -I\${<D}/../include -MMD -MP -c \$< -o \$\@\n\n" ;
print MAKEFILE "\${MODEL_clex_SRC} : \$(CURDIR)/build\%.clex : \%.l\n" ; print MAKEFILE "\${MODEL_clex_SRC} : \$(CURDIR)/build\%.clex : \%.l\n" ;
print MAKEFILE "\t\$(LEX) -o\$\@ \$<\n\n" ; print MAKEFILE "\t\$(LEX) -o\$\@ \$<\n\n" ;
@ -332,7 +332,7 @@ print MAKEFILE "\t\$(YACC) -o\$\@ \$<\n\n" ;
print MAKEFILE "\${MODEL_y_OBJ} : \$(CURDIR)/build\%.o : \%.y.c\n" ; print MAKEFILE "\${MODEL_y_OBJ} : \$(CURDIR)/build\%.o : \%.y.c\n" ;
print MAKEFILE "\t\$(PRINT_COMPILE)\n\n" ; print MAKEFILE "\t\$(PRINT_COMPILE)\n\n" ;
print MAKEFILE "\t\$(ECHO_CMD)cd \$(<D) ; \$(TRICK_CC) \$(TRICK_CXXFLAGS) -MMD -MP -c \${<F} -o \$\@\n\n" ; print MAKEFILE "\t\$(ECHO_CMD)cd \$(<D) ; \$(TRICK_CC) \$(TRICK_CXXFLAGS) \$(TRICK_SYSTEM_CXXFLAGS) -MMD -MP -c \${<F} -o \$\@\n\n" ;
# Include all of the dependency files for each object code file # Include all of the dependency files for each object code file
print MAKEFILE "-include \$(MODEL_c_OBJ:.o=.d)\n" ; print MAKEFILE "-include \$(MODEL_c_OBJ:.o=.d)\n" ;
@ -364,8 +364,8 @@ foreach ( @all_read_only_libs ) {
} }
print MAKEFILE "\n\n print MAKEFILE "\n\n
test: TRICK_CXXFLAGS += -DTRICK_UNIT_TEST test: TRICK_SYSTEM_CXXFLAGS += -DTRICK_UNIT_TEST
test: TRICK_CFLAGS += -DTRICK_UNIT_TEST test: TRICK_SYSTEM_CFLAGS += -DTRICK_UNIT_TEST
all: S_main all: S_main
@ -392,13 +392,13 @@ S_main : \$(S_MAIN) build/S_define.deps S_sie.resource
\$(CURDIR)/build/S_source.o: \$(CURDIR)/build/S_source.cpp \$(CURDIR)/build/S_source.o: \$(CURDIR)/build/S_source.cpp
\t\$(PRINT_COMPILE) \t\$(PRINT_COMPILE)
\t\$(ECHO_CMD)\$(TRICK_CPPC) \$(TRICK_CXXFLAGS) -MMD -MP -c \$\< -o \$\@ \t\$(ECHO_CMD)\$(TRICK_CPPC) \$(TRICK_CXXFLAGS) \$(TRICK_SYSTEM_CXXFLAGS) -MMD -MP -c \$\< -o \$\@
-include build/S_source.d -include build/S_source.d
build/S_define.deps: build/S_define.deps:
\t\$(PRINT_S_DEF_DEPS) \t\$(PRINT_S_DEF_DEPS)
\t\$(ECHO_CMD)\$(TRICK_CPPC) \$(TRICK_SFLAGS) -M -MT Makefile_sim -MF build/S_define.deps -x c++ S_define \t\$(ECHO_CMD)\$(TRICK_CPPC) \$(TRICK_SFLAGS) \$(TRICK_SYSTEM_SFLAGS) -M -MT Makefile_sim -MF build/S_define.deps -x c++ S_define
\$(CURDIR)/build/S_source.cpp S_default.dat: S_define \$(CURDIR)/build/S_source.cpp S_default.dat: S_define
\t\$(PERL) \${TRICK_HOME}/bin/trick-CP -s -d \t\$(PERL) \${TRICK_HOME}/bin/trick-CP -s -d
@ -410,7 +410,7 @@ S_sie.resource: \$(S_MAIN)
\t\$(ECHO_CMD)\$(S_MAIN) sie \t\$(ECHO_CMD)\$(S_MAIN) sie
S_define_exp: S_define_exp:
\t\$(TRICK_CC) -E -C -xc++ \${TRICK_SFLAGS} S_define > \$@\n\n" ; \t\$(TRICK_CC) -E -C -xc++ \${TRICK_SFLAGS} \$(TRICK_SYSTEM_SFLAGS) S_define > \$@\n\n" ;
# write out the override files we have read in # write out the override files we have read in
foreach $k ( sort keys %files_by_dir ) { foreach $k ( sort keys %files_by_dir ) {

View File

@ -206,7 +206,7 @@ SWIG_PY_OBJECTS =" ;
print MAKEFILE "\t\$(PRINT_SWIG)\n" ; print MAKEFILE "\t\$(PRINT_SWIG)\n" ;
print MAKEFILE "\t\$(ECHO_CMD)\$(SWIG) \$(TRICK_INCLUDE) \$(TRICK_DEFINES) \$(TRICK_VERSIONS) \$(SWIG_FLAGS) -c++ -python -includeall -ignoremissing -w201,303,362,389,401,451 -outdir trick -o $swig_dir/py_${swig_file_only}.cpp \$<\n" ; print MAKEFILE "\t\$(ECHO_CMD)\$(SWIG) \$(TRICK_INCLUDE) \$(TRICK_DEFINES) \$(TRICK_VERSIONS) \$(SWIG_FLAGS) -c++ -python -includeall -ignoremissing -w201,303,362,389,401,451 -outdir trick -o $swig_dir/py_${swig_file_only}.cpp \$<\n" ;
print MAKEFILE "\t\$(PRINT_COMPILE_SWIG)\n" ; print MAKEFILE "\t\$(PRINT_COMPILE_SWIG)\n" ;
print MAKEFILE "\t\$(ECHO_CMD)\$(TRICK_CPPC) \$(TRICK_CXXFLAGS) \$(TRICK_IO_CXXFLAGS) \$(SWIG_CFLAGS) -c $swig_dir/py_${swig_file_only}.cpp -o \$@\n\n" ; print MAKEFILE "\t\$(ECHO_CMD)\$(TRICK_CPPC) \$(TRICK_CXXFLAGS) \$(TRICK_SYSTEM_CXXFLAGS) \$(SWIG_CFLAGS) -c $swig_dir/py_${swig_file_only}.cpp -o \$@\n\n" ;
print LINK_PY_OBJS "$link_py_obj\n" ; print LINK_PY_OBJS "$link_py_obj\n" ;
$ii++ ; $ii++ ;
@ -223,7 +223,7 @@ SWIG_PY_OBJECTS =" ;
my $wd = abs_path(cwd()) ; my $wd = abs_path(cwd()) ;
print MAKEFILE " print MAKEFILE "
\$(SWIG_MODULE_OBJECTS) : TRICK_CXXFLAGS += -Wno-unused-parameter -Wno-redundant-decls \$(SWIG_MODULE_OBJECTS) : TRICK_SYSTEM_CXXFLAGS += -Wno-unused-parameter -Wno-redundant-decls
OBJECTS += \$(SWIG_MODULE_OBJECTS) OBJECTS += \$(SWIG_MODULE_OBJECTS)
\$(S_MAIN): \$(SWIG_MODULE_OBJECTS) \$(S_MAIN): \$(SWIG_MODULE_OBJECTS)
@ -239,11 +239,11 @@ OBJECTS += \$(SWIG_MODULE_OBJECTS)
print MAKEFILE "$swig_src_dir/py_top.o : $swig_src_dir/py_top.cpp\n" ; print MAKEFILE "$swig_src_dir/py_top.o : $swig_src_dir/py_top.cpp\n" ;
print MAKEFILE "\t\$(PRINT_COMPILE_SWIG)\n" ; print MAKEFILE "\t\$(PRINT_COMPILE_SWIG)\n" ;
print MAKEFILE "\t\$(ECHO_CMD)\$(TRICK_CPPC) \$(TRICK_CXXFLAGS) \$(SWIG_CFLAGS) -c \$< -o \$@\n\n" ; print MAKEFILE "\t\$(ECHO_CMD)\$(TRICK_CPPC) \$(TRICK_CXXFLAGS) \$(TRICK_SYSTEM_CXXFLAGS) \$(SWIG_CFLAGS) -c \$< -o \$@\n\n" ;
print MAKEFILE "$swig_src_dir/init_swig_modules.o : $swig_src_dir/init_swig_modules.cpp\n" ; print MAKEFILE "$swig_src_dir/init_swig_modules.o : $swig_src_dir/init_swig_modules.cpp\n" ;
print MAKEFILE "\t\$(PRINT_COMPILE_SWIG)\n" ; print MAKEFILE "\t\$(PRINT_COMPILE_SWIG)\n" ;
print MAKEFILE "\t\$(ECHO_CMD)\$(TRICK_CPPC) \$(TRICK_CXXFLAGS) \$(SWIG_CFLAGS) -c \$< -o \$@\n\n" ; print MAKEFILE "\t\$(ECHO_CMD)\$(TRICK_CPPC) \$(TRICK_CXXFLAGS) \$(TRICK_SYSTEM_CXXFLAGS) \$(SWIG_CFLAGS) -c \$< -o \$@\n\n" ;
print MAKEFILE "TRICK_FIXED_PYTHON = \\ print MAKEFILE "TRICK_FIXED_PYTHON = \\
$swig_sim_dir/swig_double.py \\ $swig_sim_dir/swig_double.py \\

View File

@ -90,6 +90,7 @@ sub gte (@) {
$def{"TRICK_ICG_NOCOMMENT"} = "" ; $def{"TRICK_ICG_NOCOMMENT"} = "" ;
$def{"TRICK_ICG_EXCLUDE"} = "" ; $def{"TRICK_ICG_EXCLUDE"} = "" ;
$def{"TRICK_SWIG_EXCLUDE"} = "" ; $def{"TRICK_SWIG_EXCLUDE"} = "" ;
$def{"TRICK_EXT_LIB_DIRS"} = "" ;
$def{"TRICK_LDFLAGS"} = "" ; $def{"TRICK_LDFLAGS"} = "" ;
$def{"TRICK_MAKE"} = "" ; $def{"TRICK_MAKE"} = "" ;
$def{"TRICK_PATH"} = "$trick_home/bin" ; $def{"TRICK_PATH"} = "$trick_home/bin" ;

View File

@ -178,9 +178,9 @@ sub parse_s_define ($) {
my @preprocess_output; my @preprocess_output;
# Get Include Paths From $TRICK_CFLAGS # Get Include Paths From $TRICK_CFLAGS
@{$$sim_ref{inc_paths}} = $ENV{"TRICK_CFLAGS"} =~ /-I\s*(\S+)/g ; @{$$sim_ref{inc_paths}} = "$ENV{TRICK_CFLAGS} $ENV{TRICK_SYSTEM_CFLAGS}" =~ /-I\s*(\S+)/g ;
push @{$$sim_ref{inc_paths}} , ("$ENV{\"TRICK_HOME\"}/trick_source" , "../include") ; push @{$$sim_ref{inc_paths}} , ("$ENV{TRICK_HOME}/trick_source" , "../include") ;
my @valid_inc_paths ; my @valid_inc_paths ;
foreach (@{$$sim_ref{inc_paths}}) { foreach (@{$$sim_ref{inc_paths}}) {
@ -209,8 +209,8 @@ sub parse_s_define ($) {
if (-e $s_define_file) { if (-e $s_define_file) {
my $cmd; my $cmd;
$cmd = "$CC -C -E -xc $ENV{TRICK_SFLAGS} $s_define_file"; $cmd = "$CC -C -E -xc $ENV{TRICK_SFLAGS} $ENV{TRICK_SYSTEM_SFLAGS} $s_define_file";
#print "$cmd\n" ; print "$cmd\n" ;
@preprocess_output = `$cmd`; @preprocess_output = `$cmd`;

View File

@ -41,6 +41,9 @@ export TRICK_GTE_EXT
export TRICK_HOST_CPU := $(shell export TRICK_CC=$(TRICK_CC) && $(TRICK_HOME)/bin/trick-gte TRICK_HOST_CPU) export TRICK_HOST_CPU := $(shell export TRICK_CC=$(TRICK_CC) && $(TRICK_HOME)/bin/trick-gte TRICK_HOST_CPU)
export TRICK_EXEC_LINK_LIBS = ${PTHREAD_LIBS} $(PYTHON_LIB) $(PLATFORM_LIBS) -lm -ldl -lz export TRICK_EXEC_LINK_LIBS = ${PTHREAD_LIBS} $(PYTHON_LIB) $(PLATFORM_LIBS) -lm -ldl -lz
export TRICK_LIBS = ${RPATH} -L${TRICK_LIB_DIR} -ltrick -ltrick_pyip -ltrick_comm -ltrick_math -ltrick_units -ltrick_mm export TRICK_LIBS = ${RPATH} -L${TRICK_LIB_DIR} -ltrick -ltrick_pyip -ltrick_comm -ltrick_math -ltrick_units -ltrick_mm
export TRICK_SYSTEM_CFLAGS
export TRICK_SYSTEM_CXXFLAGS
export TRICK_SYSTEM_SFLAGS
IO_SRC_DIR := io_src/ IO_SRC_DIR := io_src/
OBJ_DIR := object_${TRICK_HOST_CPU} OBJ_DIR := object_${TRICK_HOST_CPU}
@ -65,33 +68,33 @@ ifeq ($(MAKELEVEL),0)
export TRICK_INCLUDES := -I${TRICK_HOME}/trick_source -I${TRICK_HOME}/include -I${TRICK_HOME}/include/trick/compat export TRICK_INCLUDES := -I${TRICK_HOME}/trick_source -I${TRICK_HOME}/include -I${TRICK_HOME}/include/trick/compat
export TRICK_VERSIONS := -DTRICK_VER=$(TRICK_MAJOR) -DTRICK_MINOR=$(TRICK_MINOR) export TRICK_VERSIONS := -DTRICK_VER=$(TRICK_MAJOR) -DTRICK_MINOR=$(TRICK_MINOR)
TRICK_CFLAGS += $(TRICK_INCLUDES) $(TRICK_VERSIONS) -fpic TRICK_SYSTEM_CFLAGS = $(TRICK_INCLUDES) $(TRICK_VERSIONS) -fpic
ifdef TRICK_CXXFLAGS ifdef TRICK_CXXFLAGS
TRICK_CXXFLAGS += $(TRICK_INCLUDES) $(TRICK_VERSIONS) -fpic TRICK_SYSTEM_CXXFLAGS += $(TRICK_INCLUDES) $(TRICK_VERSIONS) -fpic
else else
TRICK_CXXFLAGS := ${TRICK_CFLAGS} TRICK_SYSTEM_CXXFLAGS := ${TRICK_CFLAGS}
endif endif
TRICK_SFLAGS += -I${TRICK_HOME}/share/trick $(TRICK_INCLUDES) $(TRICK_VERSIONS) TRICK_SYSTEM_SFLAGS += -I${TRICK_HOME}/share/trick $(TRICK_INCLUDES) $(TRICK_VERSIONS)
# append additional c and cxx flags defined in config_*.mk files. # append additional c and cxx flags defined in config_*.mk files.
TRICK_CFLAGS += $(TRICK_ADDITIONAL_CFLAGS) TRICK_SYSTEM_CFLAGS += $(TRICK_ADDITIONAL_CFLAGS)
TRICK_CXXFLAGS += $(TRICK_ADDITIONAL_CXXFLAGS) TRICK_SYSTEM_CXXFLAGS += $(TRICK_ADDITIONAL_CXXFLAGS)
# -fexceptions is included to propogate execptions through C code. # -fexceptions is included to propogate execptions through C code.
TRICK_CFLAGS += -fexceptions TRICK_SYSTEM_CFLAGS += -fexceptions
HAVE_ZEROCONF ?= 0 HAVE_ZEROCONF ?= 0
ifeq ($(HAVE_ZEROCONF),1) ifeq ($(HAVE_ZEROCONF),1)
TRICK_CFLAGS += -DHAVE_ZEROCONF TRICK_SYSTEM_CFLAGS += -DHAVE_ZEROCONF
TRICK_CXXFLAGS += -DHAVE_ZEROCONF TRICK_SYSTEM_CXXFLAGS += -DHAVE_ZEROCONF
endif endif
export USE_ER7_UTILS_INTEGRATORS := 0 export USE_ER7_UTILS_INTEGRATORS := 0
ifneq ("$(wildcard $(TRICK_HOME)/trick_source/er7_utils)","") # if the er7_utils directory exists ifneq ("$(wildcard $(TRICK_HOME)/trick_source/er7_utils)","") # if the er7_utils directory exists
ER7_UTILS_HOME := $(TRICK_HOME)/trick_source/er7_utils ER7_UTILS_HOME := $(TRICK_HOME)/trick_source/er7_utils
USE_ER7_UTILS_INTEGRATORS := 1 USE_ER7_UTILS_INTEGRATORS := 1
TRICK_CFLAGS += -DUSE_ER7_UTILS_INTEGRATORS TRICK_SYSTEM_CFLAGS += -DUSE_ER7_UTILS_INTEGRATORS
TRICK_CXXFLAGS += -DUSE_ER7_UTILS_INTEGRATORS TRICK_SYSTEM_CXXFLAGS += -DUSE_ER7_UTILS_INTEGRATORS
endif endif
endif # MAKELEVEL = 0 endif # MAKELEVEL = 0
@ -101,16 +104,16 @@ ifeq ($(USE_ER7_UTILS_INTEGRATORS), 1)
endif endif
ifeq ($(TRICK_FORCE_32BIT), 1) ifeq ($(TRICK_FORCE_32BIT), 1)
TRICK_CFLAGS += -m32 TRICK_SYSTEM_CFLAGS += -m32
TRICK_CXXFLAGS += -m32 TRICK_SYSTEM_CXXFLAGS += -m32
TRICK_LDFLAGS += -m32 TRICK_LDFLAGS += -m32
LD_PARTIAL += -melf_i386 LD_PARTIAL += -melf_i386
endif endif
IS_CC_CLANG = $(shell ${TRICK_CPPC} -xc /dev/null -dM -E | grep -c __clang__) IS_CC_CLANG = $(shell ${TRICK_CPPC} -xc /dev/null -dM -E | grep -c __clang__)
ifeq ($(IS_CC_CLANG), 1) ifeq ($(IS_CC_CLANG), 1)
TRICK_CFLAGS += -fcolor-diagnostics TRICK_SYSTEM_CFLAGS += -fcolor-diagnostics
TRICK_CXXFLAGS += -fcolor-diagnostics TRICK_SYSTEM_CXXFLAGS += -fcolor-diagnostics
else else
GCC_MAJOR:=$(shell $(TRICK_CC) -dumpversion | cut -f1 -d.) GCC_MAJOR:=$(shell $(TRICK_CC) -dumpversion | cut -f1 -d.)
GCC_MINOR:=$(shell $(TRICK_CC) -dumpversion | cut -f2 -d.) GCC_MINOR:=$(shell $(TRICK_CC) -dumpversion | cut -f2 -d.)
@ -142,7 +145,9 @@ ifeq ($(HAVE_GSL),1)
endif endif
TRICK_INCLUDE = $(shell $(PERL) -e '@inc_paths = "${TRICK_CFLAGS}" =~ /-I\s*(\S+)/g ; foreach $$i (@inc_paths) { print "-I$$i " if (-e $$i)}') TRICK_INCLUDE = $(shell $(PERL) -e '@inc_paths = "${TRICK_CFLAGS}" =~ /-I\s*(\S+)/g ; foreach $$i (@inc_paths) { print "-I$$i " if (-e $$i)}')
TRICK_INCLUDE += $(shell $(PERL) -e '@inc_paths = "${TRICK_SYSTEM_CFLAGS}" =~ /-I\s*(\S+)/g ; foreach $$i (@inc_paths) { print "-I$$i " if (-e $$i)}')
TRICK_DEFINES = $(shell $(PERL) -e '@defines = "${TRICK_CFLAGS}" =~ /-D\s*(\S+)/g ; foreach $$i (@defines) { print "-D$$i "}') TRICK_DEFINES = $(shell $(PERL) -e '@defines = "${TRICK_CFLAGS}" =~ /-D\s*(\S+)/g ; foreach $$i (@defines) { print "-D$$i "}')
TRICK_DEFINES += $(shell $(PERL) -e '@defines = "${TRICK_SYSTEM_CFLAGS}" =~ /-D\s*(\S+)/g ; foreach $$i (@defines) { print "-D$$i "}')
DEPFILE = $(PWD)/Makefile_deps DEPFILE = $(PWD)/Makefile_deps
DEPTEMPFILE = $(PWD)/Makefile_temp_depends DEPTEMPFILE = $(PWD)/Makefile_temp_depends

View File

@ -53,15 +53,15 @@ S_source.hh : S_define | build
# Automatic and manual ICG rules # Automatic and manual ICG rules
$(CURDIR)/build/Makefile_io_src : | S_source.hh $(CURDIR)/build/Makefile_io_src : | S_source.hh
$(PRINT_ICG) $(PRINT_ICG)
$(ECHO_CMD)${TRICK_HOME}/bin/trick-ICG -m ${TRICK_CXXFLAGS} S_source.hh $(ECHO_CMD)${TRICK_HOME}/bin/trick-ICG -m ${TRICK_CXXFLAGS} ${TRICK_SYSTEM_CXXFLAGS} S_source.hh
ICG: ICG:
$(PRINT_ICG) $(PRINT_ICG)
$(ECHO_CMD)${TRICK_HOME}/bin/trick-ICG -m ${TRICK_CXXFLAGS} S_source.hh $(ECHO_CMD)${TRICK_HOME}/bin/trick-ICG -m ${TRICK_CXXFLAGS} ${TRICK_SYSTEM_CXXFLAGS} S_source.hh
force_ICG: force_ICG:
$(PRINT_ICG) $(PRINT_ICG)
$(ECHO_CMD)${TRICK_HOME}/bin/trick-ICG -f -m ${TRICK_CXXFLAGS} S_source.hh $(ECHO_CMD)${TRICK_HOME}/bin/trick-ICG -f -m ${TRICK_CXXFLAGS} ${TRICK_SYSTEM_CXXFLAGS} S_source.hh
# Create makefile for source code # Create makefile for source code
$(CURDIR)/build/Makefile_src: $(CURDIR)/build/Makefile_io_src $(CURDIR)/build/Makefile_src: $(CURDIR)/build/Makefile_io_src

View File

@ -417,18 +417,18 @@ void PrintAttributes::printIOMakefile() {
std::cout << "Creating/updating io_src Makefile" << std::endl ; std::cout << "Creating/updating io_src Makefile" << std::endl ;
makefile_io_src.open("build/Makefile_io_src") ; makefile_io_src.open("build/Makefile_io_src") ;
makefile_io_src << "TRICK_IO_CXXFLAGS := \\" << std::endl ; makefile_io_src << "TRICK_SYSTEM_CXXFLAGS += \\" << std::endl ;
makefile_io_src << " -Wno-invalid-offsetof \\" << std::endl ; makefile_io_src << " -Wno-invalid-offsetof \\" << std::endl ;
makefile_io_src << " -Wno-old-style-cast \\" << std::endl ; makefile_io_src << " -Wno-old-style-cast \\" << std::endl ;
makefile_io_src << " -Wno-write-strings \\" << std::endl ; makefile_io_src << " -Wno-write-strings \\" << std::endl ;
makefile_io_src << " -Wno-unused-variable" << std::endl ; makefile_io_src << " -Wno-unused-variable" << std::endl ;
makefile_io_src << std::endl ; makefile_io_src << std::endl ;
makefile_io_src << "ifeq ($(IS_CC_CLANG), 0)" << std::endl ; makefile_io_src << "ifeq ($(IS_CC_CLANG), 0)" << std::endl ;
makefile_io_src << " TRICK_IO_CXXFLAGS += -Wno-unused-local-typedefs" << std::endl ; makefile_io_src << " TRICK_SYSTEM_CXXFLAGS += -Wno-unused-local-typedefs" << std::endl ;
makefile_io_src << " GCCVERSIONGTEQ48 := $(shell perl -e 'printf \"\%d\\n\", " << makefile_io_src << " GCCVERSIONGTEQ48 := $(shell perl -e 'printf \"\%d\\n\", " <<
"($(GCC_MAJOR)>4)||(($(GCC_MAJOR)==4)&&($(GCC_MINOR)>=8)) ;' )" << std::endl ; "($(GCC_MAJOR)>4)||(($(GCC_MAJOR)==4)&&($(GCC_MINOR)>=8)) ;' )" << std::endl ;
makefile_io_src << " ifeq ($(GCCVERSIONGTEQ48), 1)" << std::endl ; makefile_io_src << " ifeq ($(GCCVERSIONGTEQ48), 1)" << std::endl ;
makefile_io_src << " TRICK_IO_CXXFLAGS += -Wno-unused-but-set-variable" << std::endl ; makefile_io_src << " TRICK_SYSTEM_CXXFLAGS += -Wno-unused-but-set-variable" << std::endl ;
makefile_io_src << " endif" << std::endl ; makefile_io_src << " endif" << std::endl ;
makefile_io_src << "endif" << std::endl ; makefile_io_src << "endif" << std::endl ;
makefile_io_src << std::endl ; makefile_io_src << std::endl ;
@ -457,7 +457,7 @@ void PrintAttributes::printIOMakefile() {
makefile_io_src << "$(IO_OBJ_FILES) : \%.o : \%.cpp" << std::endl ; makefile_io_src << "$(IO_OBJ_FILES) : \%.o : \%.cpp" << std::endl ;
makefile_io_src << "\t$(PRINT_IO_COMPILE)" << std::endl ; makefile_io_src << "\t$(PRINT_IO_COMPILE)" << std::endl ;
makefile_io_src << "\t$(ECHO_CMD)$(TRICK_CPPC) $(TRICK_CXXFLAGS) $(TRICK_IO_CXXFLAGS) -MMD -MP -c $< -o $@" << std::endl ; makefile_io_src << "\t$(ECHO_CMD)$(TRICK_CPPC) $(TRICK_CXXFLAGS) $(TRICK_SYSTEM_CXXFLAGS) -MMD -MP -c $< -o $@" << std::endl ;
makefile_io_src << std::endl ; makefile_io_src << std::endl ;
makefile_io_src << "-include $(IO_OBJ_FILES:.o=.d)" << std::endl ; makefile_io_src << "-include $(IO_OBJ_FILES:.o=.d)" << std::endl ;
makefile_io_src << std::endl ; makefile_io_src << std::endl ;