diff --git a/bin/trick-ify b/bin/trick-ify index b92a85bd..5f80ea6d 100755 --- a/bin/trick-ify +++ b/bin/trick-ify @@ -1,6 +1,7 @@ #!/usr/bin/perl -use Getopt::Long; +use Getopt::Long ; +use Cwd ; use strict ; my $my_path = $0 ; @@ -118,6 +119,15 @@ elsif ( $build_type eq "so" || $build_type eq "dylib" ) } } +#Build the S_overrides_trickify.mk +if (!$no_clean_s_source) +{ + print "Building S_overrides_trickify.mk\n" ; + my $my_cwd = getcwd ; + my $make_s_overrides = "python3 $my_path../share/trick/pymods/trick/build_S_overrides_trickify.py $ENV{'TRICKIFY_OBJECT_NAME'} $ENV{'TRICKIFY_HEADER'} $my_cwd/python" ; + print(`$make_s_overrides`) ; +} + #Build the S_source.hh if (!$no_clean_s_source) { diff --git a/share/trick/pymods/trick/build_S_overrides_trickify.py b/share/trick/pymods/trick/build_S_overrides_trickify.py new file mode 100644 index 00000000..373bb0b4 --- /dev/null +++ b/share/trick/pymods/trick/build_S_overrides_trickify.py @@ -0,0 +1,7 @@ +import os +import sys + +path = os.path.dirname(os.path.abspath(__file__)) + "/build_trickify.py" +exec(open(path).read()) + +build_S_overrides_trickify(sys.argv[1], sys.argv[2], sys.argv[3]) diff --git a/share/trick/pymods/trick/build_trickify.py b/share/trick/pymods/trick/build_trickify.py index cfc8dd0d..d6cfd122 100644 --- a/share/trick/pymods/trick/build_trickify.py +++ b/share/trick/pymods/trick/build_trickify.py @@ -52,3 +52,10 @@ def build_src_list(): files = find_files_by_extension(path, ext) for i in range(len(files)): src_list.write(str(files[i]) + '\n') + +def build_S_overrides_trickify(ldflags, ext_lib_dirs, python_path): + s_overrides = open("S_overrides_trickify.mk", 'w') + + s_overrides.write("TRICK_LDFLAGS += " + ldflags + '\n') + s_overrides.write("TRICK_EXT_LIB_DIRS += " + ext_lib_dirs + '\n') + s_overrides.write("TRICK_PYTHON_PATH += " + python_path + '\n')