forked from ladislas/Bare-Arduino-Project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
41 lines (31 loc) · 857 Bytes
/
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
ECHO = printf
SUBDIRS := $(wildcard src/*)
UNAME_S := $(shell uname -s)
TOPTARGETS := upload
ifeq ($(UNAME_S),Linux)
MKFILE = Makefile-Linux.mk
endif
ifeq ($(UNAME_S),Darwin)
MKFILE = Makefile-OSX.mk
endif
$(TOPTARGETS): $(SUBDIRS)
#copy makefile over
$(SUBDIRS:=/Makefile) : ${MKFILE}
cp $< $@
#run both upload and regular builds
$(SUBDIRS): % : %/Makefile
$(MAKE) -C $@
$(MAKE) -C $@ $(MAKECMDGOALS)
.PHONY: $(TOPTARGETS) $(SUBDIRS)
install:
./script/install.sh
test:
./script/runtests.sh
help:
@$(ECHO) "\nAvailable targets:\n\
make install - install all software required for building\n\
make test - run the tests in ./test\n\
make upload <src/dirname> - upload the sketch in src/<dirname>\n\
make <src/dirname> - compile the sketch in src/<dirname>\n\
"
.PHONY: install test help