forked from devanlai/dap42
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
106 lines (90 loc) · 3.3 KB
/
Makefile
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
## Copyright (c) 2016, Devan Lai
##
## Permission to use, copy, modify, and/or distribute this software
## for any purpose with or without fee is hereby granted, provided
## that the above copyright notice and this permission notice
## appear in all copies.
##
## THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
## WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
## WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
## AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
## CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
## LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
## NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
## CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
# Be silent per default, but 'make V=1' will show all compiler calls.
ifneq ($(V),1)
Q := @
NULL := 2>/dev/null
MAKE := $(MAKE) --no-print-directory
endif
export V
BUILD_DIR ?= ./build
all: DAP42.bin SBDAP.bin DAP42DC.bin KITCHEN42.bin \
DAP103.bin DAP103-DFU.bin \
DAP103-BLUEPILL.bin DAP103-BLUEPILL-DFU.bin \
DAP103-NUCLEO-STBOOT.bin \
BRAINv3.3.bin \
DAP42K6U.bin
clean:
$(Q)$(RM) $(BUILD_DIR)/*.bin
$(Q)$(MAKE) -C src/ clean
.PHONY = all clean
$(BUILD_DIR):
$(Q)mkdir -p $(BUILD_DIR)
DAP42.bin: | $(BUILD_DIR)
@printf " BUILD $(@)\n"
$(Q)$(MAKE) TARGET=STM32F042 -C src/ clean
$(Q)$(MAKE) TARGET=STM32F042 -C src/
$(Q)cp src/DAP42.bin $(BUILD_DIR)/$(@)
SBDAP.bin: | $(BUILD_DIR)
@printf " BUILD $(@)\n"
$(Q)$(MAKE) TARGET=SBDAP -C src/ clean
$(Q)$(MAKE) TARGET=SBDAP -C src/
$(Q)cp src/DAP42.bin $(BUILD_DIR)/$(@)
DAP42DC.bin: | $(BUILD_DIR)
@printf " BUILD $(@)\n"
$(Q)$(MAKE) TARGET=DAP42DC -C src/ clean
$(Q)$(MAKE) TARGET=DAP42DC -C src/
$(Q)cp src/DAP42.bin $(BUILD_DIR)/$(@)
KITCHEN42.bin: | $(BUILD_DIR)
@printf " BUILD $(@)\n"
$(Q)$(MAKE) TARGET=KITCHEN42 -C src/ clean
$(Q)$(MAKE) TARGET=KITCHEN42 -C src/
$(Q)cp src/DAP42.bin $(BUILD_DIR)/$(@)
DAP103.bin: | $(BUILD_DIR)
@printf " BUILD $(@)\n"
$(Q)$(MAKE) TARGET=STM32F103 -C src/ clean
$(Q)$(MAKE) TARGET=STM32F103 -C src/
$(Q)cp src/DAP42.bin $(BUILD_DIR)/$(@)
DAP103-DFU.bin: | $(BUILD_DIR)
@printf " BUILD $(@)\n"
$(Q)$(MAKE) TARGET=STM32F103-DFUBOOT -C src/ clean
$(Q)$(MAKE) TARGET=STM32F103-DFUBOOT -C src/
$(Q)cp src/DAP42.bin $(BUILD_DIR)/$(@)
DAP103-BLUEPILL.bin: | $(BUILD_DIR)
@printf " BUILD $(@)\n"
$(Q)$(MAKE) TARGET=STM32F103-BLUEPILL -C src/ clean
$(Q)$(MAKE) TARGET=STM32F103-BLUEPILL -C src/
$(Q)cp src/DAP42.bin $(BUILD_DIR)/$(@)
DAP103-BLUEPILL-DFU.bin: | $(BUILD_DIR)
@printf " BUILD $(@)\n"
$(Q)$(MAKE) TARGET=STM32F103-BLUEPILL-DFUBOOT -C src/ clean
$(Q)$(MAKE) TARGET=STM32F103-BLUEPILL-DFUBOOT -C src/
$(Q)cp src/DAP42.bin $(BUILD_DIR)/$(@)
BRAINv3.3.bin: | $(BUILD_DIR)
@printf " BUILD $(@)\n"
$(Q)$(MAKE) TARGET=BRAINV3.3 -C src/ clean
$(Q)$(MAKE) TARGET=BRAINV3.3 -C src/
$(Q)cp src/DAP42.bin $(BUILD_DIR)/$(@)
DAP42K6U.bin: | $(BUILD_DIR)
@printf " BUILD $(@)\n"
$(Q)$(MAKE) TARGET=DAP42K6U -C src/ clean
$(Q)$(MAKE) TARGET=DAP42K6U -C src/
$(Q)cp src/DAP42.bin $(BUILD_DIR)/$(@)
DAP103-NUCLEO-STBOOT.bin: | $(BUILD_DIR)
@printf " BUILD $(@)\n"
$(Q)$(MAKE) TARGET=STLINKV2-1-STBOOT -C src/ clean
$(Q)$(MAKE) TARGET=STLINKV2-1-STBOOT -C src/
$(Q)cp src/DAP42.bin $(BUILD_DIR)/$(@)