Create a separate directory for simulation compiliation.

Made adjustments to accomodate differences in arguments to perform
partial linking on the Mac.

refs 
This commit is contained in:
Alex Lin 2015-07-08 11:25:59 -05:00
parent 5848d80bc4
commit b660aa371e
5 changed files with 12 additions and 5 deletions
libexec/trick/pm
share/trick/makefiles
trick_source/codegen/Interface_Code_Gen

View File

@ -225,7 +225,7 @@ S_OBJECT_FILES = \$(CURDIR)/build/S_source.o
print MAKEFILE "\$(CURDIR)/build/lib/o${num_inc_objs}.o : \$(MODEL_${print_ext}_OBJ_$files_by_dir{$k}{dir_num})\n" ;
print MAKEFILE "\t\$(PRINT_INC_LINK)\n" ;
print MAKEFILE "\t\$(ECHO_CMD)cd \${<D} ; ld -Ur -o \$\@ \$(notdir \$^)\n\n" ;
print MAKEFILE "\t\$(ECHO_CMD)cd \${<D} ; ld \$(LD_PARTIAL) -o \$\@ \$(notdir \$^)\n\n" ;
$num_inc_objs++ ;
}
}

View File

@ -323,7 +323,7 @@ SWIG_PY_OBJECTS =" ;
\$(SWIG_MODULE_OBJECTS) : \$(SWIG_PY_OBJECTS) | \$(LIB_DIR)
\t\$(PRINT_SWIG_INC_LINK)
\t\$(ECHO_CMD)ld -Ur -o \$\@ \@build/link_py_objs
\t\$(ECHO_CMD)ld \$(LD_PARTIAL) -o \$\@ \$(LD_FILELIST)build/link_py_objs
\n\n" ;
print MAKEFILE "$swig_src_dir/py_top.cpp : $swig_src_dir/top.i\n" ;

View File

@ -3,6 +3,10 @@ INSTALL = /usr/bin/install
SHARED_LIB_OPT := -dynamiclib -Wl,-undefined,dynamic_lookup
# options for partial linking (trailing space is required)
LD_PARTIAL = -r
LD_FILELIST = -filelist
TRICK_LIB_DIR := ${TRICK_HOME}/lib
RPATH = -Wl,-rpath,${TRICK_LIB_DIR}
TRICK_LDFLAGS +=

View File

@ -1,6 +1,10 @@
INSTALL = /bin/install
# options for partial linking
LD_PARTIAL = -Ur
LD_FILELIST = @
# if we are on a Rehat system, the lib directory is lib64 on 64 bit machines
ifneq ("$(wildcard /etc/redhat-release)","")
UNAME_M := $(shell uname -m)

View File

@ -372,13 +372,12 @@ void PrintAttributes::printIOMakefile() {
makefile << " -Wno-invalid-offsetof \\" << std::endl ;
makefile << " -Wno-old-style-cast \\" << std::endl ;
makefile << " -Wno-write-strings \\" << std::endl ;
makefile << " -Wno-unused-local-typedefs \\" << std::endl ;
makefile << " -Wno-unused-variable" << std::endl ;
makefile << std::endl ;
makefile << "ifeq ($(IS_CC_CLANG), 0)" << std::endl ;
makefile << " GCCVERSIONGTEQ48 := $(shell perl -e 'printf \"\%d\\n\", ($(GCC_MAJOR)>4)||(($(GCC_MAJOR)==4)&&($(GCC_MINOR)>=8)) ;' )" << std::endl ;
makefile << " ifeq ($(GCCVERSIONGTEQ48), 1)" << std::endl ;
makefile << " TRICK_IO_CXXFLAGS += -Wno-unused-but-set-variable" << std::endl ;
makefile << " TRICK_IO_CXXFLAGS += -Wno-unused-but-set-variable -Wno-unused-local-typedefs" << std::endl ;
makefile << " endif" << std::endl ;
makefile << "endif" << std::endl ;
makefile << std::endl ;
@ -416,7 +415,7 @@ void PrintAttributes::printIOMakefile() {
makefile << std::endl ;
makefile << "$(LIB_DIR)/io_src.o : $(IO_OBJ_FILES) | $(LIB_DIR)" << std::endl ;
makefile << "\t$(PRINT_IO_INC_LINK)" << std::endl ;
makefile << "\t$(ECHO_CMD)ld -Ur -o $@ @build/link_io_objs" << std::endl ;
makefile << "\t$(ECHO_CMD)ld $(LD_PARTIAL) -o $@ $(LD_FILELIST)build/link_io_objs" << std::endl ;
makefile.close() ;