From 52e7951dc24f1a66cd0377c146d8eb950cc7ef1c Mon Sep 17 00:00:00 2001 From: Alex Taradov Date: Mon, 30 Sep 2019 19:03:06 -0700 Subject: [PATCH] Proper selection of mkdir depending on the OS --- platform/samd11/make/Makefile_bl | 9 ++++++++- platform/samd11/make/Makefile_std | 9 ++++++++- platform/samd11_vcp/make/Makefile | 8 +++++++- platform/samd21/make/Makefile | 8 +++++++- 4 files changed, 30 insertions(+), 4 deletions(-) diff --git a/platform/samd11/make/Makefile_bl b/platform/samd11/make/Makefile_bl index ac59ce7..388c166 100644 --- a/platform/samd11/make/Makefile_bl +++ b/platform/samd11/make/Makefile_bl @@ -9,6 +9,12 @@ CC = arm-none-eabi-gcc OBJCOPY = arm-none-eabi-objcopy SIZE = arm-none-eabi-size +ifeq ($(OS), Windows_NT) + MKDIR = gmkdir +else + MKDIR = mkdir +endif + CFLAGS += -W -Wall --std=gnu99 -Os CFLAGS += -fno-diagnostics-show-caret CFLAGS += -fdata-sections -ffunction-sections @@ -61,7 +67,7 @@ $(BUILD)/$(BIN).bin: $(BUILD)/$(BIN).elf @$(CC) $(CFLAGS) $(filter %/$(subst .o,.c,$(notdir $@)), $(SRCS)) -c -o $@ directory: - @gmkdir -p $(BUILD) + @$(MKDIR) -p $(BUILD) size: $(BUILD)/$(BIN).elf @echo size: @@ -72,3 +78,4 @@ clean: @-rm -rf $(BUILD) -include $(wildcard $(BUILD)/*.d) + diff --git a/platform/samd11/make/Makefile_std b/platform/samd11/make/Makefile_std index c8128c7..f09a534 100644 --- a/platform/samd11/make/Makefile_std +++ b/platform/samd11/make/Makefile_std @@ -9,6 +9,12 @@ CC = arm-none-eabi-gcc OBJCOPY = arm-none-eabi-objcopy SIZE = arm-none-eabi-size +ifeq ($(OS), Windows_NT) + MKDIR = gmkdir +else + MKDIR = mkdir +endif + CFLAGS += -W -Wall --std=gnu99 -Os CFLAGS += -fno-diagnostics-show-caret CFLAGS += -fdata-sections -ffunction-sections @@ -61,7 +67,7 @@ $(BUILD)/$(BIN).bin: $(BUILD)/$(BIN).elf @$(CC) $(CFLAGS) $(filter %/$(subst .o,.c,$(notdir $@)), $(SRCS)) -c -o $@ directory: - @gmkdir -p $(BUILD) + @$(MKDIR) -p $(BUILD) size: $(BUILD)/$(BIN).elf @echo size: @@ -72,3 +78,4 @@ clean: @-rm -rf $(BUILD) -include $(wildcard $(BUILD)/*.d) + diff --git a/platform/samd11_vcp/make/Makefile b/platform/samd11_vcp/make/Makefile index fd957d9..d70b3e2 100644 --- a/platform/samd11_vcp/make/Makefile +++ b/platform/samd11_vcp/make/Makefile @@ -9,6 +9,12 @@ CC = arm-none-eabi-gcc OBJCOPY = arm-none-eabi-objcopy SIZE = arm-none-eabi-size +ifeq ($(OS), Windows_NT) + MKDIR = gmkdir +else + MKDIR = mkdir +endif + CFLAGS += -W -Wall --std=gnu11 -Os CFLAGS += -fno-diagnostics-show-caret CFLAGS += -fdata-sections -ffunction-sections @@ -64,7 +70,7 @@ $(BUILD)/$(BIN).bin: $(BUILD)/$(BIN).elf @$(CC) $(CFLAGS) $(filter %/$(subst .o,.c,$(notdir $@)), $(SRCS)) -c -o $@ directory: - @gmkdir -p $(BUILD) + @$(MKDIR) -p $(BUILD) size: $(BUILD)/$(BIN).elf @echo size: diff --git a/platform/samd21/make/Makefile b/platform/samd21/make/Makefile index bf90542..277a9b3 100644 --- a/platform/samd21/make/Makefile +++ b/platform/samd21/make/Makefile @@ -9,6 +9,12 @@ CC = arm-none-eabi-gcc OBJCOPY = arm-none-eabi-objcopy SIZE = arm-none-eabi-size +ifeq ($(OS), Windows_NT) + MKDIR = gmkdir +else + MKDIR = mkdir +endif + CFLAGS += -W -Wall -Wextra --std=gnu99 -O2 CFLAGS += -fno-diagnostics-show-caret CFLAGS += -fdata-sections -ffunction-sections @@ -61,7 +67,7 @@ $(BUILD)/$(BIN).bin: $(BUILD)/$(BIN).elf @$(CC) $(CFLAGS) $(filter %/$(subst .o,.c,$(notdir $@)), $(SRCS)) -c -o $@ directory: - @gmkdir -p $(BUILD) + @$(MKDIR) -p $(BUILD) size: $(BUILD)/$(BIN).elf @echo size: