From 2108bb7137b30be96ae0526fd6905322f5adefc6 Mon Sep 17 00:00:00 2001 From: Sid Price Date: Wed, 27 Mar 2019 16:09:32 -0600 Subject: [PATCH] Native Windows builds All except hydrabus and launchpad-icdi building in PowerShell. --- src/Makefile | 17 ++++++++++++----- src/platforms/native/Makefile.inc | 7 +++++-- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/Makefile b/src/Makefile index def78d5..7ccdc1a 100644 --- a/src/Makefile +++ b/src/Makefile @@ -86,8 +86,12 @@ blackmagic: include/version.h $(OBJ) clean: host_clean $(Q)echo " CLEAN" - -$(Q)$(RM) -f *.o *.d *~ blackmagic $(HOSTFILES) - -$(Q)$(RM) -f platforms/*/*.o platforms/*/*.d mapfile include/version.h +ifeq ($(OS), Windows_NT) + -$(Q)$(shell del *.o, *.d, blackmagic*, $(HOSTFILES)) +else + -$(Q)$(RM) *.o *.d *~ blackmagic $(HOSTFILES) + -$(Q)$(RM) platforms/*/*.o platforms/*/*.d mapfile include/version.h +endif all_platforms: $(Q)set -e ;\ @@ -112,7 +116,10 @@ all_platforms: command.c: include/version.h include/version.h: FORCE - $(Q)echo " GIT include/version.h" - $(Q)echo "#define FIRMWARE_VERSION \"`git describe --always --dirty`\"" > $@ - + $(Q)echo " GIT include/version.h" +ifeq ($(OS), Windows_NT) + $(Q)echo #define FIRMWARE_VERSION "$(shell git describe --always --dirty)" > $@ +else + $(Q)echo "#define FIRMWARE_VERSION \"$(shell git describe --always --dirty)\"" > $@ +endif -include *.d diff --git a/src/platforms/native/Makefile.inc b/src/platforms/native/Makefile.inc index 63b24de..1518bed 100644 --- a/src/platforms/native/Makefile.inc +++ b/src/platforms/native/Makefile.inc @@ -34,5 +34,8 @@ blackmagic_dfu: usbdfu.o dfucore.o dfu_f1.o $(Q)$(CC) $^ -o $@ $(LDFLAGS_BOOT) host_clean: - -$(Q)$(RM) -f blackmagic.bin blackmagic_dfu blackmagic_dfu.bin blackmagic_dfu.hex - +ifeq ($(OS), Windows_NT) + -$(Q)$(shell del blackmagic.bin blackmagic_dfu blackmagic_dfu.bin blackmagic_dfu.hex) +else + -$(Q)$(RM) blackmagic.bin blackmagic_dfu blackmagic_dfu.bin blackmagic_dfu.hex +endif