2015-03-09 02:39:42 +00:00
|
|
|
OUTFILE = blackmagic_upgrade
|
2012-01-18 07:45:18 +00:00
|
|
|
|
2019-07-19 16:16:20 +00:00
|
|
|
PC_HOSTED =
|
|
|
|
ifeq ($(PROBE_HOST), libftdi)
|
|
|
|
PC_HOSTED = true
|
|
|
|
endif
|
|
|
|
ifeq ($(PROBE_HOST), pc-stlinkv2)
|
|
|
|
PC_HOSTED = true
|
|
|
|
endif
|
|
|
|
|
2012-01-18 07:45:18 +00:00
|
|
|
CC = $(CROSS_COMPILE)gcc
|
|
|
|
|
2015-03-11 04:58:37 +00:00
|
|
|
CFLAGS = -Wall -Wextra -std=gnu99 -O0 -g -MD -mno-ms-bitfields
|
2012-01-18 07:45:18 +00:00
|
|
|
LDFLAGS = -lusb
|
|
|
|
|
|
|
|
OBJ = bindata.o \
|
|
|
|
dfu.o \
|
|
|
|
stm32mem.o \
|
|
|
|
main.o
|
|
|
|
|
2019-07-19 16:16:20 +00:00
|
|
|
ifndef $(PROBE_HOST)
|
|
|
|
PROBE_HOST=native
|
|
|
|
endif
|
2012-01-18 07:45:18 +00:00
|
|
|
|
2019-07-19 16:16:20 +00:00
|
|
|
ifndef PC_HOSTED
|
|
|
|
all: $(OUTFILE)
|
|
|
|
else
|
|
|
|
all:
|
|
|
|
ifeq ($(PROBE_HOST), libftdi)
|
|
|
|
@echo "Libftdi needs no firmware update"
|
|
|
|
endif
|
|
|
|
ifeq ($(PROBE_HOST), pc-stlinkv2)
|
|
|
|
@echo "Pc-stlinkv2 use ST provided tools for firmware update"
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
bindata.o: $(PROBE_HOST).d
|
|
|
|
|
2019-08-29 11:35:20 +00:00
|
|
|
$(PROBE_HOST).d: $(wildcard ../src/blackmagic.bin)
|
2019-07-19 16:16:20 +00:00
|
|
|
-rm *.d
|
|
|
|
make -C ../src $0 clean
|
|
|
|
make -C ../src $0
|
|
|
|
touch $(PROBE_HOST).d
|
2019-02-25 23:08:20 +00:00
|
|
|
|
2015-03-09 02:39:42 +00:00
|
|
|
$(OUTFILE) $(OUTFILE).exe: $(OBJ)
|
2012-01-18 07:45:18 +00:00
|
|
|
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
|
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
2015-03-09 02:39:42 +00:00
|
|
|
-rm -rf $(OUTFILE) $(OUTFILE).exe *.d *.o
|
2012-01-18 07:45:18 +00:00
|
|
|
|
|
|
|
-include *.d
|
|
|
|
|