This repository has been archived by the owner on Sep 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
blackmagic.patch
125 lines (116 loc) · 5.05 KB
/
blackmagic.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
diff --git a/src/Makefile b/src/Makefile
index 30503b23..86dc8926 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -217,8 +217,8 @@ all_platforms:
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 "<html><body><ul>" > artifacts/index.html ;\
+ mkdir artifacts ;\
+ ( echo -n "Blackmagic "; git describe --always --dirty --tags; echo -n "Compiled " ; date -u ) > artifacts/README.TXT ;\
$(MAKE) clean ;\
for i in platforms/*/Makefile.inc ; do \
export DIRNAME=`dirname $$i` ;\
@@ -229,25 +229,33 @@ all_platforms:
export CFLAGS=-Werror ;\
echo "Building for hardware platform: $$PROBE_HOST" ;\
$(MAKE);\
+ mkdir -p artifacts/$$PROBE_HOST ;\
if [ -f blackmagic ]; then \
- mv blackmagic artifacts/blackmagic-$$PROBE_HOST ;\
- echo "<li><a href='blackmagic-$$PROBE_HOST'>$$PROBE_HOST</a></li>"\
- >> artifacts/index.html ;\
+ mv blackmagic artifacts/$$PROBE_HOST/blackmagic-$$PROBE_HOST ;\
fi ;\
if [ -f blackmagic.bin ]; then \
- mv blackmagic.bin artifacts/blackmagic-$$PROBE_HOST.bin ;\
- echo "<li><a href='blackmagic-$$PROBE_HOST.bin'>$$PROBE_HOST</a></li>"\
- >> artifacts/index.html ;\
+ mv blackmagic.bin artifacts/$$PROBE_HOST/blackmagic-$$PROBE_HOST.bin ;\
+ fi ;\
+ if [ -f blackmagic.elf ]; then \
+ mv blackmagic.elf artifacts/$$PROBE_HOST/blackmagic-$$PROBE_HOST.elf ;\
+ fi ;\
+ if [ -f blackmagic.hex ]; then \
+ mv blackmagic.hex artifacts/$$PROBE_HOST/blackmagic-$$PROBE_HOST.hex ;\
fi ;\
if [ -f blackmagic_dfu.bin ]; then \
- mv blackmagic_dfu.bin artifacts/blackmagic_dfu-$$PROBE_HOST.bin ;\
- echo "<li><a href='blackmagic_dfu-$$PROBE_HOST.bin'>$$PROBE_HOST DFU</a></li>"\
- >> artifacts/index.html ;\
+ mv blackmagic_dfu.bin artifacts/$$PROBE_HOST/blackmagic_dfu-$$PROBE_HOST.bin ;\
+ fi ;\
+ if [ -f blackmagic_dfu.elf ]; then \
+ mv blackmagic_dfu.elf artifacts/$$PROBE_HOST/blackmagic_dfu-$$PROBE_HOST.elf ;\
+ fi ;\
+ if [ -f blackmagic_dfu.hex ]; then \
+ mv blackmagic_dfu.hex artifacts/$$PROBE_HOST/blackmagic_dfu-$$PROBE_HOST.hex ;\
+ fi ;\
+ if [ -f blackmagic_allinone.bin ]; then \
+ mv blackmagic_allinone.bin artifacts/$$PROBE_HOST/blackmagic_allinone-$$PROBE_HOST.bin ;\
fi ;\
$(MAKE) clean ;\
done ;\
- echo "</ul></body></html>" >> artifacts/index.html ;\
- cp artifacts/blackmagic* artifacts/$(shell git describe --always --dirty --tags)
command.c: include/version.h
diff --git a/src/platforms/native/Makefile.inc b/src/platforms/native/Makefile.inc
index 4d10a46b..f649c301 100644
--- a/src/platforms/native/Makefile.inc
+++ b/src/platforms/native/Makefile.inc
@@ -28,11 +28,15 @@ SRC += \
timing.c \
timing_stm32.c \
-all: blackmagic.bin blackmagic_dfu.bin blackmagic_dfu.hex
+all: blackmagic.bin blackmagic_dfu.bin blackmagic_dfu.hex blackmagic_allinone.bin
blackmagic_dfu.elf: usbdfu.o dfucore.o dfu_f1.o serialno.o
@echo " LD $@"
$(Q)$(CC) $^ -o $@ $(LDFLAGS_BOOT)
+blackmagic_allinone.bin: blackmagic.bin blackmagic_dfu.bin
+ cp blackmagic_dfu.bin blackmagic_allinone.bin
+ dd if=blackmagic.bin of=blackmagic_allinone.bin bs=1k seek=8
+
host_clean:
- -$(Q)$(RM) blackmagic.bin blackmagic_dfu blackmagic_dfu.bin blackmagic_dfu.hex
+ -$(Q)$(RM) blackmagic.bin blackmagic_dfu blackmagic_dfu.bin blackmagic_dfu.hex blackmagic_allinone.bin
diff --git a/src/platforms/stlink/Makefile.inc b/src/platforms/stlink/Makefile.inc
index 89578755..cce4ce0b 100644
--- a/src/platforms/stlink/Makefile.inc
+++ b/src/platforms/stlink/Makefile.inc
@@ -56,11 +56,15 @@ SRC += \
ifeq ($(ST_BOOTLOADER), 1)
all: blackmagic.bin
else
-all: blackmagic.bin blackmagic_dfu.bin blackmagic_dfu.hex
+all: blackmagic.bin blackmagic_dfu.bin blackmagic_dfu.hex blackmagic_allinone.bin
endif
blackmagic_dfu.elf: usbdfu.o dfucore.o dfu_f1.o stlink_common.o serialno.o
@echo " LD $@"
$(Q)$(CC) $^ -o $@ $(LDFLAGS_BOOT)
+blackmagic_allinone.bin: blackmagic.bin blackmagic_dfu.bin
+ cp blackmagic_dfu.bin blackmagic_allinone.bin
+ dd if=blackmagic.bin of=blackmagic_allinone.bin bs=1k seek=8
+
host_clean:
-$(Q)$(RM) *.bin *elf *hex
diff --git a/src/platforms/swlink/Makefile.inc b/src/platforms/swlink/Makefile.inc
index e14af9d7..a986fdc3 100644
--- a/src/platforms/swlink/Makefile.inc
+++ b/src/platforms/swlink/Makefile.inc
@@ -28,11 +28,15 @@ SRC += \
traceswoasync.c \
platform_common.c \
-all: blackmagic.bin blackmagic_dfu.bin blackmagic_dfu.hex
+all: blackmagic.bin blackmagic_dfu.bin blackmagic_dfu.hex blackmagic_allinone.bin
blackmagic_dfu.elf: usbdfu.o dfucore.o dfu_f1.o platform_common.o serialno.o
@echo " LD $@"
$(Q)$(CC) $^ -o $@ $(LDFLAGS_BOOT)
+blackmagic_allinone.bin: blackmagic.bin blackmagic_dfu.bin
+ cp blackmagic_dfu.bin blackmagic_allinone.bin
+ dd if=blackmagic.bin of=blackmagic_allinone.bin bs=1k seek=8
+
host_clean:
- -$(Q)$(RM) blackmagic.bin blackmagic_dfu blackmagic_dfu.bin blackmagic_dfu.hex
+ -$(Q)$(RM) blackmagic.bin blackmagic_dfu blackmagic_dfu.bin blackmagic_dfu.hex blackmagic_allinone.bin