diff --git a/Makefile b/Makefile index a3446b0..db9178f 100644 --- a/Makefile +++ b/Makefile @@ -4,15 +4,18 @@ Q := @ endif PC_HOSTED = +NO_LIBOPENCM3 = ifeq ($(PROBE_HOST), libftdi) PC_HOSTED = true + NO_LIBOPENCM3 = true endif ifeq ($(PROBE_HOST), pc-stlinkv2) PC_HOSTED = true + NO_LIBOPENCM3 = true endif all: -ifndef PC_HOSTED +ifndef NO_LIBOPENCM3 $(Q)if [ ! -f libopencm3/Makefile ]; then \ echo "Initialising git submodules..." ;\ git submodule init ;\ @@ -23,7 +26,7 @@ endif $(Q)$(MAKE) $(MFLAGS) -C src clean: -ifndef PC_HOSTED +ifndef NO_LIBOPENCM3 $(Q)$(MAKE) $(MFLAGS) -C libopencm3 $@ endif $(Q)$(MAKE) $(MFLAGS) -C src $@ diff --git a/src/include/gdb_if.h b/src/include/gdb_if.h index d2ad243..1dc9e28 100644 --- a/src/include/gdb_if.h +++ b/src/include/gdb_if.h @@ -21,7 +21,7 @@ #ifndef __GDB_IF_H #define __GDB_IF_H -#if !defined(PC_HOSTED) +#if !defined(NO_LIBOPENCM3) #include void gdb_usb_out_cb(usbd_device *dev, uint8_t ep); #endif diff --git a/src/platforms/libftdi/Makefile.inc b/src/platforms/libftdi/Makefile.inc index 06c07d7..0ddabe8 100644 --- a/src/platforms/libftdi/Makefile.inc +++ b/src/platforms/libftdi/Makefile.inc @@ -1,5 +1,5 @@ SYS = $(shell $(CC) -dumpmachine) -CFLAGS += -DPC_HOSTED -DENABLE_DEBUG +CFLAGS += -DPC_HOSTED -DNO_LIBOPENCM3 -DENABLE_DEBUG LDFLAGS += -lftdi1 ifneq (, $(findstring mingw, $(SYS))) LDFLAGS += -lusb-1.0 -lws2_32 diff --git a/src/platforms/pc-stlinkv2/Makefile.inc b/src/platforms/pc-stlinkv2/Makefile.inc index 53ec16a..8762885 100644 --- a/src/platforms/pc-stlinkv2/Makefile.inc +++ b/src/platforms/pc-stlinkv2/Makefile.inc @@ -1,6 +1,6 @@ TARGET=blackmagic_stlinkv2 SYS = $(shell $(CC) -dumpmachine) -CFLAGS += -DPC_HOSTED -DSTLINKV2 -DJTAG_HL -DENABLE_DEBUG +CFLAGS += -DPC_HOSTED -DNO_LIBOPENCM3 -DSTLINKV2 -DJTAG_HL -DENABLE_DEBUG CFLAGS +=-I ./target LDFLAGS += -lusb-1.0 ifneq (, $(findstring mingw, $(SYS)))