Skip to content
Snippets Groups Projects
Commit 2545166f authored by Philipp Stadler's avatar Philipp Stadler
Browse files

chore: configurable content dir

Also clean compiled src-common.
parent cf79829d
Branches
Tags
Loading
Pipeline #13761 passed
CONTENT_DIR ?= content
APKG_TEST_DIR := test/build
APKG_TEST_OK_FLAG := $(BUILD_PREFIX).apkg-test-ok
APKG_TEST_FILES := $(shell find $(APKG_TEST_DIR) -name '*.py' -o -name '*.yaml' -o -name '*.html' -o -name '*.csv')
CONTENT_FILES := $(shell find content -name '*.yaml' -o -name '*.csv' -o -name '*.apkg' -o -name '*.png')
CONTENT_FILES := $(shell find $(CONTENT_DIR) -name '*.yaml' -o -name '*.csv' -o -name '*.apkg' -o -name '*.png')
$(BUILD_PREFIX)apkgs.d.mk: $(filter %/.apkg-spec.yaml,$(CONTENT_FILES)) $(PYTHON_NEEDED)
-mkdir -p $(BUILD_PREFIX)
echo 'APKGS := \' > $@
$(PYTHON) build/export_apkgs.py --dry-run -t no \
-c content \
-c $(CONTENT_DIR) \
$(and $(BUILD_PREFIX),-o $(BUILD_PREFIX)) \
| tr "\n" " " \
>> $@
......@@ -28,7 +29,7 @@ $(APKG_TEST_OK_FLAG): $(PYTHON_NEEDED) $(APKG_TEST_FILES)
touch $(APKG_TEST_OK_FLAG)
.SECONDEXPANSION:
APKG_CONTENT_DIR = content/$(subst -$(lastword $(subst -, ,$*)),,$*)
APKG_CONTENT_DIR = $(CONTENT_DIR)/$(subst -$(lastword $(subst -, ,$*)),,$*)
APKG_DEPS = $(filter $(APKG_CONTENT_DIR)/%,$(CONTENT_FILES))
APKG_DEPS_SORTED = \
$(filter %/.apkg-spec.yaml,$(APKG_DEPS)) \
......
......@@ -10,7 +10,7 @@ ANNOUNCE := $(BUILD_PREFIX)build/announce/run
BUILD_TS_SOURCES := $(shell find build -name '*.ts')
COMPILED_BUILD_BINS := $(GEN_HANZI_DATA) $(ANNOUNCE)
COMPILED_BUILD_JS := $(patsubst %.ts,$(BUILD_PREFIX)%.js, \
$(BUILD_TS_SOURCES))
$(BUILD_TS_SOURCES) $(SRC_COMMON_TS))
TS_SRC += $(BUILD_TS_SOURCES)
MOSTLY_CLEAN += $(COMPILED_BUILD_JS) $(COMPILED_BUILD_BINS)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment