aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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