diff --git a/share/trick/makefiles/build_trickify_S_source_hh.py b/share/trick/makefiles/build_trickify_S_source_hh.py index 64889126..a698f03b 100644 --- a/share/trick/makefiles/build_trickify_S_source_hh.py +++ b/share/trick/makefiles/build_trickify_S_source_hh.py @@ -12,7 +12,7 @@ def find_files_by_extension(loc, ext): files = list(path.rglob(f'*.{ext}')) return files -files = find_files_by_extension("/users/plherrin/trick/include/", "hh") +files = find_files_by_extension(loc, "hh") s_source = open("S_source.hh", 'w') for i in range(len(files)): s_source.write('#include "' + str(files[i]) + '"\n') diff --git a/share/trick/makefiles/trickify.mk b/share/trick/makefiles/trickify.mk index 3d79c308..eb98ae6b 100644 --- a/share/trick/makefiles/trickify.mk +++ b/share/trick/makefiles/trickify.mk @@ -202,7 +202,7 @@ S_source.hh : # dependency list. The method is laid out in more detail here: # http://make.mad-scientist.net/papers/advanced-auto-dependency-generation/ -$(BUILD_DIR)S_source.d: | $(BUILD_DIR) S_source.hh +$(BUILD_DIR)S_source.d: S_source.hh | $(BUILD_DIR) $(call ECHO_AND_LOG,$(TRICK_HOME)/bin/trick-ICG $(TRICK_CXXFLAGS) $(TRICK_SYSTEM_CXXFLAGS) $(TRICK_ICGFLAGS) S_source.hh) $(call ECHO_AND_LOG,$(TRICK_HOME)/$(LIBEXEC)/trick/make_makefile_swig) $(call ECHO_AND_LOG,$(TRICK_CC) -MM -MP -MT $@ -MF $@ $(TRICKIFY_CXX_FLAGS) S_source.hh) diff --git a/test/Makefile b/test/Makefile index f60dd273..2ea36ea3 100644 --- a/test/Makefile +++ b/test/Makefile @@ -6,8 +6,14 @@ include ${TRICK_HOME}/share/trick/makefiles/Makefile.common SIM_DIRECTORIES = $(wildcard SIM_*) UNIT_TEST_RESULTS = $(addprefix $(TRICK_HOME)/trick_test/, $(addsuffix .xml, $(SIM_DIRECTORIES))) +clean_trickify: + for i in $(SIM_DIRECTORIES) ; do \ + if [ -f "$$i/trickified_project/trickified/"[Mm]"akefile" ] ; then \ + $(MAKE) -C $$i/trickified_project/trickified/ clean ; \ + fi \ + done -clean: +clean: clean_trickify rm -f $(UNIT_TEST_RESULTS) - for i in $(SIM_DIRECTORIES) ; do \ if [ -f "$$i/"[Mm]"akefile" ] ; then \ diff --git a/test/SIM_trickified/trickified_project/trickified/Makefile b/test/SIM_trickified/trickified_project/trickified/Makefile index 1ad40edd..39eb59f0 100644 --- a/test/SIM_trickified/trickified_project/trickified/Makefile +++ b/test/SIM_trickified/trickified_project/trickified/Makefile @@ -1,9 +1,11 @@ +#include myproject.mk + PROJECT_HOME := $(abspath $(dir $(lastword $(MAKEFILE_LIST)))/..) TRICK_HOME := $(abspath $(PROJECT_HOME)/../../..) export TRICKIFY_SOURCE := $(PROJECT_HOME)/include -export TRICKIFY_BUILD_TYPE := STATIC -export TRICKIFY_OBJECT_NAME := trickified_myproject.a +# export TRICKIFY_BUILD_TYPE := PLO +# export TRICKIFY_OBJECT_NAME := trickified_myproject.o export TRICKIFY_CXX_FLAGS := -I$(PROJECT_HOME)/include -I$(TRICK_HOME)/include all: @@ -11,3 +13,4 @@ all: clean: @rm -rf build python trick $(TRICKIFY_OBJECT_NAME) + @rm -rf $(MYPROJECT_TRICK) diff --git a/test/SIM_trickified/trickified_project/trickified/myproject.mk b/test/SIM_trickified/trickified_project/trickified/myproject.mk index 7abe9af1..c5de5f9d 100644 --- a/test/SIM_trickified/trickified_project/trickified/myproject.mk +++ b/test/SIM_trickified/trickified_project/trickified/myproject.mk @@ -11,7 +11,9 @@ MYPROJECT_INCLUDE := -I$(MYPROJECT_HOME)/include TRICK_CFLAGS += $(MYPROJECT_INCLUDE) $(MYPROJECT_SOURCE) TRICK_CXXFLAGS += $(MYPROJECT_INCLUDE) $(MYPROJECT_SOURCE) -MYPROJECT_TRICK := $(MYPROJECT_HOME)/trickified/trickified_myproject.o +export TRICKIFY_BUILD_TYPE := STATIC +export TRICKIFY_OBJECT_NAME := trickified_myproject.a +MYPROJECT_TRICK := $(MYPROJECT_HOME)/trickified/$(TRICKIFY_OBJECT_NAME) # Tell Trick the headers and source at this location are part of a # Trickified project diff --git a/test/SIM_trickified/trickified_project/trickified/trickified_myproject.a b/test/SIM_trickified/trickified_project/trickified/trickified_myproject.a new file mode 100644 index 00000000..b1975697 Binary files /dev/null and b/test/SIM_trickified/trickified_project/trickified/trickified_myproject.a differ