From 16eb41267bca46544136d4adbb9c27aa1a1625b6 Mon Sep 17 00:00:00 2001 From: Piotr Esden-Tempski Date: Thu, 17 Oct 2024 15:18:13 -0700 Subject: [PATCH] make: Removed the make build system as it was replaced with meson. We now have used meson to build BlackMagic for a while and it has proven to work well in the field. Make build system started breaking and needing maintainance effort so we decided to remove it. --- .gitmodules | 5 - Makefile | 39 --- deps/libopencm3 | 1 - src/Makefile | 305 ------------------ src/platforms/96b_carbon/Makefile.inc | 27 -- src/platforms/blackpill-f401cc/Makefile.inc | 3 - src/platforms/blackpill-f401ce/Makefile.inc | 3 - src/platforms/blackpill-f411ce/Makefile.inc | 3 - src/platforms/common/Makefile.inc | 31 -- .../common/blackpill-f4/Makefile.inc | 99 ------ src/platforms/ctxlink/Makefile.inc | 49 --- src/platforms/f072/Makefile.inc | 35 -- src/platforms/f3/Makefile.inc | 36 --- src/platforms/f4discovery/Makefile.inc | 47 --- src/platforms/hosted/Makefile.inc | 167 ---------- src/platforms/hydrabus/Makefile.inc | 34 -- src/platforms/launchpad-icdi/Makefile.inc | 24 -- src/platforms/native/Makefile.inc | 57 ---- src/platforms/stlink/Makefile.inc | 92 ------ src/platforms/stlinkv3/Makefile.inc | 81 ----- src/platforms/swlink/Makefile.inc | 57 ---- 21 files changed, 1195 deletions(-) delete mode 100644 .gitmodules delete mode 100644 Makefile delete mode 160000 deps/libopencm3 delete mode 100644 src/Makefile delete mode 100644 src/platforms/96b_carbon/Makefile.inc delete mode 100644 src/platforms/blackpill-f401cc/Makefile.inc delete mode 100644 src/platforms/blackpill-f401ce/Makefile.inc delete mode 100644 src/platforms/blackpill-f411ce/Makefile.inc delete mode 100644 src/platforms/common/Makefile.inc delete mode 100644 src/platforms/common/blackpill-f4/Makefile.inc delete mode 100644 src/platforms/ctxlink/Makefile.inc delete mode 100644 src/platforms/f072/Makefile.inc delete mode 100644 src/platforms/f3/Makefile.inc delete mode 100644 src/platforms/f4discovery/Makefile.inc delete mode 100644 src/platforms/hosted/Makefile.inc delete mode 100644 src/platforms/hydrabus/Makefile.inc delete mode 100644 src/platforms/launchpad-icdi/Makefile.inc delete mode 100644 src/platforms/native/Makefile.inc delete mode 100644 src/platforms/stlink/Makefile.inc delete mode 100644 src/platforms/stlinkv3/Makefile.inc delete mode 100644 src/platforms/swlink/Makefile.inc diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 9a874cc4f17..00000000000 --- a/.gitmodules +++ /dev/null @@ -1,5 +0,0 @@ -[submodule "libopencm3"] - path = deps/libopencm3 - url = https://github.com/blackmagic-debug/libopencm3 - branch = main - ignore = dirty diff --git a/Makefile b/Makefile deleted file mode 100644 index f737acaeff0..00000000000 --- a/Makefile +++ /dev/null @@ -1,39 +0,0 @@ -ifneq ($(V), 1) -MFLAGS += --no-print-dir -Q := @ -endif - -CONFIG_BMDA = -NO_LIBOPENCM3 = -ifeq ($(PROBE_HOST), hosted) - CONFIG_BMDA = true - NO_LIBOPENCM3 = true -endif - -all: -ifndef NO_LIBOPENCM3 - $(Q)if [ ! -f deps/libopencm3/Makefile ]; then \ - echo "Initialising git submodules..." ;\ - git submodule update --init ;\ - fi - $(Q)$(MAKE) $(MFLAGS) -C deps/libopencm3 lib/stm32/f1 lib/stm32/f4 lib/stm32/f7 lib/lm4f -endif - $(Q)$(MAKE) $(MFLAGS) -C src - -all_platforms: - $(Q)$(MAKE) $(MFLAGS) -C src $@ - -clean: -ifndef NO_LIBOPENCM3 - $(Q)$(MAKE) $(MFLAGS) -C deps/libopencm3 $@ -endif - $(Q)$(MAKE) $(MFLAGS) -C src $@ - -clang-tidy: SYSTEM_INCLUDE_PATHS=$(shell pkg-config --silence-errors --cflags libusb-1.0 libftdi1) -clang-tidy: - $(Q)scripts/run-clang-tidy.py -s "$(PWD)" $(SYSTEM_INCLUDE_PATHS) - -clang-format: - $(Q)$(MAKE) $(MFLAGS) -C src $@ - -.PHONY: clean all_platforms clang-tidy clang-format diff --git a/deps/libopencm3 b/deps/libopencm3 deleted file mode 160000 index 74413d9ed0e..00000000000 --- a/deps/libopencm3 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 74413d9ed0ee3726f35b8675927c43d33e3ef92b diff --git a/src/Makefile b/src/Makefile deleted file mode 100644 index 43a4d4da102..00000000000 --- a/src/Makefile +++ /dev/null @@ -1,305 +0,0 @@ -PROBE_HOST ?= native -PLATFORM_DIR = platforms/$(PROBE_HOST) -VPATH += $(PLATFORM_DIR) target -ENABLE_DEBUG ?= 0 -ENABLE_CORTEXAR ?= 0 -ENABLE_RISCV ?= 0 -ENABLE_ARTERY ?= 0 -ENABLE_CH579 ?= 0 -ENABLE_PUYA ?= 0 -ENABLE_XILINX ?= 0 -ENABLE_RISCV_ACCEL ?= 0 - -SYS = $(shell $(CC) -dumpmachine) - -ifneq ($(V), 1) -MAKEFLAGS += --no-print-dir -Q := @ -endif - -CFLAGS += -Wall -Wextra -Werror -Wreturn-type \ - -Wno-char-subscripts \ - -std=c11 -g3 -MD -I./target \ - -I. -Iinclude -I$(PLATFORM_DIR) - -ifeq (filter, macosx darwin, $(SYS)) -CFLAGS += -Wmaybe-uninitialized -Wstringop-overflow -Wunsafe-loop-optimizations -endif - -ifeq ($(PROBE_HOST),hosted) -ENABLE_DEBUG := 1 -endif - -ifeq ($(ENABLE_DEBUG), 1) -CFLAGS += -DENABLE_DEBUG=1 -else -CFLAGS += -DENABLE_DEBUG=0 -endif - -SRC = \ - adi.c \ - adiv5.c \ - adiv5_jtag.c \ - adiv5_swd.c \ - apollo3.c \ - adiv6.c \ - command.c \ - cortex.c \ - cortexm.c \ - crc32.c \ - efm32.c \ - exception.c \ - gdb_main.c \ - gdb_packet.c \ - gdb_reg.c \ - hex_utils.c \ - hc32l110.c \ - imxrt.c \ - jtag_devs.c \ - jtag_scan.c \ - lmi.c \ - lpc_common.c \ - lpc11xx.c \ - lpc17xx.c \ - lpc15xx.c \ - lpc40xx.c \ - lpc43xx.c \ - lpc546xx.c \ - lpc55xx.c \ - kinetis.c \ - main.c \ - maths_utils.c \ - morse.c \ - msp432e4.c \ - msp432p4.c \ - nrf51.c \ - nrf91.c \ - nxpke04.c \ - remote.c \ - rp2040.c \ - rp2350.c \ - sam3x.c \ - sam4l.c \ - samd.c \ - samx5x.c \ - semihosting.c \ - sfdp.c \ - spi.c \ - s32k3xx.c \ - stm32f1.c \ - ch32f1.c \ - stm32f4.c \ - stm32h5.c \ - stm32h7.c \ - stm32mp15.c \ - stm32l0.c \ - stm32l4.c \ - stm32g0.c \ - stm32wb0.c \ - stm32_common.c \ - renesas_ra.c \ - target.c \ - target_flash.c \ - target_probe.c - -ifneq ($(PROBE_HOST), ctxLink) - SRC += gdb_if.c -endif - -# Check if the old name for the SWO encoding setting has been used -ifdef TRACESWO_PROTOCOL - $(warning the TRACESWO_PROTOCOL variable is deprecated, please use SWO_ENCODING instead) - SWO_ENCODING = $(TRACESWO_PROTOCOL) -endif - -ifeq (,$(filter all_platforms,$(MAKECMDGOALS))) -include $(PLATFORM_DIR)/Makefile.inc -endif - -ifeq ($(ENABLE_PUYA), 1) -SRC += \ - puya.c -endif - -ifeq ($(ENABLE_CH579), 1) -SRC += \ - ch579.c -endif - -ifeq ($(ENABLE_ARTERY), 1) -SRC += \ - at32f43x.c -endif - -ifeq ($(ENABLE_CORTEXAR), 1) -CFLAGS += -DCONFIG_CORTEXAR=1 -SRC += \ - cortexar.c \ - renesas_rz.c - -ifeq ($(ENABLE_XILINX), 1) -CFLAGS += -DCONFIG_XILINX=1 -SRC += \ - zynq7000.c -endif -endif - -ifeq ($(ENABLE_RISCV), 1) -CFLAGS += -DCONFIG_RISCV=1 -SRC += \ - riscv32.c \ - riscv64.c \ - riscv_debug.c \ - riscv_adi_dtm.c \ - riscv_jtag_dtm.c -else ifeq ($(ENABLE_RISCV_ACCEL), 1) -CFLAGS += -DCONFIG_RISCV_ACCEL=1 -SRC += \ - riscv_jtag_dtm.c -endif - -ifneq ($(CONFIG_BMDA),1) -# Output memory usage information -LDFLAGS += -Wl,--print-memory-usage -endif - -OPT_FLAGS ?= -Os -CFLAGS += $(OPT_FLAGS) -LDFLAGS += $(OPT_FLAGS) - -ifndef TARGET -ifdef CONFIG_BMDA -TARGET = blackmagic -else -TARGET = blackmagic.elf -endif -endif - -ifdef NO_OWN_LL -SRC += jtagtap_generic.c swdptap_generic.c -endif - -ifdef CONFIG_BMDA -CFLAGS += -DCONFIG_BMDA=1 -else -CFLAGS += -DCONFIG_BMDA=0 -include platforms/common/Makefile.inc -endif - -ifeq ($(ENABLE_RTT), 1) -CFLAGS += -DENABLE_RTT -SRC += rtt.c rtt_if.c -endif - -ifdef RTT_IDENT -CFLAGS += -DRTT_IDENT=$(RTT_IDENT) -endif - -ifeq ($(ADVERTISE_NOACKMODE), 1) -CFLAGS += -DADVERTISE_NOACKMODE=1 -else -CFLAGS += -DADVERTISE_NOACKMODE=0 -endif - -OBJ = $(patsubst %.S,%.o,$(patsubst %.c,%.o,$(SRC))) - -$(TARGET): include/version.h $(OBJ) - @echo " LD $@" - $(Q)$(CC) -o $@ $(OBJ) $(LDFLAGS) - -%.o: %.c - @echo " CC $<" - $(Q)$(CC) $(CFLAGS) -c $< -o $@ - -%.o: %.S - @echo " AS $<" - $(Q)$(CC) $(CFLAGS) -c $< -o $@ - -ifndef CONFIG_BMDA -%.bin: %.elf - @echo " OBJCOPY $@" - $(Q)$(OBJCOPY) -O binary $^ $@ - -%.hex: %.elf - @echo " OBJCOPY $@" - $(Q)$(OBJCOPY) -O ihex $^ $@ -endif - -.PHONY: clean host_clean all_platforms clang-format FORCE - - -GIT_VERSION := $(shell if [ -e "../.git" ]; then git describe --always --dirty --tags; fi) - -clean: host_clean - $(Q)echo " CLEAN" - -$(Q)$(RM) *.o *.d *.elf *~ $(TARGET) $(HOSTFILES) - -$(Q)$(RM) platforms/*/*.o platforms/*/*.d mapfile ftd2xx.dll -ifeq ($(GIT_VERSION),) - @echo Git not found, not deleting include/version.h -else - -$(Q)$(RM) include/version.h -endif - -all_platforms: - $(Q)if [ ! -f ../deps/libopencm3/Makefile ]; then \ - echo "Initialising git submodules..." ;\ - git submodule update --init ;\ - fi - $(Q)$(MAKE) $(MFLAGS) -C ../deps/libopencm3 lib/stm32/f1 lib/stm32/f4 lib/stm32/f7 lib/lm4f - $(Q)set -e ;\ - mkdir -p artifacts/$(shell git describe --always --dirty --tags) ;\ - echo "" >> artifacts/index.html ;\ - cp artifacts/blackmagic* artifacts/$(shell git describe --always --dirty --tags) - -command.c: include/version.h - -VERSION_HEADER := \#define FIRMWARE_VERSION "$(GIT_VERSION)" - -include/version.h: FORCE - @# If git isn't found then GIT_VERSION will be an empty string. -ifeq ($(GIT_VERSION),) - @echo Git not found, assuming up to date include/version.h -else - @# Note that when we echo the version to the header file, echo writes a final newline - @# to the file. This is fine and probably makes the file more human-readable, but - @# also means we have to account for that newline in this comparison. - $(Q)if [ ! -f $@ ] || [ "$$(cat $@)" != "$$(echo '$(VERSION_HEADER)\n')" ]; then \ - echo " GEN $@"; \ - echo '$(VERSION_HEADER)' > $@; \ - fi -endif - -clang-format: - $(Q)clang-format -i *.c */*.c */*/*.c *.h */*.h */*/*.h - -ifeq (,$(filter clean,$(MAKECMDGOALS))) --include *.d -endif diff --git a/src/platforms/96b_carbon/Makefile.inc b/src/platforms/96b_carbon/Makefile.inc deleted file mode 100644 index 97549572fb3..00000000000 --- a/src/platforms/96b_carbon/Makefile.inc +++ /dev/null @@ -1,27 +0,0 @@ -CROSS_COMPILE ?= arm-none-eabi- -CC = $(CROSS_COMPILE)gcc -OBJCOPY = $(CROSS_COMPILE)objcopy - -CFLAGS += -Istm32/include -mcpu=cortex-m4 -mthumb \ - -mfloat-abi=hard -mfpu=fpv4-sp-d16 \ - -DSTM32F4 -D_96B_CARBON -I../deps/libopencm3/include \ - -Iplatforms/common/stm32 -DDFU_SERIAL_LENGTH=9 - -LDFLAGS = -lopencm3_stm32f4 -Lplatforms/96b_carbon \ - -T96b_carbon.ld -nostartfiles -lc -lnosys \ - -Wl,-Map=mapfile -mthumb -mcpu=cortex-m4 -Wl,-gc-sections \ - -mfloat-abi=hard -mfpu=fpv4-sp-d16 \ - -L../deps/libopencm3/lib - -VPATH += platforms/common/stm32 - -SRC += \ - platform.c \ - serialno.c \ - timing.c \ - timing_stm32.c - -all: blackmagic.bin - -host_clean: - -$(Q)$(RM) blackmagic.bin diff --git a/src/platforms/blackpill-f401cc/Makefile.inc b/src/platforms/blackpill-f401cc/Makefile.inc deleted file mode 100644 index cc505a7eb8a..00000000000 --- a/src/platforms/blackpill-f401cc/Makefile.inc +++ /dev/null @@ -1,3 +0,0 @@ -LINKER_SCRIPT=blackpill-f401cc.ld - -include platforms/common/blackpill-f4/Makefile.inc diff --git a/src/platforms/blackpill-f401ce/Makefile.inc b/src/platforms/blackpill-f401ce/Makefile.inc deleted file mode 100644 index 9b9b6f3f876..00000000000 --- a/src/platforms/blackpill-f401ce/Makefile.inc +++ /dev/null @@ -1,3 +0,0 @@ -LINKER_SCRIPT=blackpill-f401ce.ld - -include platforms/common/blackpill-f4/Makefile.inc diff --git a/src/platforms/blackpill-f411ce/Makefile.inc b/src/platforms/blackpill-f411ce/Makefile.inc deleted file mode 100644 index 7bac3ed4a18..00000000000 --- a/src/platforms/blackpill-f411ce/Makefile.inc +++ /dev/null @@ -1,3 +0,0 @@ -LINKER_SCRIPT=blackpill-f411ce.ld - -include platforms/common/blackpill-f4/Makefile.inc diff --git a/src/platforms/common/Makefile.inc b/src/platforms/common/Makefile.inc deleted file mode 100644 index 7ee5925a115..00000000000 --- a/src/platforms/common/Makefile.inc +++ /dev/null @@ -1,31 +0,0 @@ -# -# This file is part of the Black Magic Debug project. -# -# Copyright (C) 2022 1BitSquared -# Written by Rachel Mant -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# - -VPATH += platforms/common -CFLAGS += -Iplatforms/common - -SRC += \ - jtagtap.c \ - swdptap.c \ - usb.c \ - usb_serial.c \ - usb_dfu_stub.c \ - aux_serial.c \ - syscalls.c diff --git a/src/platforms/common/blackpill-f4/Makefile.inc b/src/platforms/common/blackpill-f4/Makefile.inc deleted file mode 100644 index 086e1b21608..00000000000 --- a/src/platforms/common/blackpill-f4/Makefile.inc +++ /dev/null @@ -1,99 +0,0 @@ -CROSS_COMPILE ?= arm-none-eabi- -BMD_BOOTLOADER ?= -CC = $(CROSS_COMPILE)gcc -OBJCOPY = $(CROSS_COMPILE)objcopy - -CFLAGS += \ - -Istm32/include \ - -mcpu=cortex-m4 \ - -mthumb \ - -mfloat-abi=hard \ - -mfpu=fpv4-sp-d16 \ - -DSTM32F4 \ - -DDFU_SERIAL_LENGTH=13 \ - -I../deps/libopencm3/include \ - -Iplatforms/common/stm32 \ - -Iplatforms/common/blackpill-f4 - -LDFLAGS_BOOT := \ - -lopencm3_stm32f4 \ - -Lplatforms/common/blackpill-f4 \ - -T$(LINKER_SCRIPT) \ - -nostartfiles \ - -lc \ - -Wl,-Map=mapfile \ - -mthumb \ - -mcpu=cortex-m4 \ - -Wl,-gc-sections \ - -mfloat-abi=hard \ - -mfpu=fpv4-sp-d16 \ - -L../deps/libopencm3/lib - -ifeq ($(BMD_BOOTLOADER), 1) -$(info Load address 0x08004000 for BMPBootloader) -LDFLAGS = $(LDFLAGS_BOOT) -Wl,-Ttext=0x8004000 -CFLAGS += -DAPP_START=0x08004000 -DBMD_BOOTLOADER -else -LDFLAGS = $(LDFLAGS_BOOT) -endif - -ifdef ALTERNATIVE_PINOUT -CFLAGS += -DALTERNATIVE_PINOUT=$(ALTERNATIVE_PINOUT) -endif - -ifdef SHIELD -CFLAGS += -DSHIELD=$(SHIELD) -endif - -ifeq ($(ENABLE_DEBUG), 1) -LDFLAGS += --specs=rdimon.specs -else -LDFLAGS += --specs=nosys.specs -endif - -VPATH += \ - platforms/common/stm32 \ - platforms/common/blackpill-f4 - -SRC += \ - blackpill-f4.c \ - serialno.c \ - timing.c \ - timing_stm32.c \ - swo.c \ - swo_itm_decode.c - -# If SWO_ENCODING has not been given, default it to including both modes -ifndef SWO_ENCODING - SWO_ENCODING = 3 -endif - -# Include the files for either: Manchester-only (1), UART-only (2) or both modes (3) -ifeq ($(SWO_ENCODING), 1) - SRC += swo_manchester.c -else ifeq ($(SWO_ENCODING), 2) - SRC += swo_uart.c -else ifeq ($(SWO_ENCODING), 3) - SRC += \ - swo_manchester.c \ - swo_uart.c -else # If we got some other value, that's an error so report it - $(error Invalid value for SWO encoding, must be one of 1, 2, or 3) -endif -CFLAGS += -DSWO_ENCODING=$(SWO_ENCODING) - -ifneq ($(BMD_BOOTLOADER), 1) -all: blackmagic.bin -else -all: blackmagic.bin blackmagic_dfu.bin blackmagic_dfu.hex -blackmagic_dfu: usbdfu.o dfucore.o dfu_f4.o serialno.o - $(CC) $^ -o $@ $(LDFLAGS_BOOT) --specs=nosys.specs - -blackmagic_dfu.bin: blackmagic_dfu - $(OBJCOPY) -O binary $^ $@ - -blackmagic_dfu.hex: blackmagic_dfu - $(OBJCOPY) -O ihex $^ $@ -endif -host_clean: - -$(Q)$(RM) blackmagic.bin diff --git a/src/platforms/ctxlink/Makefile.inc b/src/platforms/ctxlink/Makefile.inc deleted file mode 100644 index 053beb32881..00000000000 --- a/src/platforms/ctxlink/Makefile.inc +++ /dev/null @@ -1,49 +0,0 @@ -CROSS_COMPILE ?= arm-none-eabi- -CC = $(CROSS_COMPILE)gcc -OBJCOPY = $(CROSS_COMPILE)objcopy - -CFLAGS += -Istm32/include -mcpu=cortex-m4 -mthumb \ - -mfloat-abi=hard -mfpu=fpv4-sp-d16 \ - -DSTM32F4 -DCTX_LINK -DDFU_SERIAL_LENGTH=13 -I../deps/libopencm3/include \ - -Iplatforms/common/stm32 - -LDFLAGS = -lopencm3_stm32f4 \ - -Tctxlink.ld -nostartfiles -lc -lnosys \ - -Lplatforms/ctxlink \ - -Wl,-Map=mapfile -mthumb -mcpu=cortex-m4 -Wl,-gc-sections \ - -mfloat-abi=hard -mfpu=fpv4-sp-d16 \ - -L../deps/libopencm3/lib - -VPATH += platforms/common/stm32 - -SRC += \ - platform.c \ - serialno.c \ - timing.c \ - timing_stm32.c \ - swo.c \ - swo_itm_decode.c - -# If SWO_ENCODING has not been given, default it to including both modes -ifndef SWO_ENCODING - SWO_ENCODING = 3 -endif - -# Include the files for either: Manchester-only (1), UART-only (2) or both modes (3) -ifeq ($(SWO_ENCODING), 1) - SRC += swo_manchester.c -else ifeq ($(SWO_ENCODING), 2) - SRC += swo_uart.c -else ifeq ($(SWO_ENCODING), 3) - SRC += \ - swo_manchester.c \ - swo_uart.c -else # If we got some other value, that's an error so report it - $(error Invalid value for SWO encoding, must be one of 1, 2, or 3) -endif -CFLAGS += -DSWO_ENCODING=$(SWO_ENCODING) - -all: blackmagic.bin - -host_clean: - -$(Q)$(RM) blackmagic.bin diff --git a/src/platforms/f072/Makefile.inc b/src/platforms/f072/Makefile.inc deleted file mode 100644 index 9878e486559..00000000000 --- a/src/platforms/f072/Makefile.inc +++ /dev/null @@ -1,35 +0,0 @@ -CROSS_COMPILE ?= arm-none-eabi- -CC = $(CROSS_COMPILE)gcc -OBJCOPY = $(CROSS_COMPILE)objcopy - -CFLAGS += -Istm32/include -mcpu=cortex-m0 -mthumb \ - -DSTM32F0 -I../deps/libopencm3/include \ - -DDFU_SERIAL_LENGTH=13 -Iplatforms/common/stm32 - -LDFLAGS = -lopencm3_stm32f0 -Lplatforms/f072 \ - -Tstm32f07xzb.ld --specs=nano.specs \ - -nostartfiles -lc -lnosys -Wl,-Map=mapfile -mthumb \ - -mcpu=cortex-m0 -Wl,-gc-sections -L../deps/libopencm3/lib - -VPATH += platforms/common/stm32 - -SRC += \ - platform.c \ - atomic.c \ - serialno.c \ - timing.c \ - timing_stm32.c \ - swo.c \ - swo_manchester.c \ - swo_itm_decode.c - -all: blackmagic.bin -blackmagic.elf: libopencm3_stm32f0 - -libopencm3_stm32f0: - $(Q)$(MAKE) $(MFLAGS) -C ../deps/libopencm3 lib/stm32/f0 - -host_clean: - -$(Q)$(RM) blackmagic.bin - -.PHONY: libopencm3_stm32f0 diff --git a/src/platforms/f3/Makefile.inc b/src/platforms/f3/Makefile.inc deleted file mode 100644 index 95fbda10181..00000000000 --- a/src/platforms/f3/Makefile.inc +++ /dev/null @@ -1,36 +0,0 @@ -CROSS_COMPILE ?= arm-none-eabi- -CC = $(CROSS_COMPILE)gcc -OBJCOPY = $(CROSS_COMPILE)objcopy - -CFLAGS += -Istm32/include -mcpu=cortex-m4 -mthumb \ - -mfloat-abi=hard -mfpu=fpv4-sp-d16 \ - -DSTM32F3 -I../deps/libopencm3/include \ - -DDFU_SERIAL_LENGTH=13 -Iplatforms/common/stm32 - -LDFLAGS = --specs=nano.specs -lopencm3_stm32f3 -Lplatforms/f3 \ - -Tstm32f303xc.ld -nostartfiles -lc -lnosys \ - -Wl,-Map=mapfile -mthumb -mcpu=cortex-m4 -Wl,-gc-sections \ - -mfloat-abi=hard -mfpu=fpv4-sp-d16 \ - -L../deps/libopencm3/lib - -VPATH += platforms/common/stm32 - -SRC += \ - platform.c \ - serialno.c \ - timing.c \ - timing_stm32.c \ - swo.c \ - swo_manchester.c \ - swo_itm_decode.c - -all: blackmagic.bin -blackmagic.elf: libopencm3_stm32f3 - -libopencm3_stm32f3: - $(Q)$(MAKE) $(MFLAGS) -C ../deps/libopencm3 lib/stm32/f3 - -host_clean: - -$(Q)$(RM) blackmagic.bin - -.PHONY: libopencm3_stm32f3 diff --git a/src/platforms/f4discovery/Makefile.inc b/src/platforms/f4discovery/Makefile.inc deleted file mode 100644 index b12c8743992..00000000000 --- a/src/platforms/f4discovery/Makefile.inc +++ /dev/null @@ -1,47 +0,0 @@ -CROSS_COMPILE ?= arm-none-eabi- -BMP_BOOTLOADER ?= -CC = $(CROSS_COMPILE)gcc -OBJCOPY = $(CROSS_COMPILE)objcopy - -CFLAGS += -Istm32/include -mcpu=cortex-m4 -mthumb \ - -mfloat-abi=hard -mfpu=fpv4-sp-d16 \ - -DSTM32F4 -I../deps/libopencm3/include \ - -Iplatforms/common/stm32 - -LDFLAGS_BOOT = -lopencm3_stm32f4 -Lplatforms/f4discovery \ - -Tf4discovery.ld -nostartfiles -lc -lnosys \ - -Wl,-Map=mapfile -mthumb -mcpu=cortex-m4 -Wl,-gc-sections \ - -mfloat-abi=hard -mfpu=fpv4-sp-d16 \ - -L../deps/libopencm3/lib - -ifeq ($(BMP_BOOTLOADER), 1) -$(info Load address 0x08004000 for BMPBootloader) -LDFLAGS = $(LDFLAGS_BOOT) -Wl,-Ttext=0x8004000 -CFLAGS += -DDFU_SERIAL_LENGTH=9 -else -LDFLAGS += $(LDFLAGS_BOOT) -CFLAGS += -DDFU_SERIAL_LENGTH=13 -endif - -VPATH += platforms/common/stm32 - -SRC += \ - platform.c \ - serialno.c \ - timing.c \ - timing_stm32.c \ - swo.c \ - swo_manchester.c \ - swo_itm_decode.c - -ifneq ($(BMP_BOOTLOADER), 1) -all: blackmagic.bin -else -all: blackmagic.bin blackmagic_dfu.bin blackmagic_dfu.hex -blackmagic_dfu.elf: usbdfu.o dfucore.o dfu_f4.o serialno.o - @echo " LD $@" - $(Q)$(CC) $^ -o $@ $(LDFLAGS_BOOT) -endif - -host_clean: - -$(Q)$(RM) blackmagic.bin diff --git a/src/platforms/hosted/Makefile.inc b/src/platforms/hosted/Makefile.inc deleted file mode 100644 index dc4087237d0..00000000000 --- a/src/platforms/hosted/Makefile.inc +++ /dev/null @@ -1,167 +0,0 @@ -ifeq ($(origin CC),default) - CC := gcc -endif -SYS := $(shell $(CC) -dumpmachine) -CFLAGS += -DPLATFORM_HAS_DEBUG -CFLAGS +=-I ./target - -# Architecture enables -ENABLE_CORTEXAR := 1 -CONFIG_RISCV := 1 -# Target enables -ENABLE_ARTERY := 1 -ENABLE_CH579 := 1 -ENABLE_PUYA := 1 -ENABLE_XILINX := 1 - -# Clang requires some special handling here: -gnu means MinGW -# while -msvc means Clang/CL. We don't currently support the latter -# and we need the former to fit the formula of `x86_64-w64-mingw32` -# and friends so we correctly trigger the MinGW block below. -ifeq ($(SYS),x86_64-w64-windows-gnu) - SYS := x86_64-clang64-mingw -endif - -# HOSTED_BMP_ONLY, which defaults to 1 on Windows + MacOS and 0 on Linux, -# defines whether to build Black Magic Debug App for the Black Magic Firmware -# only, or whether to include support for other adaptor types including FTDI, -# and CMSIS-DAP compatible dongles. -# -# The benefit of only building for the Black Magic Firmware is a reduced linking -# footprint. Specifically no requirement to link against libftdi1, libusb1, or -# hidapi (hidapi-hidraw on Linux). This makes building on Windows in particular easier. -ifneq (,$(findstring linux, $(SYS))) - HOSTED_BMP_ONLY ?= 0 -else - HOSTED_BMP_ONLY ?= 1 -endif -CFLAGS += -DHOSTED_BMP_ONLY=$(HOSTED_BMP_ONLY) -D_FILE_OFFSET_BITS=64 - -ifeq ($(ASAN), 1) - CFLAGS += -fsanitize=address - ifeq (, $(findstring darwin,$(SYS))) - CFLAGS += -Wno-format-truncation - endif - LDFLAGS += -fsanitize=address - OPT_FLAGS += -g -endif - -HIDAPILIB = hidapi -ifneq (,$(findstring linux,$(SYS))) - SRC += serial_unix.c - HIDAPILIB = hidapi-hidraw -else ifneq (,$(findstring freebsd,$(SYS))) - # On FreeBSD, only the hidapi on libusb-1.0 variant exists - SRC += serial_unix.c - HIDAPILIB = hidapi -else ifneq (,$(findstring mingw,$(SYS))) - FLAVOUR = $(shell which $(CC)) - ifneq (,$(findstring ucrt64,$(FLAVOUR))) - CFLAGS += -mcrtdll=ucrt - LDFLAGS += -mcrtdll=ucrt - else ifneq (,$(findstring clang,$(FLAVOUR))) - else - CFLAGS += -mcrtdll=msvcrt - LDFLAGS += -mcrtdll=msvcrt - endif - - # Build for windows versions Vista, and above, where the - # 'SetupDiGetDevicePropertyW()' function is available - CFLAGS += -D_WIN32_WINNT=0x600 - SRC += serial_win.c - LDFLAGS += -lws2_32 -lsetupapi -else ifneq (,$(findstring cygwin,$(SYS))) - # Build for windows versions Vista, and above, where the - # 'SetupDiGetDevicePropertyW()' function is available - CFLAGS += -D_WIN32_WINNT=0x600 - SRC += serial_win.c - LDFLAGS += -lws2_32 -lsetupapi -# https://github.com/dmlc/xgboost/issues/1945 indicates macosx as indicator -else ifneq (filter, macosx darwin, $(SYS)) - SRC += serial_unix.c - LDFLAGS += -framework CoreFoundation - CFLAGS += -I /opt/homebrew/include -I /opt/homebrew/include/libusb-1.0 -endif - -# If we're on Windows, pick the correct FTD2xx implementation -ifeq ($(OS), Windows_NT) - ifneq ($(HOSTED_BMP_ONLY), 1) - VPATH += platforms/hosted/windows - CFLAGS += -I../3rdparty/ftdi -Iplatforms/hosted/windows - ifeq ($(PROCESSOR_ARCHITECTURE), AMD64) - LDFLAGS += ../3rdparty/ftdi/amd64/ftd2xx.lib - FTDI_DLL = ../3rdparty/ftdi/amd64/ftd2xx.dll - else - LDFLAGS += ../3rdparty/ftdi/i386/ftd2xx.lib - FTDI_DLL = ../3rdparty/ftdi/i386/ftd2xx.dll - endif - endif -endif - -ifneq ($(HOSTED_BMP_ONLY), 1) - ifneq ($(shell pkg-config --exists libusb-1.0; echo $$?), 0) - $(error Please install libusb-1.0 dependency or set HOSTED_BMP_ONLY to 1) - endif - ifneq ($(OS), Windows_NT) - ifneq ($(shell pkg-config --exists libftdi1; echo $$?), 0) - $(error Please install libftdi1 dependency or set HOSTED_BMP_ONLY to 1) - endif - CFLAGS += $(shell pkg-config --cflags libftdi1) - LDFLAGS += $(shell pkg-config --libs libftdi1) - endif - CFLAGS += $(shell pkg-config --cflags libusb-1.0) - LDFLAGS += $(shell pkg-config --libs libusb-1.0) - CFLAGS += -Wno-missing-field-initializers -endif - -ifneq ($(HOSTED_BMP_ONLY), 1) - SRC += cmsis_dap.c dap.c dap_command.c dap_swd.c dap_jtag.c - ifneq ($(shell pkg-config --exists $(HIDAPILIB); echo $$?), 0) - $(error Please install $(HIDAPILIB) dependency or set HOSTED_BMP_ONLY to 1) - endif - CFLAGS += $(shell pkg-config --cflags $(HIDAPILIB)) - LDFLAGS += $(shell pkg-config --libs $(HIDAPILIB)) -endif - -ifeq ($(ENABLE_GPIOD), 1) - SRC += bmda_gpiod.c - SRC += platforms/common/jtagtap.c platforms/common/swdptap.c - ifneq ($(shell pkg-config --exists libgpiod; echo $$?), 0) - $(error Please install libgpiod dependency or drop ENABLE_GPIOD=1) - endif - CFLAGS += $(shell pkg-config --cflags libgpiod) - LDFLAGS += $(shell pkg-config --libs libgpiod) - CFLAGS += -DENABLE_GPIOD=1 -endif - -VPATH += platforms/hosted/remote - -SRC += platform.c -SRC += timing.c cli.c utils.c probe_info.c debug.c -SRC += protocol_v0.c protocol_v0_swd.c protocol_v0_jtag.c protocol_v0_adiv5.c -SRC += protocol_v1.c protocol_v1_adiv5.c protocol_v2.c -SRC += protocol_v3.c protocol_v3_adiv5.c -SRC += protocol_v4.c protocol_v4_adiv5.c protocol_v4_adiv6.c protocol_v4_riscv.c -SRC += bmp_remote.c -ifneq ($(HOSTED_BMP_ONLY), 1) - ifeq ($(OS), Windows_NT) - SRC += ftd2xx.dll ftdi.c - endif - SRC += bmp_libusb.c stlinkv2.c stlinkv2_jtag.c stlinkv2_swd.c - SRC += ftdi_bmp.c ftdi_jtag.c ftdi_swd.c - SRC += jlink.c jlink_jtag.c jlink_swd.c -else - SRC += bmp_serial.c -endif -CONFIG_BMDA = 1 - -all: blackmagic - -ifeq ($(OS), Windows_NT) -.PHONY: ftd2xx.dll - -ftd2xx.dll: - cp $(FTDI_DLL) ../src -endif -host_clean: - -$(Q)$(RM) blackmagic diff --git a/src/platforms/hydrabus/Makefile.inc b/src/platforms/hydrabus/Makefile.inc deleted file mode 100644 index a2f7c66d193..00000000000 --- a/src/platforms/hydrabus/Makefile.inc +++ /dev/null @@ -1,34 +0,0 @@ -CROSS_COMPILE ?= arm-none-eabi- -CC = $(CROSS_COMPILE)gcc -OBJCOPY = $(CROSS_COMPILE)objcopy - -CFLAGS += -Istm32/include -mcpu=cortex-m4 -mthumb \ - -mfloat-abi=hard -mfpu=fpv4-sp-d16 \ - -DSTM32F4 -I../deps/libopencm3/include \ - -Iplatforms/common/stm32 -DDFU_SERIAL_LENGTH=9 - -LDFLAGS = -lopencm3_stm32f4 -Lplatforms/hydrabus \ - -Thydrabus.ld -nostartfiles -lc -lnosys \ - -Wl,-Map=mapfile -mthumb -mcpu=cortex-m4 -Wl,-gc-sections \ - -mfloat-abi=hard -mfpu=fpv4-sp-d16 \ - -L../deps/libopencm3/lib - -VPATH += platforms/common/stm32 - -SRC += \ - platform.c \ - serialno.c \ - timing.c \ - timing_stm32.c \ - swo.c \ - swo_manchester.c \ - swo_itm_decode.c - -all: blackmagic.bin blackmagic.hex - -blackmagic.dfu: blackmagic.hex - @echo Creating $@ - @python3 ../scripts/dfu-convert.py -i $< $@ - -host_clean: - -$(Q)$(RM) blackmagic.bin blackmagic.hex blackmagic.dfu diff --git a/src/platforms/launchpad-icdi/Makefile.inc b/src/platforms/launchpad-icdi/Makefile.inc deleted file mode 100644 index 7d378d25128..00000000000 --- a/src/platforms/launchpad-icdi/Makefile.inc +++ /dev/null @@ -1,24 +0,0 @@ -CROSS_COMPILE ?= arm-none-eabi- -SERIAL_NO ?= 1 -CC = $(CROSS_COMPILE)gcc -OBJCOPY = $(CROSS_COMPILE)objcopy - -INCLUDES = -I../deps/libopencm3/include - -CPU_FLAGS = -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -CFLAGS += $(INCLUDES) $(CPU_FLAGS) -DSERIAL_NO=$(SERIAL_NO) -DTARGET_IS_BLIZZARD_RB1 -DLM4F -DPART_TM4C123GH6PM -CFLAGS += -DDFU_SERIAL_LENGTH=9 - -LDFLAGS = -lopencm3_lm4f -Lplatforms/launchpad-icdi \ - -Tlaunchpad-icdi.ld -nostartfiles -nodefaultlibs -lc \ - -lnosys -lm -lgcc -Wl,--gc-sections $(CPU_FLAGS) \ - -L../deps/libopencm3/lib - -VPATH += platforms/common/tm4c - -SRC += \ - platform.c \ - timing.c \ - swo_uart.o - -all: blackmagic.bin diff --git a/src/platforms/native/Makefile.inc b/src/platforms/native/Makefile.inc deleted file mode 100644 index 064d0bb141b..00000000000 --- a/src/platforms/native/Makefile.inc +++ /dev/null @@ -1,57 +0,0 @@ -CROSS_COMPILE ?= arm-none-eabi- -CC = $(CROSS_COMPILE)gcc -OBJCOPY = $(CROSS_COMPILE)objcopy - -CFLAGS += -Istm32/include -mcpu=cortex-m3 -mthumb \ - -DSTM32F1 -DBLACKMAGIC -I../deps/libopencm3/include \ - -Iplatforms/common/stm32 -DDFU_SERIAL_LENGTH=9 -DSWO_ENCODING=1 - -LDFLAGS_BOOT := $(LDFLAGS) -lopencm3_stm32f1 -Lplatforms/native \ - -Tnative.ld --specs=nano.specs -nostartfiles -lc \ - -Wl,-Map=mapfile -mthumb -mcpu=cortex-m3 -Wl,-gc-sections \ - -L../deps/libopencm3/lib -LDFLAGS = $(LDFLAGS_BOOT) -Wl,-Ttext=0x8002000 - -ifeq ($(ENABLE_DEBUG), 1) -LDFLAGS += --specs=rdimon.specs -else -LDFLAGS += --specs=nosys.specs -endif - -VPATH += platforms/common/stm32 - -SRC += \ - platform.c \ - serialno.c \ - timing.c \ - timing_stm32.c \ - swo.c \ - swo_itm_decode.c - -# If SWO_ENCODING has not been given, default it to including both modes -ifndef SWO_ENCODING - SWO_ENCODING = 3 -endif - -# Include the files for either: Manchester-only (1), UART-only (2) or both modes (3) -ifeq ($(SWO_ENCODING), 1) - SRC += swo_manchester.c -else ifeq ($(SWO_ENCODING), 2) - SRC += swo_uart.c -else ifeq ($(SWO_ENCODING), 3) - SRC += \ - swo_manchester.c \ - swo_uart.c -else # If we got some other value, that's an error so report it - $(error Invalid value for SWO encoding, must be one of 1, 2, or 3) -endif -CFLAGS += -DTRACESWO_PROTOCOL=$(SWO_ENCODING) - -all: blackmagic.bin blackmagic_dfu.bin blackmagic_dfu.hex - -blackmagic_dfu.elf: usbdfu.o dfucore.o dfu_f1.o serialno.o - @echo " LD $@" - $(Q)$(CC) $^ -o $@ $(LDFLAGS_BOOT) - -host_clean: - -$(Q)$(RM) blackmagic.bin blackmagic_dfu blackmagic_dfu.bin blackmagic_dfu.hex diff --git a/src/platforms/stlink/Makefile.inc b/src/platforms/stlink/Makefile.inc deleted file mode 100644 index e216831492b..00000000000 --- a/src/platforms/stlink/Makefile.inc +++ /dev/null @@ -1,92 +0,0 @@ -CROSS_COMPILE ?= arm-none-eabi- -ST_BOOTLOADER ?= -CC = $(CROSS_COMPILE)gcc -OBJCOPY = $(CROSS_COMPILE)objcopy - -CFLAGS += -mcpu=cortex-m3 -mthumb -DSTM32F1 -I../deps/libopencm3/include \ - -I platforms/common/stm32 -LDFLAGS_BOOT := $(LDFLAGS) -lopencm3_stm32f1 -Lplatforms/stlink \ - -Tstlink.ld --specs=nano.specs -nostartfiles -lc \ - -Wl,-Map=mapfile -mthumb -mcpu=cortex-m3 -Wl,-gc-sections \ - -L../deps/libopencm3/lib - -ifeq ($(ST_BOOTLOADER), 1) - $(info Load address 0x08004000 for original ST-LinkV2 Bootloader) - CFLAGS += -DST_BOOTLOADER -DDFU_SERIAL_LENGTH=25 - LDFLAGS = $(LDFLAGS_BOOT) -Wl,-Ttext=0x8004000 -else - CFLAGS += -DDFU_SERIAL_LENGTH=9 - LDFLAGS = $(LDFLAGS_BOOT) -Wl,-Ttext=0x8002000 -endif - -ifeq ($(ENABLE_DEBUG), 1) - LDFLAGS += --specs=rdimon.specs -else - LDFLAGS += --specs=nosys.specs -endif - -ifeq ($(SWIM_AS_UART), 1) - SWIM_NRST_AS_UART=1 - $(warning Deprecation: SWIM_AS_UART has been renamed to SWIM_NRST_AS_UART; it might be ignored in the future) -endif - -ifeq ($(SWIM_NRST_AS_UART), 1) - CFLAGS += -DSWIM_NRST_AS_UART=1 -else - # If SWO_ENCODING has not been given, default it to including both modes - ifndef SWO_ENCODING - SWO_ENCODING = 3 - endif - - # Include the base implementation and decoder - SRC += \ - swo.c \ - swo_itm_decode.c - - # Include the files for either: Manchester-only (1), UART-only (2) or both modes (3) - ifeq ($(SWO_ENCODING), 1) - SRC += swo_manchester.c - else ifeq ($(SWO_ENCODING), 2) - SRC += swo_uart.c - else ifeq ($(SWO_ENCODING), 3) - SRC += \ - swo_manchester.c \ - swo_uart.c - else # If we got some other value, that's an error so report it - $(error Invalid value for SWO encoding, must be one of 1, 2, or 3) - endif - CFLAGS += -DSWO_ENCODING=$(SWO_ENCODING) -endif - -ifeq ($(BLUEPILL), 1) - CFLAGS += -DBLUEPILL=1 -endif - -ifeq ($(STLINK_FORCE_CLONE), 1) - CFLAGS += -DSTLINK_FORCE_CLONE=1 -endif - -ifeq ($(STLINK_V2_ISOL), 1) - CFLAGS += -DSTLINK_V2_ISOL=1 -endif - -VPATH += platforms/common/stm32 - -SRC += \ - platform.c \ - serialno.c \ - timing.c \ - timing_stm32.c \ - stlink_common.c - -ifeq ($(ST_BOOTLOADER), 1) -all: blackmagic.bin -else -all: blackmagic.bin blackmagic_dfu.bin blackmagic_dfu.hex -endif -blackmagic_dfu.elf: usbdfu.o dfucore.o dfu_f1.o stlink_common.o serialno.o - @echo " LD $@" - $(Q)$(CC) $^ -o $@ $(LDFLAGS_BOOT) - -host_clean: - -$(Q)$(RM) *.bin *elf *hex diff --git a/src/platforms/stlinkv3/Makefile.inc b/src/platforms/stlinkv3/Makefile.inc deleted file mode 100644 index 3df3a5536d0..00000000000 --- a/src/platforms/stlinkv3/Makefile.inc +++ /dev/null @@ -1,81 +0,0 @@ -CROSS_COMPILE ?= arm-none-eabi- -CC = $(CROSS_COMPILE)gcc -OBJCOPY = $(CROSS_COMPILE)objcopy - -OPT_FLAGS = -Og -g -CFLAGS += -mcpu=cortex-m7 -mthumb -mfpu=fpv5-sp-d16 -mfloat-abi=hard \ - -DSTM32F7 -DDFU_SERIAL_LENGTH=25 -I../deps/libopencm3/include \ - -I platforms/common/stm32 -LDFLAGS_BOOT := $(LDFLAGS) -mfpu=fpv5-sp-d16 -mfloat-abi=hard \ - --specs=nano.specs -lopencm3_stm32f7 -Lplatforms/stlinkv3 \ - -Tstlinkv3.ld -nostartfiles -lc \ - -Wl,-Map=mapfile -mthumb -mcpu=cortex-m7 -Wl,-gc-sections \ - -L../deps/libopencm3/lib - -ifeq ($(NO_BOOTLOADER), 1) -APP_START = 0x08000000 -else -APP_START = 0x08020000 -endif - -LDFLAGS = $(LDFLAGS_BOOT) -LDFLAGS += -Wl,-Ttext=$(APP_START) -CFLAGS += -DAPP_START=$(APP_START) - -ifeq ($(ENABLE_DEBUG), 1) -LDFLAGS += --specs=rdimon.specs -else -LDFLAGS += --specs=nosys.specs -endif - -VPATH += platforms/common/stm32 - -SRC += \ - platform.c \ - serialno.c \ - timing.c \ - timing_stm32.c \ - swo.c \ - swo_uart.c \ - swo_itm_decode.c - -.PHONY: libopencm3_stm32f7 - -ifeq ($(NO_BOOTLOADER), 1) -all: libopencm3_stm32f7 blackmagic.bin -else -all: libopencm3_stm32f7 blackmagic.bin blackmagic_dfu.bin blackmagic_dfu.hex - -blackmagic_dfu.elf: usbdfu.o dfucore.o dfu_f4.o usb_f723.o serialno.o - @echo " LD $@" - $(Q)$(CC) $^ -o $@ $(LDFLAGS_BOOT) -endif - -blackmagic.elf: libopencm3_stm32f7 -libopencm3_stm32f7: - $(Q)$(MAKE) $(MFLAGS) -C ../deps/libopencm3 lib/stm32/f7 - -host_clean: - -$(Q)$(RM) *.bin *elf *hex *.o - -# Add local libopencm3 patched usb driver. -SRC += usb_f723.c - -# Note: below are provided some customized versions of -# files from the libopencm3 libraries. It would be ideal -# if some day these go in libopencm3 master, but for the -# time being this is a convenient solution. -# -# Note that there is something very odd about linking these -# libopencm3 replacement files and libopencm3 together. -# If all of the externally visible symbols from these -# replacement files are kept (e.g., no externally visible -# functions or data objects are removed), then linking -# mysteriously succeeds. However, removing some externally -# symbols cause linking to (expectedly) fail, giving an -# error of multiple symbol definitions. The strange -# thing is why linking succeeds in the case described above. - -usb_f723.o: usb_f723.c - @echo " CC $<" - $(Q)$(CC) -I../deps/libopencm3/lib $(CFLAGS) $(OPT_FLAGS) -c $< -o $@ diff --git a/src/platforms/swlink/Makefile.inc b/src/platforms/swlink/Makefile.inc deleted file mode 100644 index 21c7b437875..00000000000 --- a/src/platforms/swlink/Makefile.inc +++ /dev/null @@ -1,57 +0,0 @@ -CROSS_COMPILE ?= arm-none-eabi- -CC = $(CROSS_COMPILE)gcc -OBJCOPY = $(CROSS_COMPILE)objcopy - -CFLAGS += -mcpu=cortex-m3 -mthumb \ - -DSTM32F1 -DDFU_SERIAL_LENGTH=9 -I../deps/libopencm3/include \ - -I platforms/common/stm32 -LDFLAGS_BOOT := $(LDFLAGS) -lopencm3_stm32f1 -Lplatforms/swlink \ - -Tswlink.ld --specs=nano.specs -nostartfiles -lc\ - -Wl,-Map=mapfile -mthumb -mcpu=cortex-m3 -Wl,-gc-sections \ - -L../deps/libopencm3/lib -LDFLAGS = $(LDFLAGS_BOOT) -Wl,-Ttext=0x8002000 - -ifeq ($(ENABLE_DEBUG), 1) -LDFLAGS += --specs=rdimon.specs -else -LDFLAGS += --specs=nosys.specs -endif - -VPATH += platforms/common/stm32 - -SRC += \ - platform.c \ - platform_common.c \ - serialno.c \ - timing.c \ - timing_stm32.c \ - swo.c \ - swo_itm_decode.c - -# If SWO_ENCODING has not been given, default it to including both modes -ifndef SWO_ENCODING - SWO_ENCODING = 3 -endif - -# Include the files for either: Manchester-only (1), UART-only (2) or both modes (3) -ifeq ($(SWO_ENCODING), 1) - SRC += swo_manchester.c -else ifeq ($(SWO_ENCODING), 2) - SRC += swo_uart.c -else ifeq ($(SWO_ENCODING), 3) - SRC += \ - swo_manchester.c \ - swo_uart.c -else # If we got some other value, that's an error so report it - $(error Invalid value for SWO encoding, must be one of 1, 2, or 3) -endif -CFLAGS += -DSWO_ENCODING=$(SWO_ENCODING) - -all: blackmagic.bin blackmagic_dfu.bin blackmagic_dfu.hex - -blackmagic_dfu.elf: usbdfu.o dfucore.o dfu_f1.o platform_common.o serialno.o - @echo " LD $@" - $(Q)$(CC) $^ -o $@ $(LDFLAGS_BOOT) - -host_clean: - -$(Q)$(RM) blackmagic.bin blackmagic_dfu blackmagic_dfu.bin blackmagic_dfu.hex