blackmagic/src/Makefile

72 lines
1.3 KiB
Makefile
Raw Normal View History

PROBE_HOST ?= native
PLATFORM_DIR = platforms/$(PROBE_HOST)
VPATH += platforms/common $(PLATFORM_DIR)
2011-02-04 07:23:52 +00:00
BUILDDATE := `date +"%Y%m%d"`
CFLAGS += -Wall -Wextra -Wno-pointer-sign -Wno-char-subscripts\
-Wno-sign-compare \
-O2 -std=gnu99 -g3 -DBUILDDATE=\"$(BUILDDATE)\"\
-I. -Iinclude -Iplatforms/common -I$(PLATFORM_DIR) \
-DVERSION_SUFFIX=\"`../scripts/setlocalversion`\" -MD
2011-02-04 07:23:52 +00:00
2012-11-03 08:33:28 +00:00
SRC = \
2011-02-04 07:23:52 +00:00
adiv5.c \
2012-11-03 08:33:28 +00:00
adiv5_jtagdp.c \
2011-02-04 07:23:52 +00:00
adiv5_swdp.c \
2012-11-03 08:33:28 +00:00
arm7tdmi.c \
2011-02-04 07:23:52 +00:00
command.c \
2012-11-03 08:33:28 +00:00
cortexm.c \
crc32.c \
gdb_if.c \
gdb_main.c \
gdb_packet.c \
hex_utils.c \
2011-02-04 07:23:52 +00:00
jtag_scan.c \
2012-11-03 08:33:28 +00:00
jtagtap.c \
2011-02-04 07:23:52 +00:00
lmi.c \
2013-06-17 04:06:03 +00:00
lpc11xx.c \
2012-11-03 08:33:28 +00:00
lpc43xx.c \
kinetis.c \
2012-11-03 08:33:28 +00:00
main.c \
morse.c \
2014-04-25 21:34:58 +00:00
nrf51.c \
2012-11-03 08:33:28 +00:00
platform.c \
sam3x.c \
2015-01-18 22:40:02 +00:00
samd.c \
2012-11-03 08:33:28 +00:00
stm32f1.c \
stm32f4.c \
2012-10-25 18:30:13 +00:00
stm32l1.c \
2012-11-03 08:33:28 +00:00
swdptap.c \
target.c \
2011-02-04 07:23:52 +00:00
include $(PLATFORM_DIR)/Makefile.inc
2011-02-04 07:23:52 +00:00
OBJ = $(SRC:.c=.o)
blackmagic: $(OBJ)
$(CC) -o $@ $^ $(LDFLAGS)
2011-02-04 07:23:52 +00:00
.PHONY: clean host_clean all_platforms
2011-02-04 07:23:52 +00:00
clean: host_clean
-$(RM) *.o *.d *~ blackmagic $(HOSTFILES)
-$(RM) platforms/*/*.o platforms/*/*.d mapfile
2011-02-04 07:23:52 +00:00
all_platforms:
set -e ;\
for i in platforms/*/Makefile.inc ; do \
export DIRNAME=`dirname $$i` ;\
export PROBE_HOST=`basename $$DIRNAME` ;\
export CFLAGS=-Werror ;\
echo $$PROBE_HOST ;\
$(MAKE) clean ;\
$(MAKE) ;\
if [ -f blackmagic.bin ]; then \
mv blackmagic.bin blackmagic-$$PROBE_HOST.bin ;\
fi ;\
done
-include *.d