Partial work

This commit is contained in:
Pherring04 2024-10-17 15:13:21 -05:00
parent 7bc6ab74a8
commit 044693b03c
3 changed files with 27 additions and 2 deletions

View File

@ -0,0 +1,18 @@
from pathlib import Path
import os
def_ext = ["h", "hh", "hpp", "H", "hxx", "h++"]
loc = ""
if "TRICKIFY_SOURCE" in os.environ:
loc = os.getenv("TRICKIFY_SOURCE")
def find_files_by_extension(loc, ext):
path = Path(loc)
files = list(path.rglob(f'*.{ext}'))
return files
files = find_files_by_extension("/users/plherrin/trick/include/", "hh")
s_source = open("S_source.hh", 'w')
for i in range(len(files)):
s_source.write('#include "' + str(files[i]) + '"\n')

View File

@ -50,6 +50,8 @@
# The file into which generated Python modules are zipped. The default # The file into which generated Python modules are zipped. The default
# value is python (in the current directory). # value is python (in the current directory).
# #
# TRICKIFY_SOURCE
#
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# #
# EXAMPLE: # EXAMPLE:
@ -166,6 +168,9 @@ $(TRICKIFY_PYTHON_DIR): $(SWIG_OBJECTS:.o=.cpp) | $(dir $(TRICKIFY_PYTHON_DIR))
$(info $(call COLOR,Zipping) Python modules into $@) $(info $(call COLOR,Zipping) Python modules into $@)
$(call ECHO_AND_LOG,cd .trick && zip -Arq $@ .) $(call ECHO_AND_LOG,cd .trick && zip -Arq $@ .)
S_source.hh :
python3 ${TRICK_HOME}/share/trick/makefiles/build_trickify_S_source_hh.py
# SWIG_OBJECTS and IO_OBJECTS are meant to contain all of the *_py and io_* # SWIG_OBJECTS and IO_OBJECTS are meant to contain all of the *_py and io_*
# object file names, respectively, by looking at products of ICG and # object file names, respectively, by looking at products of ICG and
# make_makefile_swig. However, we can't run a rule for ICG before those # make_makefile_swig. However, we can't run a rule for ICG before those
@ -197,7 +202,7 @@ $(TRICKIFY_PYTHON_DIR): $(SWIG_OBJECTS:.o=.cpp) | $(dir $(TRICKIFY_PYTHON_DIR))
# dependency list. The method is laid out in more detail here: # dependency list. The method is laid out in more detail here:
# http://make.mad-scientist.net/papers/advanced-auto-dependency-generation/ # http://make.mad-scientist.net/papers/advanced-auto-dependency-generation/
$(BUILD_DIR)S_source.d: | $(BUILD_DIR) $(BUILD_DIR)S_source.d: | $(BUILD_DIR) S_source.hh
$(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)/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_HOME)/$(LIBEXEC)/trick/make_makefile_swig)
$(call ECHO_AND_LOG,$(TRICK_CC) -MM -MP -MT $@ -MF $@ $(TRICKIFY_CXX_FLAGS) S_source.hh) $(call ECHO_AND_LOG,$(TRICK_CC) -MM -MP -MT $@ -MF $@ $(TRICKIFY_CXX_FLAGS) S_source.hh)

View File

@ -1,7 +1,9 @@
PROJECT_HOME := $(abspath $(dir $(lastword $(MAKEFILE_LIST)))/..) PROJECT_HOME := $(abspath $(dir $(lastword $(MAKEFILE_LIST)))/..)
TRICK_HOME := $(abspath $(PROJECT_HOME)/../../..) TRICK_HOME := $(abspath $(PROJECT_HOME)/../../..)
export TRICKIFY_OBJECT_NAME := trickified_myproject.o export TRICKIFY_SOURCE := $(PROJECT_HOME)/include
export TRICKIFY_BUILD_TYPE := STATIC
export TRICKIFY_OBJECT_NAME := trickified_myproject.a
export TRICKIFY_CXX_FLAGS := -I$(PROJECT_HOME)/include -I$(TRICK_HOME)/include export TRICKIFY_CXX_FLAGS := -I$(PROJECT_HOME)/include -I$(TRICK_HOME)/include
all: all: