|
| 1 | +SHELL := $(if $(SHELL), $(SHELL), /bin/sh) |
| 2 | +BASH := $(if $(shell which bash), $(shell which bash), /bin/bash) |
| 3 | + |
| 4 | +TARGET_CUSTOM_BUILD_NAME = |
| 5 | +TARGET_CUSTOM_BUILD = $(TARGET)-$(strip $(if $(TARGET_CUSTOM_BUILD_NAME), "CustomBuild_$(TARGET_CUSTOM_BUILD_NAME)", "DefaultBuild")) |
| 6 | +DEFAULT_TAG_SUPPORT_BASE = -DCONFIG_ISO14443A_SNIFF_SUPPORT \ |
| 7 | + -DCONFIG_ISO14443A_READER_SUPPORT |
| 8 | +SUPPORTED_TAGS ?= |
| 9 | +SUPPORTED_TAGS_BUILD := $(SUPPORTED_TAGS) |
| 10 | +CUSTOM_CONFIG_SETTINGS_BASE := $(DEFAULT_TAG_SUPPORT) $(SUPPORTED_TAGS_BUILD) -DDEFAULT_CONFIGURATION=CONFIG_NONE |
| 11 | + |
1 | 12 | ## : Include several standardized custom build target variants:
|
| 13 | +custom-build: CONFIG_SETTINGS:=$(CUSTOM_CONFIG_SETTINGS_BASE) |
2 | 14 | custom-build: local-clean $(TARGET).elf $(TARGET).hex $(TARGET).eep $(TARGET).bin check_size
|
3 |
| - @cp $(TARGET).hex $(TARGET)-$(TARGET_CUSTOM_BUILD).hex |
4 |
| - @cp $(TARGET).eep $(TARGET)-$(TARGET_CUSTOM_BUILD).eep |
5 |
| - @cp $(TARGET).bin $(TARGET)-$(TARGET_CUSTOM_BUILD).bin |
6 |
| - @echo "" |
| 15 | + @cp $(TARGET).hex $(TARGET_CUSTOM_BUILD).hex |
| 16 | + @cp $(TARGET).eep $(TARGET_CUSTOM_BUILD).eep |
| 17 | + @cp $(TARGET).elf $(TARGET_CUSTOM_BUILD).elf |
| 18 | + @cp $(TARGET).bin $(TARGET_CUSTOM_BUILD).bin |
| 19 | + @echo $(MSG_TIDY_ENDSEP)$(MSG_TIDY_ENDSEP)$(MSG_TIDY_ENDSEP)"\n" |
7 | 20 | @avr-size -A -x $(TARGET).elf
|
| 21 | + @echo $(MSG_TIDY_ENDSEP)"\n" |
8 | 22 | @avr-size -B -x $(TARGET).elf
|
9 |
| - @echo "" |
| 23 | + @echo "\n"$(MSG_TIDY_ENDSEP)"\n" |
10 | 24 | @avr-size -C -x $(TARGET).elf
|
11 |
| - @echo "" |
12 |
| - @echo " ==== SUCCESS BUILDING CUSTOM FIRMWARE -- $(TARGET)-$(TARGET_CUSTOM_BUILD) ====" |
13 |
| - @echo "" |
| 25 | + @echo $(MSG_TIDY_ENDSEP)$(MSG_TIDY_ENDSEP)$(MSG_TIDY_ENDSEP)"\n" |
| 26 | + @echo $(FMT_ANSIC_BOLD)$(FMT_ANSIC_EXCLAIM)"[!!!]"$(FMT_ANSIC_END) \ |
| 27 | + $(FMT_ANSIC_BOLD)$(FMT_ANSIC_UNDERLINE)"SUCCESS BUILDING CUSTOM FIRMWARE:"$(FMT_ANSIC_END) |
| 28 | + @echo $(FMT_ANSIC_BOLD)$(FMT_ANSIC_EXCLAIM)"[!!!]"$(FMT_ANSIC_END) \ |
| 29 | + $(FMT_ANSIC_BOLD)"$(TARGET_CUSTOM_BUILD).{hex/eep/elf/bin}"$(FMT_ANSIC_END) |
| 30 | + @echo "\n" |
14 | 31 |
|
15 |
| -default_config_support: DEFAULT_TAG_SUPPORT:= \ |
16 |
| - -DCONFIG_ISO14443A_SNIFF_SUPPORT \ |
17 |
| - -DCONFIG_ISO14443A_READER_SUPPORT |
| 32 | +default_config_support: DEFAULT_TAG_SUPPORT:=$(DEFAULT_TAG_SUPPORT_BASE) |
18 | 33 | nodefault_config_support: DEFAULT_TAG_SUPPORT:=
|
19 | 34 |
|
20 |
| -## : Define a few other useful custom build targets: |
21 |
| -mifare: SUPPORTED_TAGS:=$(DEFAULT_TAG_SUPPORT) \ |
| 35 | +mifare: SUPPORTED_TAGS_BUILD:=\ |
22 | 36 | -DCONFIG_MF_CLASSIC_MINI_4B_SUPPORT \
|
23 | 37 | -DCONFIG_MF_CLASSIC_1K_SUPPORT \
|
24 | 38 | -DCONFIG_MF_CLASSIC_1K_7B_SUPPORT \
|
25 | 39 | -DCONFIG_MF_CLASSIC_4K_SUPPORT \
|
26 | 40 | -DCONFIG_MF_CLASSIC_4K_7B_SUPPORT \
|
27 |
| - -DCONFIG_MF_ULTRALIGHT_SUPPORTmifare: CONFIG_SETTINGS:= $(SUPPORTED_TAGS) -DDEFAULT_CONFIGURATION=CONFIG_NONE |
28 |
| -mifare: TARGET_CUSTOM_BUILD:=CustomBuild_MifareDefaultSupport |
| 41 | + -DCONFIG_MF_ULTRALIGHT_SUPPORT |
| 42 | +mifare: TARGET_CUSTOM_BUILD_NAME:=MifareDefaultSupport |
29 | 43 | mifare: custom-build
|
30 | 44 |
|
31 | 45 | mifare-classic: nodefault_config_support
|
32 |
| -mifare-classic: SUPPORTED_TAGS:=$(DEFAULT_TAG_SUPPORT) \ |
| 46 | +mifare-classic: SUPPORTED_TAGS_BUILD:=\ |
33 | 47 | -DCONFIG_MF_CLASSIC_MINI_4B_SUPPORT \
|
34 | 48 | -DCONFIG_MF_CLASSIC_1K_SUPPORT \
|
35 | 49 | -DCONFIG_MF_CLASSIC_1K_7B_SUPPORT \
|
36 | 50 | -DCONFIG_MF_CLASSIC_4K_SUPPORT \
|
37 | 51 | -DCONFIG_MF_CLASSIC_4K_7B_SUPPORT
|
38 |
| -mifare-classic: CONFIG_SETTINGS:= $(SUPPORTED_TAGS) -DDEFAULT_CONFIGURATION=CONFIG_NONE |
39 |
| -mifare-classic: TARGET_CUSTOM_BUILD:=CustomBuild_MifareClassicSupport |
| 52 | +mifare-classic: TARGET_CUSTOM_BUILD_NAME:=MifareClassicSupport |
40 | 53 | mifare-classic: custom-build
|
41 | 54 |
|
| 55 | +desfire: CONFIG_SETTINGS:=$(DESFIRE_CONFIG_SETTINGS_BASE) \ |
| 56 | + -fno-inline-small-functions |
| 57 | +desfire: TARGET_CUSTOM_BUILD_NAME:=DESFire |
| 58 | +desfire: custom-build |
| 59 | + |
| 60 | +desfire-dev: CONFIG_SETTINGS:=$(DESFIRE_CONFIG_SETTINGS_BASE) \ |
| 61 | + -fno-inline-small-functions \ |
| 62 | + -DDESFIRE_MIN_OUTGOING_LOGSIZE=0 \ |
| 63 | + -DDESFIRE_MIN_INCOMING_LOGSIZE=0 \ |
| 64 | + -DDESFIRE_DEFAULT_LOGGING_MODE=DEBUGGING \ |
| 65 | + -DDESFIRE_DEFAULT_TESTING_MODE=1 |
| 66 | +desfire-dev: TARGET_CUSTOM_BUILD_NAME:=DESFire_DEV |
| 67 | +desfire-dev: custom-build |
| 68 | + |
42 | 69 | iso-modes: nodefault_config_support
|
43 |
| -iso-modes: SUPPORTED_TAGS:=$(DEFAULT_TAG_SUPPORT) \ |
| 70 | +iso-modes: SUPPORTED_TAGS_BUILD:=\ |
44 | 71 | -DCONFIG_ISO14443A_SNIFF_SUPPORT \
|
45 | 72 | -DCONFIG_ISO14443A_READER_SUPPORT \
|
46 | 73 | -DCONFIG_ISO15693_SNIFF_SUPPORT
|
47 |
| -iso-modes: CONFIG_SETTINGS:= $(SUPPORTED_TAGS) -DDEFAULT_CONFIGURATION=CONFIG_NONE |
48 |
| -iso-modes: TARGET_CUSTOM_BUILD:=CustomBuild_ISOSniffReaderModeSupport |
| 74 | +iso-modes: TARGET_CUSTOM_BUILD_NAME:=ISOSniffReaderModeSupport |
49 | 75 | iso-modes: custom-build
|
50 | 76 |
|
51 | 77 | ntag215: default_config_support
|
52 |
| -ntag215: SUPPORTED_TAGS:=$(DEFAULT_TAG_SUPPORT) \ |
53 |
| - -DCONFIG_NTAG215_SUPPORT |
54 |
| -ntag215: CONFIG_SETTINGS:= $(SUPPORTED_TAGS) -DDEFAULT_CONFIGURATION=CONFIG_NONE |
55 |
| -ntag215: TARGET_CUSTOM_BUILD:=CustomBuild_NTAG215Support |
| 78 | +ntag215: SUPPORTED_TAGS_BUILD:=-DCONFIG_NTAG215_SUPPORT |
| 79 | +ntag215: TARGET_CUSTOM_BUILD_NAME:=NTAG215Support |
56 | 80 | ntag215: custom-build
|
57 | 81 |
|
58 | 82 | vicinity: default_config_support
|
59 |
| -vicinity: SUPPORTED_TAGS:=$(DEFAULT_TAG_SUPPORT) \ |
60 |
| - -DCONFIG_VICINITY_SUPPORT |
61 |
| -vicinity: CONFIG_SETTINGS:= $(SUPPORTED_TAGS) -DDEFAULT_CONFIGURATION=CONFIG_NONE |
62 |
| -vicinity: TARGET_CUSTOM_BUILD:=CustomBuild_VicinitySupport |
| 83 | +vicinity: SUPPORTED_TAGS_BUILD:=-DCONFIG_VICINITY_SUPPORT |
| 84 | +vicinity: TARGET_CUSTOM_BUILD_NAME:=VicinitySupport |
63 | 85 | vicinity: custom-build
|
64 | 86 |
|
65 | 87 | sl2s2002: default_config_support
|
66 |
| -sl2s2002: SUPPORTED_TAGS:=$(DEFAULT_TAG_SUPPORT) \ |
67 |
| - -DCONFIG_SL2S2002_SUPPORT |
68 |
| -sl2s2002: CONFIG_SETTINGS:= $(SUPPORTED_TAGS) -DDEFAULT_CONFIGURATION=CONFIG_NONE |
69 |
| -sl2s2002: TARGET_CUSTOM_BUILD:=CustomBuild_SL2S2002Support |
| 88 | +sl2s2002: SUPPORTED_TAGS_BUILD:=-DCONFIG_SL2S2002_SUPPORT |
| 89 | +sl2s2002: TARGET_CUSTOM_BUILD_NAME:=SL2S2002Support |
70 | 90 | sl2s2002: custom-build
|
71 | 91 |
|
72 | 92 | tagatit: default_config_support
|
73 |
| -tagatit: SUPPORTED_TAGS:=$(DEFAULT_TAG_SUPPORT) \ |
| 93 | +tagatit: SUPPORTED_TAGS_BUILD:=\ |
74 | 94 | -DCONFIG_TITAGITSTANDARD_SUPPORT \
|
75 | 95 | -DCONFIG_TITAGITPLUS_SUPPORT
|
76 |
| -tagatit: CONFIG_SETTINGS:= $(SUPPORTED_TAGS) -DDEFAULT_CONFIGURATION=CONFIG_NONE |
77 |
| -tagatit: TARGET_CUSTOM_BUILD:=CustomBuild_TagatitSupport |
| 96 | +tagatit: TARGET_CUSTOM_BUILD_NAME:=TagatitSupport |
78 | 97 | tagatit: custom-build
|
79 | 98 |
|
80 | 99 | em4233: default_config_support
|
81 |
| -em4233: SUPPORTED_TAGS:=$(DEFAULT_TAG_SUPPORT) \ |
82 |
| - -DCONFIG_EM4233_SUPPORT |
83 |
| -em4233: CONFIG_SETTINGS:= $(SUPPORTED_TAGS) -DDEFAULT_CONFIGURATION=CONFIG_NONE |
84 |
| -em4233: TARGET_CUSTOM_BUILD:=CustomBuild_EM4233Support |
| 100 | +em4233: SUPPORTED_TAGS_BUILD:=-DCONFIG_EM4233_SUPPORT |
| 101 | +em4233: TARGET_CUSTOM_BUILD_NAME:=EM4233Support |
85 | 102 | em4233: custom-build
|
86 |
| - |
87 |
| -## : Define custom targets for the DESFire build (normal/user mode) and |
88 |
| -## : developer mode for use with the Android CMLD application that enables |
89 |
| -## : the printing of LIVE logs to the phone's console by default: |
90 |
| -desfire-build: local-clean $(TARGET).elf $(TARGET).hex $(TARGET).eep $(TARGET).bin check_size |
91 |
| - @cp $(TARGET).hex $(TARGET)-DESFire.hex |
92 |
| - @cp $(TARGET).eep $(TARGET)-DESFire.eep |
93 |
| - @cp $(TARGET).bin $(TARGET)-DESFire.bin |
94 |
| - @echo "" |
95 |
| - @avr-size -A -x $(TARGET).elf |
96 |
| - @avr-size -B -x $(TARGET).elf |
97 |
| - @echo "" |
98 |
| - @avr-size -C -x $(TARGET).elf |
99 |
| -desfire: CONFIG_SETTINGS:=$(DESFIRE_CONFIG_SETTINGS_BASE) -fno-inline-small-functions |
100 |
| -desfire: desfire-build |
101 |
| -desfire-dev: CONFIG_SETTINGS:=$(DESFIRE_CONFIG_SETTINGS_BASE) -fno-inline-small-functions \ |
102 |
| - -DDESFIRE_MIN_OUTGOING_LOGSIZE=0 \ |
103 |
| - -DDESFIRE_MIN_INCOMING_LOGSIZE=0 \ |
104 |
| - -DDESFIRE_DEFAULT_LOGGING_MODE=DEBUGGING \ |
105 |
| - -DDESFIRE_DEFAULT_TESTING_MODE=1 |
106 |
| -desfire-dev: desfire-build |
0 commit comments