aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorTeddy Wing2018-09-25 15:28:30 +0200
committerTeddy Wing2018-09-25 15:28:30 +0200
commit1b1fed99b7a97b4b774e6f8b39a91f82cbe5d6f3 (patch)
tree8eac313a715e4c8a43e995ab7f8147da0295c3bd /Makefile
parent6cdd2adfb6fc538411ae6ab1a02672d70ba8d404 (diff)
downloadDomeKey-1b1fed99b7a97b4b774e6f8b39a91f82cbe5d6f3.tar.bz2
Makefile: Fix dependency on Rust lib
Turns out the order-only prerequisite from 8c363688ac173d34c865b8271ade8c845b67fa24 was a false lead. That just made Make ignore the timestamp on the file and caused it to rebuild the dependency tree correctly. Looks like we need an actual dependency on the Rust source files in order to get the tree working correctly. Can't just call into the sub-make and have it work. Change the `RUST_LIB` prerequisite to point to the actual file because otherwise it always has the latest timestamp, causing `xcodebuild` to run. Unfortunately we end up with duplication between this Makefile and the one in `dome-key-map`, but that seems unavoidable if we want to set up the dependencies correctly. Now it finally seems to work right.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile10
1 files changed, 6 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 687d70a..3d575de 100644
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,9 @@ SOURCE_FILES := $(shell find DomeKey lib \
-or -name '*.c')
RUST_DIR := lib/dome-key-map
-RUST_LIB := target/debug/libdome_key_map.a
+RUST_LOCAL_LIB := target/debug/libdome_key_map.a
+RUST_LIB := $(RUST_DIR)/$(RUST_LOCAL_LIB)
+RUST_SOURCE_FILES := $(shell find $(RUST_DIR)/src -type f -name '*.rs')
DEBUG_PRODUCT := ~/Library/Developer/Xcode/DerivedData/DomeKey-*/Build/Products/Debug/DomeKey
@@ -13,11 +15,11 @@ DEBUG_PRODUCT := ~/Library/Developer/Xcode/DerivedData/DomeKey-*/Build/Products/
.PHONY: build
build: $(DEBUG_PRODUCT)
-$(DEBUG_PRODUCT): $(SOURCE_FILES) | $(RUST_LIB)
+$(DEBUG_PRODUCT): $(SOURCE_FILES) $(RUST_LIB)
xcodebuild -scheme DomeKey -configuration Debug
-$(RUST_LIB):
- $(MAKE) -C $(RUST_DIR) $@
+$(RUST_LIB): $(RUST_SOURCE_FILES)
+ $(MAKE) -C $(RUST_DIR) $(RUST_LOCAL_LIB)
.PHONY: run
run: build