Skip to content

Commit

Permalink
CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Pherring04 committed Jan 13, 2025
1 parent c3cd94e commit a2d4455
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions share/trick/makefiles/trickify.mk
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,10 @@ BUILD_DIR := $(dir $(MAKE_OUT))
PY_LINK_LIST := $(BUILD_DIR)trickify_py_link_list
IO_LINK_LIST := $(BUILD_DIR)trickify_io_link_list
OBJ_LINK_LIST := trickify_obj_list
UNAME := $(shell uname)
ifdef FULL_TRICKIFY_BUILD
LINK_LISTS := @$(IO_LINK_LIST) @$(PY_LINK_LIST) @$(OBJ_LINK_LIST)
FULL_TRICKIFY_BUILD = "1"
else
LINK_LISTS := @$(IO_LINK_LIST) @$(PY_LINK_LIST)
FULL_TRICKIFY_BUILD = "0"
endif
ifneq ($(wildcard $(BUILD_DIR)),)
SWIG_OBJECTS := $(shell cat $(PY_LINK_LIST))
Expand All @@ -123,6 +122,7 @@ TRICK_CXXFLAGS += $(TRICKIFY_CXX_FLAGS)
# Ensure we can process all headers
TRICK_EXT_LIB_DIRS := $(TRICKIFY_EXT_LIB_DIRS)

UNAME := $(shell uname)
ifeq ($(UNAME), Linux)
SHARED_OPTIONS := -fPIC
else ifeq ($(UNAME), Darwin)
Expand All @@ -134,22 +134,24 @@ endif
.PHONY: all
all: $(TRICKIFY_OBJECT_NAME) $(TRICKIFY_PYTHON_DIR)

.ONESHELL:
$(TRICKIFY_OBJECT_NAME): $(SWIG_OBJECTS) $(IO_OBJECTS) | $(dir $(TRICKIFY_OBJECT_NAME))
@while read -r line ; do \
export FILES="$$FILES $$line" ; \
done < $(PY_LINK_LIST)
@while read -r line ; do \
export FILES="$$FILES $$line" ; \
done < $(IO_LINK_LIST)
@if [ "$(FULL_TRICKIFY_BUILD)" = "1" ] ; then \
while read -r line ; do \
export FILES="$$FILES $$line" ; \
done < $(OBJ_LINK_LIST)
fi
@if [ "$(TRICKIFY_BUILD_TYPE)" = "PLO" ] ; then \
$(LD) $(LD_PARTIAL) -o $@ $(LINK_LISTS) ; \
$(LD) $(LD_PARTIAL) -o $@ $$FILES ; \
elif [ "$(TRICKIFY_BUILD_TYPE)" = "SHARED" ] ; then \
$(TRICK_CXX) $(SHARED_LIB_OPT) $(SHARED_OPTIONS) -o $@ $(LINK_LISTS) ; \
$(TRICK_CXX) $(SHARED_LIB_OPT) $(SHARED_OPTIONS) -o $@ $$FILES ; \
elif [ "$(TRICKIFY_BUILD_TYPE)" = "STATIC" ] ; then \
export FILES= ; \
while read -r line ; do \
export FILES="$$FILES $$line" ; \
done < $(PY_LINK_LIST) ; \
while read -r line ; do \
export FILES="$$FILES $$line" ; \
done < $(IO_LINK_LIST) ; \
while read -r line ; do \
export FILES="$$FILES $$line" ; \
done < $(OBJ_LINK_LIST) ; \
ar rcs $@ $ $$FILES ; \
fi

Expand Down

0 comments on commit a2d4455

Please sign in to comment.