diff --git a/bin/trick-ify b/bin/trick-ify index b7bcd936..eb5d41fa 100755 --- a/bin/trick-ify +++ b/bin/trick-ify @@ -1,17 +1,57 @@ #!/usr/bin/perl -$source_dir = "" ; # Base path to build lib from. Default to working directory -$make_S_source = 0 ; # Whether to generate a S_source -$full_build = 0 ; # Whether to build only ICG/Swig artifacts or entire source +use Cwd qw(); -foreach $itr (0 .. $#ARGV) +$source_dir = "" ; # Base path to build lib from. Default to working directory +$trickify_make_args = "" ; # Arguments to pass into the trickify make +$trickify_make_path = "" ; # Path of the trickify make file +$make_S_source = 0 ; # Whether to generate a S_source +$full_build = 1 ; # Whether to build only ICG/Swig artifacts or entire source + +$skip_arg = 0 ; +foreach $argnum (0 .. $#ARGV) { - if($ARGV[$itr] eq "-R") #Rebuild S_source + if($skip_arg) + { + $skip_arg = 0 ; + next ; + } + + $arg = $ARGV[$argnum] ; + if($arg eq "-d") # Set source directory + { + $source_dir = $ARGV[$argnum + 1] ; + $skip_arg = 1 ; + } + elsif($arg eq "-R") # Rebuild S_source { $make_S_source = 1 ; } + elsif($arg eq "-t") # Build trick artifacts only + { + $full_build = 0 ; + } + elsif($arg eq "-tm") # Trickify make args + { + $trickify_make_args = $ARGV[$argnum + 1] ; + $skip_arg = 1 ; + } + elsif($arg eq "-tp") # Set trickify make path + { + $trickify_make_path = $ARGV[$argnum + 1] ; + $skip_arg = 1 ; + } else { - print "Unrecognized argument: $ARGV[$itr]\n" ; + print "Unrecognized argument: $arg\n" ; } } + +$trickify_make_call = "make $trickify_make_args -f $trickify_make_path" . "/trickify.mk" ; +print $trickify_make_call ; +print "\n" ; +print Cwd::abs_path() ; +print "\n" ; +print $0 ; +print "\n" ; +# print(`make`) ; diff --git a/test/SIM_trickified/S_overrides.mk b/test/SIM_trickified/S_overrides.mk index 9a9fe743..e17d8690 100644 --- a/test/SIM_trickified/S_overrides.mk +++ b/test/SIM_trickified/S_overrides.mk @@ -1,2 +1,4 @@ +LOCAL_DIR := $(abspath $(dir $(lastword $(MAKEFILE_LIST)))) + +TRICK_CXXFLAGS += -I$(LOCAL_DIR)/models include $(CURDIR)/trickified_project/trickified/myproject.mk -TRICK_CXXFLAGS += -I$(CURDIR)/models diff --git a/test/SIM_trickified/trickified_project/trickified/Makefile b/test/SIM_trickified/trickified_project/trickified/Makefile index 97848000..eb0ee191 100644 --- a/test/SIM_trickified/trickified_project/trickified/Makefile +++ b/test/SIM_trickified/trickified_project/trickified/Makefile @@ -1,7 +1,8 @@ +LOCAL_DIR := $(abspath $(dir $(lastword $(MAKEFILE_LIST)))) PROJECT_HOME := $(abspath $(dir $(lastword $(MAKEFILE_LIST)))/..) TRICK_HOME := $(abspath $(PROJECT_HOME)/../../..) -include $(PROJECT_HOME)/myproject_vars.mk +include $(LOCAL_DIR)/myproject_vars.mk export TRICKIFY_SOURCE := $(PROJECT_HOME)/include # export TRICKIFY_BUILD_TYPE := PLO diff --git a/test/SIM_trickified/trickified_project/trickified/myproject.mk b/test/SIM_trickified/trickified_project/trickified/myproject.mk index ba6cecdf..f2f61e8f 100644 --- a/test/SIM_trickified/trickified_project/trickified/myproject.mk +++ b/test/SIM_trickified/trickified_project/trickified/myproject.mk @@ -1,6 +1,6 @@ -mkfile_dir := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) +LOCAL_DIR := $(abspath $(dir $(lastword $(MAKEFILE_LIST)))) -include $(mkfile_dir)/myproject_vars.mk +include $(LOCAL_DIR)/myproject_vars.mk # Append a prerequisite to the $(SWIG_SRC) target. This will build the # Trickified library along with the sim if it does not already exist. Using