Skip to content

Commit

Permalink
Fix build process not working ('all' target not being executed)
Browse files Browse the repository at this point in the history
  • Loading branch information
kosude committed Apr 20, 2024
1 parent dd4bef3 commit a609ecf
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,36 @@ SPHINX := sphinx-build

BUN := bun

# this ensures `all` is run by default despite not being the first target in the Makefile
.DEFAULT_GOAL := all

# check for dependencies

.PHONY: validate_cmake validate_cargo validate_sphinx validate_bun
validate_cmake:
$(if \
$(shell which $(CMAKE)),\
$(info CMake located at $(shell command -v $(CMAKE))),\
$(error CMake not found in PATH, but is required to build texedit))
@:
validate_cargo:
$(if \
$(shell which $(CARGO)),\
$(info Cargo located at $(shell command -v $(CARGO))),\
$(error Cargo not found in PATH, but is required to build tecomp))
@:
validate_sphinx:
$(if \
$(shell which $(SPHINX)),\
$(info Sphinx located at $(shell command -v $(SPHINX))),\
$(error Sphinx (sphinx-build) not found in PATH, but is required to build HTML doc))
@:
validate_bun:
$(if \
$(shell which $(BUN)),\
$(info Bun located at $(shell command -v $(BUN))),\
$(error Bun not found in PATH, but is required to build tepdfserver))
@:

# run with DEBUG=1 to use debug configuration

Expand All @@ -49,7 +57,8 @@ ifneq "$(DEBUG)" "1"
CARGOFLAGS += --release
endif

.PHONY: tecomp texedit tepdfserver docs clean predist validate_sphinx validate_bun
.PHONY: tecomp texedit tepdfserver
.PHONY: docs clean predist


#
Expand Down Expand Up @@ -88,7 +97,7 @@ $(BUILD_DIR)/texpdfc.sh: $(SRC_DIR)/tecomp/texpdfc.sh | $(BUILD_DIR)

COMPILER_TOML := $(SRC_DIR)/tecomp/Cargo.toml

tecomp: validate_cargo $(COMPILER_TOML) $(TEXLIVE_DST) $(BUILD_DIR)/texpdfc.sh
tecomp: $(COMPILER_TOML) $(TEXLIVE_DST) $(BUILD_DIR)/texpdfc.sh | validate_cargo
$(CARGO) $(CARGOCHAN) build $(CARGOFLAGS) --manifest-path=$(COMPILER_TOML) --target-dir=$(BUILD_DIR)/_$@ --out-dir=$(BUILD_DIR)


Expand All @@ -98,7 +107,7 @@ tecomp: validate_cargo $(COMPILER_TOML) $(TEXLIVE_DST) $(BUILD_DIR)/texpdfc.sh

FRONTEND_CMAKELISTS := $(SRC_DIR)/texedit/CMakeLists.txt

texedit: validate_cmake $(FRONTEND_CMAKELISTS)
texedit: $(FRONTEND_CMAKELISTS) | validate_cmake
$(CMAKE) $(SRC_DIR)/texedit -B$(BUILD_DIR)/_frontend $(CMAKEFLAGS)
$(CMAKE) --build $(BUILD_DIR)/_frontend
mv $(BUILD_DIR)/_frontend/texedit $(BUILD_DIR)
Expand All @@ -111,7 +120,7 @@ texedit: validate_cmake $(FRONTEND_CMAKELISTS)
$(SRC_DIR)/tepdfserver/node_modules:
$(BUN) install --cwd $(SRC_DIR)/tepdfserver

tepdfserver: validate_bun | $(BUILD_DIR) $(SRC_DIR)/tepdfserver/node_modules
tepdfserver: | validate_bun $(BUILD_DIR) $(SRC_DIR)/tepdfserver/node_modules
$(BUN) build --compile $(SRC_DIR)/tepdfserver/server/start.ts --loader .mjs:file --outfile=tepdfserver
mv $(SRC_DIR)/tepdfserver/server/tepdfserver $(BUILD_DIR)

Expand All @@ -123,7 +132,7 @@ tepdfserver: validate_bun | $(BUILD_DIR) $(SRC_DIR)/tepdfserver/node_modules
DOCS_CONF_PY := $(SRC_DIR)/docs/conf.py
DOCS_CONFIG_SH := $(SRC_DIR)/docs/configure.sh

docs: validate_sphinx $(DOCS_CONFIG_SH) $(DOCS_CONF_PY)
docs: $(DOCS_CONFIG_SH) $(DOCS_CONF_PY) | validate_sphinx
$(DOCS_CONFIG_SH) "$(SPHINX)" "$(SRC_DIR)/docs" "$(BUILD_DIR)/docs" "$(SRC_DIR)/util"


Expand Down

0 comments on commit a609ecf

Please sign in to comment.