forked from nzjrs/wasp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
87 lines (66 loc) · 3.28 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
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
DOCDIR = doc
BUILT_DOCDIR = $(DOCDIR)/built
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(DOCDIR)/.doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
GENERATED_FILES = \
sw/doc/comm-protocol.rst \
sw/doc/settings-xml.rst \
sw/onboard/generated/messages.h \
$(BUILT_DOCDIR)/onboard/xml/index.xml \
$(BUILT_DOCDIR)/archconfigarm7/xml/index.xml
################################################################################
# Main targets
################################################################################
onboard:
@make -C sw/onboard/ all
bootloader:
@make -C sw/bootloader/ all
BOOTLOADER_DEV=/dev/ttyUSB0
install_bootloader: bootloader
lpc21isp -control sw/bootloader/bl.hex $(BOOTLOADER_DEV) 38400 12000
doc: mkdir html
all: onboard bootloader doc
clean: cleandoc
@make -C sw/groundstation/ clean
@make -C sw/onboard/ clean
@make -C sw/bootloader/ clean
cleandoc:
-rm -rf $(BUILT_DOCDIR) $(DOCDIR)/.doctrees $(GENERATED_FILES)
test: clean
@make -C sw/groundstation/ test
@cd sw/onboard ; ./build-tests.sh
showdoc: doc
@gnome-www-browser doc/built/html/index.html
uploaddoc: doc
-rsync -av doc/built/html/* [email protected]:/var/www/waspuav.org/doc/
dist:
@git archive --format=tar --prefix=wasp/ HEAD:sw | gzip > $(shell git rev-parse --verify HEAD)-$(shell git symbolic-ref HEAD | cut -d / -f 3)-sw.tar.gz
@echo Created $(shell git rev-parse --verify HEAD)-$(shell git symbolic-ref HEAD | cut -d / -f 3)-sw.tar.gz
@git archive --format=tar --prefix=wasp/ HEAD:hw | gzip > $(shell git rev-parse --verify HEAD)-$(shell git symbolic-ref HEAD | cut -d / -f 3)-hw.tar.gz
@echo Created $(shell git rev-parse --verify HEAD)-$(shell git symbolic-ref HEAD | cut -d / -f 3)-hw.tar.gz
@git archive --format=tar --prefix=wasp/ HEAD | gzip > $(shell git rev-parse --verify HEAD)-$(shell git symbolic-ref HEAD | cut -d / -f 3).tar.gz
@echo Created $(shell git rev-parse --verify HEAD)-$(shell git symbolic-ref HEAD | cut -d / -f 3).tar.gz
release: dist uploaddoc
@rsync -av $(shell git rev-parse --verify HEAD)-$(shell git symbolic-ref HEAD | cut -d / -f 3)*.tar.gz [email protected]:/var/www/waspuav.org/downloads/
################################################################################
# Dependencies
################################################################################
mkdir:
@mkdir -p $(BUILT_DOCDIR)
$(BUILT_DOCDIR)/onboard/xml/index.xml: sw/onboard/doxygen.cfg sw/onboard/*.h
@DOCDIR=$(DOCDIR) BUILT_DOCDIR=$(BUILT_DOCDIR) doxygen $<
$(BUILT_DOCDIR)/archconfigarm7/xml/index.xml: sw/onboard/arch/arm7/doxygen.cfg sw/onboard/arch/arm7/config.h
@DOCDIR=$(DOCDIR) BUILT_DOCDIR=$(BUILT_DOCDIR) doxygen $<
sw/doc/comm-protocol.rst: sw/onboard/config/messages.xml
@PYTHONPATH=./sw/groundstation/ ./sw/tools/gen-messages.py -m $< -f rst --output=$@
sw/doc/settings-xml.rst: sw/onboard/config/settings.xml
@PYTHONPATH=./sw/groundstation/ ./sw/tools/gen-settings.py -s $< -f rst > $@
sw/onboard/generated/messages.h: sw/onboard/config/messages.xml
@make -C sw/onboard/ generated/messages.h
html: $(GENERATED_FILES)
@$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) doc/built/html
.PHONY: doc clean test onboard bootloader