diff options
| author | Ha Thach <[email protected]> | 2021-01-21 16:35:13 +0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-01-21 16:35:13 +0700 |
| commit | 1e134cbb31cb0fcd593d47e9865dd2c4dba68686 (patch) | |
| tree | 4638eb5eb885e89be071a83a9297ad9da126cdf8 /examples/rules.mk | |
| parent | e0aa405d19e35dbf58cf502b8106455c1a3c2a5c (diff) | |
| parent | 7aaccd94d2e11ee2329353b4119526c75279b3ba (diff) | |
Merge branch 'master' into pico
Diffstat (limited to 'examples/rules.mk')
| -rw-r--r-- | examples/rules.mk | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/examples/rules.mk b/examples/rules.mk index 37e0e7a19..2274d1cd2 100644 --- a/examples/rules.mk +++ b/examples/rules.mk @@ -81,7 +81,11 @@ uf2: $(BUILD)/$(BOARD)-firmware.uf2 OBJ_DIRS = $(sort $(dir $(OBJ))) $(OBJ): | $(OBJ_DIRS) $(OBJ_DIRS): +ifeq ($(CMDEXE),1) + @$(MKDIR) $(subst /,\,$@) +else @$(MKDIR) -p $@ +endif $(BUILD)/$(BOARD)-firmware.elf: $(OBJ) @echo LINK $@ @@ -107,13 +111,6 @@ vpath %.c . $(TOP) $(BUILD)/obj/%.o: %.c @echo CC $(notdir $@) @$(CC) $(CFLAGS) -c -MD -o $@ $< - @# The following fixes the dependency file. - @# See http://make.paulandlesley.org/autodep.html for details. - @# Regex adjusted from the above to play better with Windows paths, etc. - @$(CP) $(@:.o=.d) $(@:.o=.P); \ - $(SED) -e 's/#.*//' -e 's/^.*: *//' -e 's/ *\\$$//' \ - -e '/^$$/ d' -e 's/$$/ :/' < $(@:.o=.d) >> $(@:.o=.P); \ - $(RM) $(@:.o=.d) # ASM sources lower case .s vpath %.s . $(TOP) @@ -134,7 +131,11 @@ size: $(BUILD)/$(BOARD)-firmware.elf .PHONY: clean clean: +ifeq ($(CMDEXE),1) + rd /S /Q $(subst /,\,$(BUILD)) +else $(RM) -rf $(BUILD) +endif # Print out the value of a make variable. # https://stackoverflow.com/questions/16467718/how-to-print-out-a-variable-in-makefile |
