mirror of
https://github.com/nasa/trick.git
synced 2025-01-30 08:03:51 +00:00
Split CP up into components that can be called individually
Renamed some output file to make it more obvious what produced them. refs #86
This commit is contained in:
parent
a2bc82f1e9
commit
fc9c604056
@ -51,7 +51,7 @@ for my $f ( @ARGV ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
open FILE, "build/header_lib_deps_files" or die 'cannot open build/header_lib_deps_files' ;
|
open FILE, "build/ICG_lib_deps" or die 'cannot open build/header_lib_deps' ;
|
||||||
my (@top_lib_dep_file_names) = <FILE> ;
|
my (@top_lib_dep_file_names) = <FILE> ;
|
||||||
close FILE ;
|
close FILE ;
|
||||||
chomp @top_lib_dep_file_names ;
|
chomp @top_lib_dep_file_names ;
|
||||||
@ -227,7 +227,7 @@ else
|
|||||||
PRINT_COMPILE = \@echo \"[34mCompiling [0m \$(subst \$(CURDIR)/build,build,\$<)\"
|
PRINT_COMPILE = \@echo \"[34mCompiling [0m \$(subst \$(CURDIR)/build,build,\$<)\"
|
||||||
PRINT_INC_LINK = \@echo \"[34mPartial link[0m \$(subst \$(CURDIR)/build,build,\${<D})\"
|
PRINT_INC_LINK = \@echo \"[34mPartial link[0m \$(subst \$(CURDIR)/build,build,\${<D})\"
|
||||||
PRINT_EXE_LINK = \@echo \"[34mFinal link [0m \$(subst \$(CURDIR)/,,\$(S_MAIN))\"
|
PRINT_EXE_LINK = \@echo \"[34mFinal link [0m \$(subst \$(CURDIR)/,,\$(S_MAIN))\"
|
||||||
PRINT_S_DEF_DEPS = \@echo \"[34mGet depends [0m for S_define\"
|
PRINT_S_DEF_DEPS = \@echo \"[34mGet depends [0m S_define\"
|
||||||
ECHO_CMD = \@
|
ECHO_CMD = \@
|
||||||
ifeq (\$(MAKECMDGOALS), all)
|
ifeq (\$(MAKECMDGOALS), all)
|
||||||
\$(info [34mPerforming build with these compilation flags[0m)
|
\$(info [34mPerforming build with these compilation flags[0m)
|
||||||
@ -380,7 +380,7 @@ S_main : \$(S_MAIN) build/S_define.deps S_sie.resource
|
|||||||
\$(S_MAIN): \${TRICK_STATIC_LIB} \$(OBJECTS) \$(S_OBJECT_FILES)
|
\$(S_MAIN): \${TRICK_STATIC_LIB} \$(OBJECTS) \$(S_OBJECT_FILES)
|
||||||
\t\$(PRINT_EXE_LINK)
|
\t\$(PRINT_EXE_LINK)
|
||||||
\t\$(ECHO_CMD)\$(TRICK_LD) \$(TRICK_LDFLAGS) -o \$@ \\
|
\t\$(ECHO_CMD)\$(TRICK_LD) \$(TRICK_LDFLAGS) -o \$@ \\
|
||||||
\t\t\$(S_OBJECT_FILES) \$(OBJECTS) \\
|
\t\t\$(S_OBJECT_FILES) \$(LD_FILELIST)build/link_objs \$(LINK_OBJECTS)\\
|
||||||
\t\t\${TRICK_USER_LINK_LIBS} \${READ_ONLY_LIBS} \\
|
\t\t\${TRICK_USER_LINK_LIBS} \${READ_ONLY_LIBS} \\
|
||||||
\t\t\$(LD_WHOLE_ARCHIVE) \${TRICK_LIBS} \$(LD_NO_WHOLE_ARCHIVE)\\
|
\t\t\$(LD_WHOLE_ARCHIVE) \${TRICK_LIBS} \$(LD_NO_WHOLE_ARCHIVE)\\
|
||||||
\t\t\${TRICK_EXEC_LINK_LIBS}
|
\t\t\${TRICK_EXEC_LINK_LIBS}
|
||||||
@ -425,6 +425,22 @@ print MAKEFILE "include build/Makefile_swig\n" ;
|
|||||||
print MAKEFILE "-include S_overrides.mk\n" ;
|
print MAKEFILE "-include S_overrides.mk\n" ;
|
||||||
close MAKEFILE ;
|
close MAKEFILE ;
|
||||||
|
|
||||||
|
open LINKOBJS, ">build/link_objs" or die "Could not open build/link_objs" ;
|
||||||
|
foreach $k ( sort keys %files_by_dir ) {
|
||||||
|
foreach my $ext ( qw{ c C cc cxx cpp c++ l y} ) {
|
||||||
|
my $print_ext ;
|
||||||
|
if ( $ext eq "c++" ) {
|
||||||
|
$print_ext = "CPLUSPLUS" ;
|
||||||
|
} else {
|
||||||
|
$print_ext = $ext ;
|
||||||
|
}
|
||||||
|
if ( scalar @{$files_by_dir{$k}{$ext}} ne 0 ) {
|
||||||
|
print LINKOBJS "build/lib/o_${print_ext}_$files_by_dir{$k}{dir_num}.o\n" ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
close LINKOBJS ;
|
||||||
|
|
||||||
# write out all of files as dependencies to Makefile_src
|
# write out all of files as dependencies to Makefile_src
|
||||||
open MAKEFILEDEPS, ">build/Makefile_src_deps" or die "Could not open build/Makefile_src_deps" ;
|
open MAKEFILEDEPS, ">build/Makefile_src_deps" or die "Could not open build/Makefile_src_deps" ;
|
||||||
print MAKEFILEDEPS "\$(CURDIR)/build/Makefile_src :" ;
|
print MAKEFILEDEPS "\$(CURDIR)/build/Makefile_src :" ;
|
||||||
|
@ -69,7 +69,7 @@ sub read_files_to_process() {
|
|||||||
close FILE ;
|
close FILE ;
|
||||||
chomp @files_to_process ;
|
chomp @files_to_process ;
|
||||||
|
|
||||||
open FILE, "build/external_lib_header_files" or die 'could not open build/external_lib_header_files' ;
|
open FILE, "build/ICG_ext_lib" or die 'could not open build/ICG_ext_lib' ;
|
||||||
@ext_lib_files = <FILE> ;
|
@ext_lib_files = <FILE> ;
|
||||||
close FILE ;
|
close FILE ;
|
||||||
chomp @ext_lib_files ;
|
chomp @ext_lib_files ;
|
||||||
@ -187,7 +187,6 @@ SWIG_PY_OBJECTS =" ;
|
|||||||
push @{$python_modules{"root"}} , $f ;
|
push @{$python_modules{"root"}} , $f ;
|
||||||
# }
|
# }
|
||||||
|
|
||||||
my ($continue) = 1 ;
|
|
||||||
my $md5_sum = md5_hex($f) ;
|
my $md5_sum = md5_hex($f) ;
|
||||||
# check if .sm file was accidentally ##included instead of #included
|
# check if .sm file was accidentally ##included instead of #included
|
||||||
if ( rindex($swig_f,".sm") != -1 ) {
|
if ( rindex($swig_f,".sm") != -1 ) {
|
||||||
@ -226,6 +225,7 @@ SWIG_PY_OBJECTS =" ;
|
|||||||
\$(SWIG_MODULE_OBJECTS) : TRICK_SYSTEM_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)
|
||||||
|
LINK_OBJECTS += \$(SWIG_MODULE_OBJECTS)
|
||||||
\$(S_MAIN): \$(SWIG_MODULE_OBJECTS)
|
\$(S_MAIN): \$(SWIG_MODULE_OBJECTS)
|
||||||
|
|
||||||
\$(SWIG_MODULE_OBJECTS) : \$(SWIG_PY_OBJECTS) | \$(LIB_DIR)
|
\$(SWIG_MODULE_OBJECTS) : \$(SWIG_PY_OBJECTS) | \$(LIB_DIR)
|
||||||
@ -273,7 +273,7 @@ OBJECTS += \$(SWIG_MODULE_OBJECTS)
|
|||||||
}
|
}
|
||||||
close SWIGLIB ;
|
close SWIGLIB ;
|
||||||
|
|
||||||
open S_INSTANCE , "build/S_instances" or return ;
|
open S_INSTANCE , "build/CP_instances" or return ;
|
||||||
my @instances = <S_INSTANCE> ;
|
my @instances = <S_INSTANCE> ;
|
||||||
close S_INSTANCE ;
|
close S_INSTANCE ;
|
||||||
open TOPFILE , ">build/top.i" or return ;
|
open TOPFILE , ">build/top.i" or return ;
|
||||||
|
@ -318,7 +318,7 @@ PURPOSE:
|
|||||||
close S_SOURCE ;
|
close S_SOURCE ;
|
||||||
|
|
||||||
|
|
||||||
open S_INSTANCE, ">build/S_instances" or die "Couldn't open build/S_instances!\n";
|
open S_INSTANCE, ">build/CP_instances" or die "Couldn't open build/CP_instances!\n";
|
||||||
print S_INSTANCE $$sim_ref{extern_instance_declarations} ;
|
print S_INSTANCE $$sim_ref{extern_instance_declarations} ;
|
||||||
foreach my $integ_loop ( @{$$sim_ref{integ_loop}} ) {
|
foreach my $integ_loop ( @{$$sim_ref{integ_loop}} ) {
|
||||||
print S_INSTANCE "extern IntegLoopSimObject $$integ_loop{name} ;\n" ;
|
print S_INSTANCE "extern IntegLoopSimObject $$integ_loop{name} ;\n" ;
|
||||||
|
@ -463,6 +463,7 @@ void PrintAttributes::printIOMakefile() {
|
|||||||
makefile_io_src << std::endl ;
|
makefile_io_src << std::endl ;
|
||||||
|
|
||||||
makefile_io_src << "OBJECTS += $(LIB_DIR)/io_src.o" << std::endl ;
|
makefile_io_src << "OBJECTS += $(LIB_DIR)/io_src.o" << std::endl ;
|
||||||
|
makefile_io_src << "LINK_OBJECTS += $(LIB_DIR)/io_src.o" << std::endl ;
|
||||||
makefile_io_src << "$(S_MAIN) : $(LIB_DIR)/io_src.o" << std::endl ;
|
makefile_io_src << "$(S_MAIN) : $(LIB_DIR)/io_src.o" << std::endl ;
|
||||||
makefile_io_src << std::endl ;
|
makefile_io_src << std::endl ;
|
||||||
makefile_io_src << "$(LIB_DIR)/io_src.o : $(IO_OBJ_FILES) | $(LIB_DIR)" << std::endl ;
|
makefile_io_src << "$(LIB_DIR)/io_src.o : $(IO_OBJ_FILES) | $(LIB_DIR)" << std::endl ;
|
||||||
@ -504,7 +505,7 @@ void PrintAttributes::printIOMakefile() {
|
|||||||
link_io_objs.close() ;
|
link_io_objs.close() ;
|
||||||
ICG_processed.close() ;
|
ICG_processed.close() ;
|
||||||
|
|
||||||
ext_lib.open("build/external_lib_header_files") ;
|
ext_lib.open("build/ICG_ext_lib") ;
|
||||||
for ( sit = ext_lib_io_files.begin() ; sit != ext_lib_io_files.end() ; sit++ ) {
|
for ( sit = ext_lib_io_files.begin() ; sit != ext_lib_io_files.end() ; sit++ ) {
|
||||||
ext_lib << (*sit) << std::endl ;
|
ext_lib << (*sit) << std::endl ;
|
||||||
}
|
}
|
||||||
@ -515,7 +516,7 @@ void PrintAttributes::printHeaderLibraryDependencies() {
|
|||||||
std::ofstream header_lib_deps ;
|
std::ofstream header_lib_deps ;
|
||||||
|
|
||||||
std::cout << "[34mSearching header files for Library Dependencies[0m" << std::endl ;
|
std::cout << "[34mSearching header files for Library Dependencies[0m" << std::endl ;
|
||||||
header_lib_deps.open("build/header_lib_deps_files") ;
|
header_lib_deps.open("build/ICG_lib_deps") ;
|
||||||
std::map< std::string , std::string >::iterator mit ;
|
std::map< std::string , std::string >::iterator mit ;
|
||||||
for ( mit = all_io_files.begin() ; mit != all_io_files.end() ; mit++ ) {
|
for ( mit = all_io_files.begin() ; mit != all_io_files.end() ; mit++ ) {
|
||||||
size_t found ;
|
size_t found ;
|
||||||
@ -564,7 +565,7 @@ void PrintAttributes::printHeaderLibraryDependencies() {
|
|||||||
void PrintAttributes::printICGNoFiles() {
|
void PrintAttributes::printICGNoFiles() {
|
||||||
if ( ! sim_services_flag ) {
|
if ( ! sim_services_flag ) {
|
||||||
std::vector< std::string >::iterator it ;
|
std::vector< std::string >::iterator it ;
|
||||||
std::ofstream icg_no_outfile("build/icg_no_found") ;
|
std::ofstream icg_no_outfile("build/ICG_no_found") ;
|
||||||
for ( it = icg_no_files.begin() ; it != icg_no_files.end() ; it++ ) {
|
for ( it = icg_no_files.begin() ; it != icg_no_files.end() ; it++ ) {
|
||||||
icg_no_outfile << (*it) << std::endl ;
|
icg_no_outfile << (*it) << std::endl ;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user