Skip to content

Commit 317b347

Browse files
committed
Makefile: Use VPATH to avoid rsync
Also add + to mkdir lines to fix --dry-run.
1 parent d59265c commit 317b347

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Makefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,10 @@ mrproper: FORCE clean
4242
rm -rf ext
4343

4444
out: FORCE
45-
mkdir -p out/$(mcu)/$(level)/$(target)
46-
rsync -a --include="*/" --exclude="*" src/ out/$(mcu)/$(level)/$(target)
45+
+mkdir -p out/$(mcu)/$(level)/$(target)
4746

4847
target: FORCE out
49-
$(MAKE) -C out/$(mcu)/$(level)/$(target) -f $(ROOT)/Rules.mk target.bin target.hex target.dfu $(mcu)=y $(level)=y $(target)=y
48+
$(MAKE) VPATH=$(ROOT)/src -C out/$(mcu)/$(level)/$(target) -f $(ROOT)/Rules.mk target.bin target.hex target.dfu $(mcu)=y $(level)=y $(target)=y
5049

5150
HXC_FF_URL := https://www.github.com/keirf/flashfloppy-hxc-file-selector
5251
HXC_FF_URL := $(HXC_FF_URL)/releases/download

Rules.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ build.o: $(OBJS)
7373
$(LD) -r -o $@ $^
7474

7575
%/build.o: FORCE
76-
$(MAKE) -f $(ROOT)/Rules.mk -C $* build.o
76+
+mkdir -p $*
77+
$(MAKE) VPATH=$(VPATH)/$* -f $(ROOT)/Rules.mk -C $* build.o
7778

7879
%.ld: $(SRCDIR)/%.ld.S $(SRCDIR)/Makefile
7980
@echo CPP $@

0 commit comments

Comments
 (0)