From: Ian Jackson Date: Sun, 6 Sep 2020 22:54:06 +0000 (+0100) Subject: fix Makefile for bundle-sources X-Git-Tag: otter-0.2.0~982 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=95aefc464469d56997185218f59297c9268b9420;p=otter.git fix Makefile for bundle-sources --- diff --git a/Makefile b/Makefile index 37f819ad..9502d199 100644 --- a/Makefile +++ b/Makefile @@ -5,20 +5,37 @@ SHELL=/bin/bash +default: debug + CARGO ?= cargo CARGO_TARGET_DIR ?= target -ifneq (,../Cargo.nail) +ifneq (,$(wildcard(../Cargo.nail))) CARGO = nailing-cargo -CARGO_TARGET_DIR = ../Build/target +CARGO_TARGET_DIR = ../Build/$(notdir $(PWD))/target +BUNDLE_SOURCES_DIR = ../bundle-sources +BUNDLE_SOURCES = ../Build/bundle-sources/target/debug/bundle-rust-sources + +ifneq (,$(wildcard $(BUNDLE_SOURCES_DIR))) +$(BUNDLE_SOURCES): + cd ../bundle-sources && $(CARGO) build +.PHONY: $(BUNDLE_SOURCES) +endif endif -default: debug - -debug release:: %: $(CARGO_TARGET_DIR)/%/server templates/script.js +debug release:: %: $(CARGO_TARGET_DIR)/%/server templates/script.js extra-% @echo Built $@. +.PHONY: $(CARGO_TARGET_DIR)/debug/server +.PHONY: $(CARGO_TARGET_DIR)/release/server + +extra-debug: +extra-release: bundled-sources -.PHONY: $(CARGO_TARGET_DIR)/%/server +bundled-sources: $(CARGO_TARGET_DIR)/bundled-sources +$(CARGO_TARGET_DIR)/bundled-sources: $(BUNDLE_SOURCES) + nailing-cargo --- $(abspath $(BUNDLE_SOURCES)) --output $(abspath $@) + @echo Bundled sources. +.PHONY: bundle-sources $(CARGO_TARGET_DIR)/bundled-sources $(CARGO_TARGET_DIR)/debug/server: $(CARGO) build