diff --git a/bin/trick-dp b/bin/trick-dp index dec4b6d0..7bd845cd 100755 --- a/bin/trick-dp +++ b/bin/trick-dp @@ -1,34 +1,8 @@ #!/usr/bin/perl -# trick_dp that determines trick_home based on execution location of this script. - use FindBin qw($RealBin); -use lib "$RealBin/../libexec/trick/pm" ; -use File::Basename ; -use Cwd 'abs_path'; -use gte ; +use lib ("$RealBin/../libexec/trick/pm", "$RealBin/../lib/trick/pm") ; +use launch_java ; -if ( ! exists $ENV{TRICK_HOME} ) { - $trick_bin = dirname(abs_path($0)) ; - $trick_home = dirname($trick_bin) ; - - # set TRICK_HOME based on the value of trick_home - $ENV{TRICK_HOME} = $trick_home ; -} -$host_cpu = gte("TRICK_HOST_CPU") ; -chomp($host_cpu) ; -$ENV{TRICK_HOST_CPU} = $host_cpu ; - -if ( $^O eq "darwin" ) { - $command = "java -classpath $ENV{TRICK_HOME}/libexec/trick/java/dist/*:$ENV{TRICK_HOME}/libexec/trick/java/lib/*:$ENV{TRICK_HOME}/libexec/trick/java/lib/ \\ - -Xdock:name=\"Trick DP\" \\ - -Xdock:icon=$ENV{TRICK_HOME}/libexec/trick/java/resources/trick_icon.png \\ - trick.dataproducts.trickdp.TrickDPApplication " . join (" " , @ARGV) ; -} else { - $command = "java -cp $ENV{TRICK_HOME}/libexec/trick/java/dist/*:$ENV{TRICK_HOME}/libexec/trick/java/lib/*:$ENV{TRICK_HOME}/libexec/trick/java/lib/ trick.dataproducts.trickdp.TrickDPApplication " - . join (" " , @ARGV) ; -} - -system $command ; -exit $? >> 8; +launch_java("Trick DP", "trick.dataproducts.trickdp.TrickDPApplication") ; diff --git a/bin/trick-dre b/bin/trick-dre index 80b4fa25..dd17654f 100755 --- a/bin/trick-dre +++ b/bin/trick-dre @@ -1,12 +1,8 @@ -#!/bin/sh +#!/usr/bin/perl + +use FindBin qw($RealBin); +use lib ("$RealBin/../libexec/trick/pm", "$RealBin/../lib/trick/pm") ; +use launch_java ; + +launch_java("Data Recording Editor", "trick.dre.DreApplication") ; -if [ "${OSTYPE}" = "darwin" ] -then - java -classpath ${TRICK_HOME}/libexec/trick/java/dist/*:${TRICK_HOME}/libexec/trick/java/lib/* \ - -Xdock:name="Data Recording Editor" \ - -Xdock:icon=${TRICK_HOME}/libexec/trick/java/resources/trick_icon.png \ - trick.dre.DreApplication $@ -else - java -classpath ${TRICK_HOME}/libexec/trick/java/dist/*:${TRICK_HOME}/libexec/trick/java/lib/* trick.dre.DreApplication $@ -fi - diff --git a/bin/trick-gte b/bin/trick-gte index 1a3a2a07..ee67302a 100755 --- a/bin/trick-gte +++ b/bin/trick-gte @@ -1,7 +1,7 @@ #!/usr/bin/perl use FindBin qw($RealBin); -use lib "$RealBin/../libexec/trick/pm" ; +use lib ("$RealBin/../libexec/trick/pm", "$RealBin/../lib/trick/pm") ; use gte ; use strict ; diff --git a/bin/trick-jxplot b/bin/trick-jxplot index 6d7f063e..9f1bcec1 100755 --- a/bin/trick-jxplot +++ b/bin/trick-jxplot @@ -1,24 +1,8 @@ #!/usr/bin/perl -# trick_qp that determines trick_home based on execution location of this script. -use File::Basename ; -use Cwd 'abs_path'; +use FindBin qw($RealBin); +use lib ("$RealBin/../libexec/trick/pm", "$RealBin/../lib/trick/pm") ; +use launch_java ; -if ( ! exists $ENV{TRICK_HOME} ) { - $trick_bin = dirname(abs_path($0)) ; - $trick_home = dirname($trick_bin) ; +launch_java("Trick Plot", "trick.dataproducts.plot.JXPlotApplication") ; - # set TRICK_HOME based on the value of trick_home - $ENV{TRICK_HOME} = $trick_home ; -} - -if ( $^O eq "darwin" ) { - $command = "java -classpath $ENV{TRICK_HOME}/libexec/trick/java/dist/*:$ENV{TRICK_HOME}/libexec/trick/java/lib/*:$ENV{TRICK_HOME}/libexec/trick/java/lib/ \\ - -Xdock:name=\"Trick Plot\" \\ - -Xdock:icon=$ENV{TRICK_HOME}/libexec/trick/java/resources/trick_icon.png \\ - trick.dataproducts.plot.JXPlotApplication " . join (" " , @ARGV) ; -} else { - $command = "java -cp $ENV{TRICK_HOME}/libexec/trick/java/dist/*:$ENV{TRICK_HOME}/libexec/trick/java/lib/*:$ENV{TRICK_HOME}/libexec/trick/java/lib/ trick.dataproducts.plot.JXPlotApplication " . join (" " , @ARGV) ; -} -system $command ; -exit $? >> 8; diff --git a/bin/trick-mm b/bin/trick-mm index a3008881..d661b243 100755 --- a/bin/trick-mm +++ b/bin/trick-mm @@ -1,26 +1,9 @@ #!/usr/bin/perl -# trick_dp that determines trick_home based on execution location of this script. +use FindBin qw($RealBin); +use lib ("$RealBin/../libexec/trick/pm", "$RealBin/../lib/trick/pm") ; +use launch_java ; -use File::Basename ; -use Cwd 'abs_path'; +launch_java("Monte Monitor", "trick.montemonitor.MonteMonitorApplication") ; -if ( ! exists $ENV{TRICK_HOME} ) { - $trick_bin = dirname(abs_path($0)) ; - $trick_home = dirname($trick_bin) ; - - # set TRICK_HOME based on the value of trick_home - $ENV{TRICK_HOME} = $trick_home ; -} - -if ( $^O eq "darwin" ) { - $command = "java -classpath $ENV{TRICK_HOME}/libexec/trick/java/dist/*:$ENV{TRICK_HOME}/libexec/trick/java/lib/* \\ - -Xdock:name=\"Monte Monitor\" \\ - -Xdock:icon=$ENV{TRICK_HOME}/libexec/trick/java/resources/trick_icon.png \\ - trick.montemonitor.MonteMonitorApplication " . join (" " , @ARGV) ; -} else { - $command = "java -cp $ENV{TRICK_HOME}/libexec/trick/java/dist/*:$ENV{TRICK_HOME}/libexec/trick/java/lib/* trick.montemonitor.MonteMonitorApplication " . join (" " , @ARGV) ; -} -system $command ; -exit $? >> 8; diff --git a/bin/trick-mtv b/bin/trick-mtv index e68b5012..5b619313 100755 --- a/bin/trick-mtv +++ b/bin/trick-mtv @@ -1,27 +1,8 @@ #!/usr/bin/perl -# trick_dp that determines trick_home based on execution location of this script. +use FindBin qw($RealBin); +use lib ("$RealBin/../libexec/trick/pm", "$RealBin/../lib/trick/pm") ; +use launch_java ; -use File::Basename ; -use Cwd 'abs_path'; - -if ( ! exists $ENV{TRICK_HOME} ) { - $trick_bin = dirname(abs_path($0)) ; - $trick_home = dirname($trick_bin) ; - - # set TRICK_HOME based on the value of trick_home - $ENV{TRICK_HOME} = $trick_home ; -} - -if ( $^O eq "darwin" ) { - $command = "java -classpath $ENV{TRICK_HOME}/libexec/trick/java/dist/*:$ENV{TRICK_HOME}/libexec/trick/java/lib/* \\ - -Xdock:name=\"Event/Malfunction Trick View\" \\ - -Xdock:icon=$ENV{TRICK_HOME}/libexec/trick/java/resources/trick_icon.png \\ - trick.mtv.MtvApp " . join (" " , @ARGV) ; -} else { - $command = "java -cp $ENV{TRICK_HOME}/libexec/trick/java/dist/*:$ENV{TRICK_HOME}/libexec/trick/java/lib/* trick.mtv.MtvApp " . join (" " , @ARGV) ; -} -print "$command\n" ; -system $command ; -exit $? >> 8; +launch_java("Event/Malvunction Trick View", "trick.mtv.MtvApp") ; diff --git a/bin/trick-qp b/bin/trick-qp index a6ca82c2..67d711ec 100755 --- a/bin/trick-qp +++ b/bin/trick-qp @@ -1,25 +1,8 @@ #!/usr/bin/perl -# trick_qp that determines trick_home based on execution location of this script. -use File::Basename ; -use Cwd 'abs_path'; +use FindBin qw($RealBin); +use lib ("$RealBin/../libexec/trick/pm", "$RealBin/../lib/trick/pm") ; +use launch_java ; -if ( ! exists $ENV{TRICK_HOME} ) { - $trick_bin = dirname(abs_path($0)) ; - $trick_home = dirname($trick_bin) ; - - # set TRICK_HOME based on the value of trick_home - $ENV{TRICK_HOME} = $trick_home ; -} - -if ( $^O eq "darwin" ) { - $command = "java -classpath $ENV{TRICK_HOME}/libexec/trick/java/dist/*:$ENV{TRICK_HOME}/libexec/trick/java/lib/*:$ENV{TRICK_HOME}/libexec/trick/java/lib/ \\ - -Xdock:name=\"Trick QP\" \\ - -Xdock:icon=$ENV{TRICK_HOME}/libexec/trick/java/resources/trick_icon.png \\ - trick.dataproducts.trickqp.TrickQPApplication " . join (" " , @ARGV) ; -} else { - $command = "java -cp $ENV{TRICK_HOME}/libexec/trick/java/dist/*:$ENV{TRICK_HOME}/libexec/trick/java/lib/*:$ENV{TRICK_HOME}/libexec/trick/java/lib/ trick.dataproducts.trickqp.TrickQPApplication " . join (" " , @ARGV) ; -} -system $command ; -exit $? >> 8; +launch_java("Trick QP", "trick.dataproducts.trickqp.TrickQPApplication") ; diff --git a/bin/trick-sie b/bin/trick-sie index 3cb4b908..f9adedd2 100755 --- a/bin/trick-sie +++ b/bin/trick-sie @@ -1,26 +1,8 @@ #!/usr/bin/perl -# trick_dp that determines trick_home based on execution location of this script. +use FindBin qw($RealBin); +use lib ("$RealBin/../libexec/trick/pm", "$RealBin/../lib/trick/pm") ; +use launch_java ; -use File::Basename ; -use Cwd 'abs_path'; - -if ( ! exists $ENV{TRICK_HOME} ) { - $trick_bin = dirname(abs_path($0)) ; - $trick_home = dirname($trick_bin) ; - - # set TRICK_HOME based on the value of trick_home - $ENV{TRICK_HOME} = $trick_home ; -} - -if ( $^O eq "darwin" ) { - $command = "java -classpath $ENV{TRICK_HOME}/libexec/trick/java/dist/*:$ENV{TRICK_HOME}/libexec/trick/java/lib/* \\ - -Xdock:name=\"SIE\" \\ - -Xdock:icon=$ENV{TRICK_HOME}/libexec/trick/java/resources/trick_icon.png \\ - trick.sie.SieApplication " . join (" " , @ARGV) ; -} else { - $command = "java -cp $ENV{TRICK_HOME}/libexec/trick/java/dist/*:$ENV{TRICK_HOME}/libexec/trick/java/lib/* trick.sie.SieApplication " . join (" " , @ARGV) ; -} -system $command ; -exit $? >> 8; +launch_java("SIE", "trick.sie.SieApplication") ; diff --git a/bin/trick-simcontrol b/bin/trick-simcontrol index d3ccd756..c2f9391e 100755 --- a/bin/trick-simcontrol +++ b/bin/trick-simcontrol @@ -1,27 +1,8 @@ #!/usr/bin/perl -# trick_dp that determines trick_home based on execution location of this script. +use FindBin qw($RealBin); +use lib ("$RealBin/../libexec/trick/pm", "$RealBin/../lib/trick/pm") ; +use launch_java ; -use File::Basename ; -use Cwd 'abs_path'; - -if ( ! exists $ENV{TRICK_HOME} ) { - $trick_bin = dirname(abs_path($0)) ; - $trick_home = dirname($trick_bin) ; - - # set TRICK_HOME based on the value of trick_home - $ENV{TRICK_HOME} = $trick_home ; -} - -if ( $^O eq "darwin" ) { - $command = "java -classpath $ENV{TRICK_HOME}/libexec/trick/java/dist/*:$ENV{TRICK_HOME}/libexec/trick/java/lib/* \\ - -Xdock:name=\"Sim Control\" \\ - -Xdock:icon=$ENV{TRICK_HOME}/libexec/trick/java/resources/trick_icon.png \\ - trick.simcontrol.SimControlApplication " . join (" " , @ARGV) ; -} else { - $command = "java -cp $ENV{TRICK_HOME}/libexec/trick/java/dist/*:$ENV{TRICK_HOME}/libexec/trick/java/lib/* \\ - trick.simcontrol.SimControlApplication " . join (" " , @ARGV) ; -} -system $command ; -exit $? >> 8; +launch_java("Sim Control", "trick.simcontrol.SimControlApplication") ; diff --git a/bin/trick-sniffer b/bin/trick-sniffer index 0494a9f6..7ff2e690 100755 --- a/bin/trick-sniffer +++ b/bin/trick-sniffer @@ -1,27 +1,8 @@ #!/usr/bin/perl -# trick_dp that determines trick_home based on execution location of this script. +use FindBin qw($RealBin); +use lib ("$RealBin/../libexec/trick/pm", "$RealBin/../lib/trick/pm") ; +use launch_java ; -use File::Basename ; -use Cwd 'abs_path'; - -if ( ! exists $ENV{TRICK_HOME} ) { - $trick_bin = dirname(abs_path($0)) ; - $trick_home = dirname($trick_bin) ; - - # set TRICK_HOME based on the value of trick_home - $ENV{TRICK_HOME} = $trick_home ; -} - -if ( $^O eq "darwin" ) { - $command = "java -classpath $ENV{TRICK_HOME}/libexec/trick/java/dist/*:$ENV{TRICK_HOME}/libexec/trick/java/lib/* \\ - -Xdock:name=\"Sim Sniffer\" \\ - -Xdock:icon=$ENV{TRICK_HOME}/libexec/trick/java/resources/trick_icon.png \\ - trick.sniffer.SimSnifferApplication " . join (" " , @ARGV) ; -} else { - $command = "java -cp $ENV{TRICK_HOME}/libexec/trick/java/dist/*:$ENV{TRICK_HOME}/libexec/trick/java/lib/* trick.sniffer.SimSnifferApplication " - . join (" " , @ARGV) ; -} -system $command ; -exit $? >> 8; +launch_java("Sim Sniffer", "trick.sniffer.SimSnifferApplication") ; diff --git a/bin/trick-stripchart b/bin/trick-stripchart index c52c83a6..3ec12ef9 100755 --- a/bin/trick-stripchart +++ b/bin/trick-stripchart @@ -1,36 +1,8 @@ #!/usr/bin/perl -# trick_dp that determines trick_home based on execution location of this script. +use FindBin qw($RealBin); +use lib ("$RealBin/../libexec/trick/pm", "$RealBin/../lib/trick/pm") ; +use launch_java ; -use File::Basename ; -use Cwd 'abs_path'; +launch_java("Stripchart", "trick.stripchart.StripchartApplication") ; -if ( ! exists $ENV{TRICK_HOME} ) { - $trick_bin = dirname(abs_path($0)) ; - $trick_home = dirname($trick_bin) ; - - # set TRICK_HOME based on the value of trick_home - $ENV{TRICK_HOME} = $trick_home ; -} - -if ( $^O eq "darwin" ) { - $command = "java -classpath $ENV{TRICK_HOME}/libexec/trick/java/dist/*:$ENV{TRICK_HOME}/libexec/trick/java/lib/*:$ENV{TRICK_HOME}/libexec/trick/java/lib/ \\ - -Xdock:name=\"Stripchart\" \\ - -Xdock:icon=$ENV{TRICK_HOME}/libexec/trick/java/resources/trick_icon.png \\ - trick.stripchart.StripchartApplication "; -} else { - $command = "java -cp $ENV{TRICK_HOME}/libexec/trick/java/dist/*:$ENV{TRICK_HOME}/libexec/trick/java/lib/* trick.stripchart.StripchartApplication "; -} - -# to preserve the quotes if the option value has spaces in it -foreach (@ARGV) { - if ( $_ =~ /\s/ ) { - $command = "$command \"$_\""; - } else { - $command = "$command $_"; - } -} - -system $command; - -exit $? >> 8; diff --git a/bin/trick-tv b/bin/trick-tv index 1848d9d1..e3f60179 100755 --- a/bin/trick-tv +++ b/bin/trick-tv @@ -1,26 +1,8 @@ #!/usr/bin/perl -# trick_dp that determines trick_home based on execution location of this script. +use FindBin qw($RealBin); +use lib ("$RealBin/../libexec/trick/pm", "$RealBin/../lib/trick/pm") ; +use launch_java ; -use File::Basename ; -use Cwd 'abs_path'; - -if ( ! exists $ENV{TRICK_HOME} ) { - $trick_bin = dirname(abs_path($0)) ; - $trick_home = dirname($trick_bin) ; - - # set TRICK_HOME based on the value of trick_home - $ENV{TRICK_HOME} = $trick_home ; -} - -if ( $^O eq "darwin" ) { - $command = "java -classpath $ENV{TRICK_HOME}/libexec/trick/java/dist/*:$ENV{TRICK_HOME}/libexec/trick/java/lib/* \\ - -Xdock:name=\"Trick View\" \\ - -Xdock:icon=$ENV{TRICK_HOME}/libexec/trick/java/resources/trick_icon.png \\ - trick.tv.TVApplication " . join (" " , @ARGV) ; -} else { - $command = "java -cp $ENV{TRICK_HOME}/libexec/trick/java/dist/*:$ENV{TRICK_HOME}/libexec/trick/java/lib/* trick.tv.TVApplication " . join (" " , @ARGV) ; -} -system $command ; -exit $? >> 8; +launch_java("Trick View", "trick.tv.TVApplication") ; diff --git a/libexec/trick/pm/ICG.pm b/libexec/trick/pm/ICG.pm index 915d08f7..eb1d520f 100644 --- a/libexec/trick/pm/ICG.pm +++ b/libexec/trick/pm/ICG.pm @@ -351,6 +351,9 @@ sub ICG(\@$$$) { if ( $operation eq "CP" ) { + next if ( $f =~ /$ENV{TRICK_HOME}\/include/) ; + next if ( $f =~ /$ENV{TRICK_HOME}\/trick_source/) ; + trick_print($$sim_ref{fh}, "Getting dependencies for $f\n" , "normal_white" , $$sim_ref{args}{v}); delete $$sim_ref{head_deps}{$f} ; diff --git a/libexec/trick/pm/launch_java.pm b/libexec/trick/pm/launch_java.pm new file mode 100644 index 00000000..aa9e6dff --- /dev/null +++ b/libexec/trick/pm/launch_java.pm @@ -0,0 +1,56 @@ +#!/usr/bin/perl +package launch_java ; +@ISA = qw(Exporter); +@EXPORT = qw(launch_java); + +# launch_java determines trick_home based on execution location of the calling script. +use File::Basename ; +use Cwd 'abs_path'; +use gte ; + +sub launch_java($$) { + + my ($name, $application ) = @_ ; + + if ( ! exists $ENV{TRICK_HOME} ) { + $trick_bin = dirname(abs_path($0)) ; + $trick_home = dirname($trick_bin) ; + + # set TRICK_HOME based on the value of trick_home + $ENV{TRICK_HOME} = $trick_home ; + } + + if ( -e "$ENV{TRICK_HOME}/libexec/trick" ) { + $lib_dir = "libexec" ; + } else { + $lib_dir = "lib" ; + } + $java_dir = "$ENV{TRICK_HOME}/$lib_dir/trick/java" ; + + $host_cpu = gte("TRICK_HOST_CPU") ; + chomp($host_cpu) ; + $ENV{TRICK_HOST_CPU} = $host_cpu ; + + if ( $^O eq "darwin" ) { + $command = "java -classpath $java_dir/dist/*:$java_dir/lib/*:$java_dir/lib/ \\ + -Xdock:name=\"$name\" \\ + -Xdock:icon=$java_dir/resources/trick_icon.png \\ + $application" ; + } else { + $command = "java -cp $java_dir/dist/*:$java_dir/lib/*:$java_dir/lib/ $application" ; + } + + # to preserve the quotes if the option value has spaces in it + foreach (@ARGV) { + if ( $_ =~ /\s/ ) { + $command .= " \"$_\""; + } else { + $command .= " $_"; + } + } + + system $command ; + exit $? >> 8; +} + +1; diff --git a/libexec/trick/pm/make_makefile.pm b/libexec/trick/pm/make_makefile.pm index 3425d0df..439460d3 100644 --- a/libexec/trick/pm/make_makefile.pm +++ b/libexec/trick/pm/make_makefile.pm @@ -599,15 +599,15 @@ build_user_lib : \$(BUILD_USER_OBJ_DIRS) \$(BUILD_USER_LIBS) print MAKEFILE " \$(OBJECT_DIR)/S_source.o: S_source.cpp | \$(OBJECT_DIR) \t\$(TRICK_CPPC) \$(TRICK_CXXFLAGS) -MMD -MP -c S_source.cpp -o \$(OBJECT_DIR)/S_source.o -\t\@\${TRICK_HOME}/libexec/trick/depend_objs S_source.cpp +\t\@\${TRICK_HOME}/\$(LIBEXEC)/trick/depend_objs S_source.cpp \$(OBJECT_DIR)/class_map.o: \$(CURDIR)/io_src/class_map.cpp | \$(OBJECT_DIR) \t\$(TRICK_CPPC) \$(TRICK_CXXFLAGS) -MMD -MP -c \$(CURDIR)/io_src/class_map.cpp -o \$(OBJECT_DIR)/class_map.o -\t\@\${TRICK_HOME}/libexec/trick/depend_objs class_map.cpp +\t\@\${TRICK_HOME}/\$(LIBEXEC)/trick/depend_objs class_map.cpp \$(OBJECT_DIR)/enum_map.o: \$(CURDIR)/io_src/enum_map.cpp | \$(OBJECT_DIR) \t\$(TRICK_CPPC) \$(TRICK_CXXFLAGS) -MMD -MP -c \$(CURDIR)/io_src/enum_map.cpp -o \$(OBJECT_DIR)/enum_map.o -\t\@\${TRICK_HOME}/libexec/trick/depend_objs enum_map.cpp +\t\@\${TRICK_HOME}/\$(LIBEXEC)/trick/depend_objs enum_map.cpp -include \$(OBJECT_DIR)/S_source.dep -include \$(OBJECT_DIR)/class_map.dep @@ -961,7 +961,7 @@ sub write_rules ($$$$) { print MAKEFILE "$k/object_\${TRICK_HOST_CPU}/$n" . "o : $k/$dir_info{src_dir}$n" . "c\n" ; if ( $dir_info{writable} ) { print MAKEFILE "\tcd $k/$dir_info{src_dir} ; \$(TRICK_CC) \$(TRICK_CFLAGS) -MMD -MP -c \${\@F:.o=.c} -o \$\@\n" ; - print MAKEFILE "\t\@cd $k/$dir_info{src_dir} ; \${TRICK_HOME}/libexec/trick/depend_objs ${n}c\n" ; + print MAKEFILE "\t\@cd $k/$dir_info{src_dir} ; \${TRICK_HOME}/\$(LIBEXEC)/trick/depend_objs ${n}c\n" ; print MAKEFILE "-include $k/object_\${TRICK_HOST_CPU}/${n}dep\n" ; } @@ -977,7 +977,7 @@ sub write_rules ($$$$) { if ( $dir_info{writable} ) { #print MAKEFILE "\t\@echo \"Compiling $k/$dir_info{src_dir}\${\@F:.o=.$ext}\"\n" ; print MAKEFILE "\tcd $k/$dir_info{src_dir} ; \$(TRICK_CPPC) \$(TRICK_CXXFLAGS) -MMD -MP -c \${\@F:.o=.$ext} -o \$\@\n" ; - print MAKEFILE "\t\@cd $k/$dir_info{src_dir} ; \${TRICK_HOME}/libexec/trick/depend_objs $n$ext\n" ; + print MAKEFILE "\t\@cd $k/$dir_info{src_dir} ; \${TRICK_HOME}/\$(LIBEXEC)/trick/depend_objs $n$ext\n" ; print MAKEFILE "\n-include $k/object_\${TRICK_HOST_CPU}/${n}dep\n\n" ; } diff --git a/libexec/trick/pm/make_swig_makefile.pm b/libexec/trick/pm/make_swig_makefile.pm index a70ec7f5..d6796a80 100644 --- a/libexec/trick/pm/make_swig_makefile.pm +++ b/libexec/trick/pm/make_swig_makefile.pm @@ -280,7 +280,7 @@ sub make_swig_makefile($$$) { print MAKEFILE"\n\n" ; print MAKEFILE "convert_swig:\n" ; - print MAKEFILE "\t\${TRICK_HOME}/libexec/trick/convert_swig \${TRICK_CONVERT_SWIG_FLAGS} S_source.hh\n" ; + print MAKEFILE "\t\${TRICK_HOME}/\$(LIBEXEC)/trick/convert_swig \${TRICK_CONVERT_SWIG_FLAGS} S_source.hh\n" ; print MAKEFILE "\n\n" ; my %swig_dirs ; diff --git a/share/trick/makefiles/Makefile.common b/share/trick/makefiles/Makefile.common index bfb329aa..dab150a2 100644 --- a/share/trick/makefiles/Makefile.common +++ b/share/trick/makefiles/Makefile.common @@ -44,6 +44,13 @@ $(error Please run $(TRICK_HOME)/configure before running make) endif endif +# Where are the libexec executables +ifneq ("$(wildcard $(TRICK_HOME)/libexec)","") + LIBEXEC = libexec +else + LIBEXEC = lib +endif + # Do this section only once ifndef TRICK_MAKE_COMMON export TRICK_MAKE_COMMON := 1 diff --git a/share/trick/makefiles/Makefile.sim b/share/trick/makefiles/Makefile.sim index b5a19696..1fcdd8eb 100644 --- a/share/trick/makefiles/Makefile.sim +++ b/share/trick/makefiles/Makefile.sim @@ -32,10 +32,10 @@ ${TRICK_LIB_DIR}/libtrick.a: Makefile_sim: S_define @/bin/rm -rf lib_${TRICK_HOST_CPU} object_${TRICK_HOST_CPU} - @${TRICK_HOME}/libexec/trick/configuration_processor $(TRICK_CPFLAGS) + @${TRICK_HOME}/$(LIBEXEC)/trick/configuration_processor $(TRICK_CPFLAGS) model_dirs: - @${TRICK_HOME}/libexec/trick/configuration_processor -z + @${TRICK_HOME}/$(LIBEXEC)/trick/configuration_processor -z tidy clean real_clean spotless apocalypse sie ICG force_ICG help convert_swig S_define_exp: @if [ -f Makefile_sim ] ; then $(MAKE) --no-print-directory -f Makefile_sim $@ ; else echo "No Makefile_sim found" ; fi diff --git a/share/trick/makefiles/Makefile.tricklib b/share/trick/makefiles/Makefile.tricklib index eb60dbd1..fb5a5dc8 100644 --- a/share/trick/makefiles/Makefile.tricklib +++ b/share/trick/makefiles/Makefile.tricklib @@ -167,7 +167,7 @@ $(Y_OBJS) : $(OBJ_DIR)/%.tab.o : $(SRC_DIR)%.tab.c | $(OBJ_DIR) depend: @ $(TRICK_CPPC) -MM $(TRICK_CXXFLAGS) $(C_SRC) $(CPP_SRC) >> $(DEPTEMPFILE) - @ $(PERL) ${TRICK_HOME}/libexec/trick/depend_cp $(DEPTEMPFILE) > $(DEPFILE) + @ $(PERL) ${TRICK_HOME}/$(LIBEXEC)/trick/depend_cp $(DEPTEMPFILE) > $(DEPFILE) @ $(RM) $(DEPTEMPFILE) @ echo "Created dependency file $(DEPFILE)" diff --git a/share/trick/makefiles/config_Linux.mk b/share/trick/makefiles/config_Linux.mk index fd06e857..646b6bc8 100644 --- a/share/trick/makefiles/config_Linux.mk +++ b/share/trick/makefiles/config_Linux.mk @@ -1,12 +1,18 @@ INSTALL = /bin/install + +# 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) ifeq ($(UNAME_M),x86_64) TRICK_LIB_DIR := ${TRICK_HOME}/lib64 else TRICK_LIB_DIR := ${TRICK_HOME}/lib endif +else +TRICK_LIB_DIR := ${TRICK_HOME}/lib +endif SHARED_LIB_OPT := -shared TRICK_LIBS = -Wl,-rpath=${TRICK_HOME}/lib:${TRICK_HOME}/lib64 -L${TRICK_LIB_DIR} -ltrick -ltrick_pyip diff --git a/trick_source/codegen/Interface_Code_Gen/HeaderSearchDirs.cpp b/trick_source/codegen/Interface_Code_Gen/HeaderSearchDirs.cpp index 3e842375..a32d1491 100644 --- a/trick_source/codegen/Interface_Code_Gen/HeaderSearchDirs.cpp +++ b/trick_source/codegen/Interface_Code_Gen/HeaderSearchDirs.cpp @@ -37,7 +37,6 @@ void HeaderSearchDirs::AddCompilerBuiltInSearchDirs () { // all kinds of problems. On macs all headers are clang friendly. #if __linux std::stringstream icg_dir ; - //icg_dir << std::string(getenv("TRICK_HOME")) << "/libexec/trick/lib/clang/" ; icg_dir << LLVM_HOME << "/lib/clang/" ; icg_dir << __clang_major__ << "." << __clang_minor__ ; #ifdef __clang_patchlevel__ diff --git a/trick_source/java/makefile b/trick_source/java/makefile index 5123f60a..9104f990 100644 --- a/trick_source/java/makefile +++ b/trick_source/java/makefile @@ -9,9 +9,9 @@ SRC_DIR = src SRC_FILES = $(shell find ${SRC_DIR} -type f -name \*.java) BUILD_DIR = build DEST_DIR = ${BUILD_DIR}/classes -LIB_DIR = ${TRICK_HOME}/libexec/trick/java/lib -DIST_DIR = ${TRICK_HOME}/libexec/trick/java/dist -RESOURCES_DIR = ${TRICK_HOME}/libexec/trick/java/resources +LIB_DIR = ${TRICK_HOME}/$(LIBEXEC)/trick/java/lib +DIST_DIR = ${TRICK_HOME}/$(LIBEXEC)/trick/java/dist +RESOURCES_DIR = ${TRICK_HOME}/$(LIBEXEC)/trick/java/resources DOCS_API_DIR = docs/api TEST_REPORTS_DIR = test/reports