Преглед изворни кода

Makefile: Get rid of dodgy use of $eval within rules.

Keir Fraser пре 3 година
родитељ
комит
324be08fe9
1 измењених фајлова са 16 додато и 16 уклоњено
  1. 16 16
      Makefile

+ 16 - 16
Makefile

@@ -37,27 +37,27 @@ target: FORCE out
 	$(MAKE) -C out/$(mcu)/$(level)/$(target) -f $(ROOT)/Rules.mk target.bin target.hex target.upd $(mcu)=y $(level)=y $(target)=y
 
 dist: level := prod
+dist: t := $(ROOT)/out/$(PROJ)-$(VER)
 dist: FORCE all
 	rm -rf out/$(PROJ)-*
-	$(eval t := out/$(PROJ)-$(VER))
-	mkdir -p out/$(PROJ)-$(VER)/hex/alt
-	$(eval s := out/stm32f1/$(level)/greaseweazle)
-	cp -a $(s)/target.hex $(t)/hex/$(PROJ)-f1-$(VER).hex
-	cp -a $(s)/target.upd $(t)/$(PROJ)-$(VER).upd
-	$(eval s := out/stm32f1/debug/blinky)
-	cp -a $(s)/target.hex $(t)/hex/alt/blinky-test-f1-$(VER).hex
-	$(eval s := out/stm32f7/$(level)/greaseweazle)
-	cp -a $(s)/target.hex $(t)/hex/$(PROJ)-f7-$(VER).hex
-	$(PYTHON) ./scripts/mk_update.py cat $(t)/$(PROJ)-$(VER).upd \
-		$(t)/$(PROJ)-$(VER).upd $(s)/target.upd
-	$(eval s := out/at32f4/$(level)/greaseweazle)
-	cp -a $(s)/target.hex $(t)/hex/$(PROJ)-at32f4-$(VER).hex
-	$(PYTHON) ./scripts/mk_update.py cat $(t)/$(PROJ)-$(VER).upd \
-		$(t)/$(PROJ)-$(VER).upd $(s)/target.upd
+	mkdir -p $(t)/hex/alt
+	cd out/stm32f1/$(level)/greaseweazle; \
+	  cp -a target.hex $(t)/hex/$(PROJ)-f1-$(VER).hex; \
+	  cp -a target.upd $(t)/$(PROJ)-$(VER).upd
+	cd out/stm32f1/debug/blinky; \
+	  cp -a target.hex $(t)/hex/alt/blinky-test-f1-$(VER).hex
+	cd out/stm32f7/$(level)/greaseweazle; \
+	  cp -a target.hex $(t)/hex/$(PROJ)-f7-$(VER).hex; \
+	  $(PYTHON) $(ROOT)/scripts/mk_update.py cat $(t)/$(PROJ)-$(VER).upd \
+	    $(t)/$(PROJ)-$(VER).upd target.upd
+	cd out/at32f4/$(level)/greaseweazle; \
+	  cp -a target.hex $(t)/hex/$(PROJ)-at32f4-$(VER).hex; \
+	  $(PYTHON) $(ROOT)/scripts/mk_update.py cat $(t)/$(PROJ)-$(VER).upd \
+	    $(t)/$(PROJ)-$(VER).upd target.upd
 	cp -a COPYING $(t)/
 	cp -a README $(t)/
 	cp -a RELEASE_NOTES $(t)/
-	(cd out && zip -r $(PROJ)-$(VER).zip $(PROJ)-$(VER))
+	cd out && zip -r $(PROJ)-$(VER).zip $(PROJ)-$(VER)
 
 BAUD=115200
 DEV=/dev/ttyUSB0