summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorReinhard Panhuber <[email protected]>2021-01-18 17:16:25 +0100
committerReinhard Panhuber <[email protected]>2021-01-18 17:16:25 +0100
commit15152b62ce363a44bc748859f9d09ef21216790c (patch)
tree8d8489105e563bbfd5adbb1d4080df9b3ff586c1 /examples
parentdff588d7727f63b7e8819a89c259b5edddb079e9 (diff)
parent7aaccd94d2e11ee2329353b4119526c75279b3ba (diff)
Merge remote-tracking branch 'upstream/master' into edpt_ISO_xfer
Diffstat (limited to 'examples')
-rw-r--r--examples/make.mk5
-rw-r--r--examples/rules.mk15
2 files changed, 13 insertions, 7 deletions
diff --git a/examples/make.mk b/examples/make.mk
index 6743044fd..992a4e60e 100644
--- a/examples/make.mk
+++ b/examples/make.mk
@@ -34,9 +34,14 @@ CXX = $(CROSS_COMPILE)g++
OBJCOPY = $(CROSS_COMPILE)objcopy
SIZE = $(CROSS_COMPILE)size
MKDIR = mkdir
+ifeq ($(CMDEXE),1)
+CP = copy
+RM = del
+else
SED = sed
CP = cp
RM = rm
+endif
#-------------- Source files and compiler flags --------------
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