diff --git a/bin/trick-CP b/bin/trick-CP index da3322d8..7c625e06 100755 --- a/bin/trick-CP +++ b/bin/trick-CP @@ -70,8 +70,7 @@ ifndef TRICK_VERBOSE_BUILD PRINT_MAKEFILE_SWIG = $(info $(call COLOR,Writing) Makefile_swig) endif -all: $(S_MAIN) S_sie.resource - $(info Trick Build Process Complete) +all: test: TRICK_SYSTEM_CFLAGS += -DTRICK_UNIT_TEST test: TRICK_SYSTEM_CXXFLAGS += -DTRICK_UNIT_TEST diff --git a/libexec/trick/convert_swig b/libexec/trick/convert_swig index 2d1a5454..54b072c7 100755 --- a/libexec/trick/convert_swig +++ b/libexec/trick/convert_swig @@ -288,7 +288,7 @@ sub process_file() { my $out_file ; $out_file = basename($f) ; - $out_file =~ s/\.h.*$/_py\.i/ ; + $out_file =~ s/(\.h|\.H|\.hh|\.h\+\+|\.hxx|\.hpp)$/_py\.i/ ; $out_file = "$out_dir/${out_file}" ; diff --git a/libexec/trick/make_makefile_src b/libexec/trick/make_makefile_src index d2e7565b..8fc4eaa2 100755 --- a/libexec/trick/make_makefile_src +++ b/libexec/trick/make_makefile_src @@ -82,6 +82,10 @@ if ( scalar @ARGV ) { $any_deps_changed = 1 ; } +if ( ! -e "build/Makefile_src") { + $any_deps_changed = 1 ; +} + # Read in dependency tree starting at the roots. The dependency tree starts with all of the # header files ICG processed and the lib deps listed in the S_define file. open FILE, "build/ICG_processed" or die 'cannot open build/ICG_processed' ; @@ -280,12 +284,20 @@ $num_inc_objs = 0 ; # List out all of the object files and put the list in a file that we can pass to the linker. # Passing all of them directly to the linker in the command line can exceed the line limit. open MODEL_LINK_LIST, ">build/model_link_list" or die "Could not open build/model_link_list" ; -print MAKEFILE " -# MODEL_OBJECTS ================================================================ - -MODEL_OBJECTS =" ; -foreach $k ( sort keys %files_by_dir ) { - foreach my $ext ( qw{ c C cc cxx cpp c++ } ) { +#foreach $k ( sort keys %files_by_dir ) { +# foreach my $ext ( qw{ c C cc cxx cpp c++ } ) { +# if ( scalar @{$files_by_dir{$k}{$ext}} ne 0 ) { +# foreach $f ( @{$files_by_dir{$k}{$ext}} ) { +# print MAKEFILE " \\\n build$k/$files_by_dir{$k}{src_dir}$f" . "o" ; +# print MODEL_LINK_LIST "build$k/$files_by_dir{$k}{src_dir}$f" . "o\n" ; +# } +# $num_inc_objs++ ; +# } +# } +#} +foreach my $ext ( qw{ c C cc cxx cpp c++ } ) { + print MAKEFILE "\n\nMODEL_${ext}_OBJECTS =" ; + foreach $k ( sort keys %files_by_dir ) { if ( scalar @{$files_by_dir{$k}{$ext}} ne 0 ) { foreach $f ( @{$files_by_dir{$k}{$ext}} ) { print MAKEFILE " \\\n build$k/$files_by_dir{$k}{src_dir}$f" . "o" ; @@ -297,6 +309,13 @@ foreach $k ( sort keys %files_by_dir ) { } close MODEL_LINK_LIST ; +print MAKEFILE "\n\nMODEL_OBJECTS =" ; +foreach my $ext ( qw{ c C cc cxx cpp c++ } ) { + print MAKEFILE " \${MODEL_${ext}_OBJECTS}" ; +} +print MAKEFILE "\n" ; + + # Write out the compile rules for each type of file. print MAKEFILE " @@ -305,18 +324,38 @@ print MAKEFILE " # directories appear to be created as part of the read_lib_deps function, so I'm leaving it out # for now. -build/%.o : /%.c build/%.d +\${MODEL_c_OBJECTS} : build/%.o : /%.c build/%.d \t\$(PRINT_COMPILE) \t\$(ECHO_CMD)\$(TRICK_CC) \$(TRICK_CFLAGS) \$(TRICK_SYSTEM_CFLAGS) -I\$(