-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathMakefile
63 lines (44 loc) · 1.56 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
# nRF5 SDK Repo
NRF5_SDK ?= nRF5_SDK_15.3.0_59ac345
NRF5_SDK_ROOT = $(NRF5_SDK)/
NRF5_SDK_ARCHIVE = $(NRF5_SDK).zip
NRF5_SDK_MAJOR = $(shell echo $(NRF5_SDK) | sed -e "s/nRF5_SDK_\([0-9]*\)\..*/\1/g")
NRF5_SDK_URL = https://developer.nordicsemi.com/nRF5_SDK/nRF5_SDK_v$(NRF5_SDK_MAJOR).x.x/$(NRF5_SDK_ARCHIVE)
all: subdirs | $(NRF5_SDK_ROOT)
SUBDIRS = firmware/nrf/blefriend32/armgcc/ \
firmware/nrf/pca10028/armgcc/ \
firmware/nrf/pca10040/armgcc/ \
firmware/nrf/pca10056/armgcc/ \
firmware/nrf/pca10059/armgcc/ \
firmware/nrf/nrf52840_mdk/armgcc/ \
firmware/nrf/nrf52840_mdk_usb_dongle/armgcc/ \
firmware/nrf/pitaya_go/armgcc/
SUBDIRS_CLEAN := $(addsuffix clean,$(SUBDIRS))
.PHONY: subdirs $(SUBDIRS)
subdirs: $(NRF5_SDK_ROOT)
subdirs: $(SUBDIRS)
$(SUBDIRS):
$(MAKE) -C $@
.SECONDARY: $(NRF5_SDK_ARCHIVE)
.PRECIOUS: $(NRF5_SDK_ARCHIVE)
$(NRF5_SDK_ROOT): | $(NRF5_SDK_ARCHIVE)
unzip $(NRF5_SDK_ARCHIVE)
ifneq "$(findstring $(NRF5_SDK).patch,$(wildcard *.patch))" ""
patch -Nup0 --binary < $(NRF5_SDK).patch
endif
$(NRF5_SDK_ARCHIVE):
@echo sdk archive not found, downloading now...
wget -c $(NRF5_SDK_URL)
.PHONY: clean
clean: $(SUBDIRS_CLEAN)
%clean:
$(MAKE) -C $* clean
clean:
rm -rf *.o *.d
distclean: clean
rm -rf $(NRF5_SDK_ROOT)
rm -f $(NRF5_SDK_ARCHIVE)
ASTYLE_OPTIONS=--style=attach --add-braces --indent-switches --suffix=none --exclude="firmware/SEGGER_RTT_V640" --exclude="nRF5_SDK_15.2.0_9412b96"
format:
astyle ${ASTYLE_OPTIONS} --recursive "*.c"
astyle ${ASTYLE_OPTIONS} --recursive "*.c"