Programs using CFS should #include "cfs.h" ;-)
[contiki-2.x.git] / doc / Makefile
blob36f37491e2f443f0891d620d829c5a9e8f836561
1 basedirs := core cpu platform
2 manuals := $(shell find ./ -name "*.txt")
3 filetypes := -iwholename "*/doc/*.txt"
4 empty :=
5 space := $(empty) $(empty)
6 pwd := $(shell cd ..; pwd)
8 # Doxyfile configuration variables
9 export docdir := .
10 export docdirs
11 export docsrc
12 export doclatex := NO
13 export docroot := ../
15 # Get appropriate root for doxygen path cutoff
16 ifneq (,$(findstring Windows,$(OS)))
17 # on windows need to convert cygwin path to windows path for doxygen
18 ifneq (,$(findstring cygdrive,$(pwd)))
19 cygroot = $(subst /,$(space),$(patsubst /cygdrive/%,%,$(pwd)))
20 export docroot = $(firstword $(cygroot)):/$(subst $(space),/,$(wordlist 2,$(words $(cygroot)),$(cygroot)))
21 endif
22 endif
24 .PHONY: clean html pdf upload
26 html: init doxygen
28 pdf: doclatex = YES
29 pdf: init doxygen
30 gmake -C latex refman.pdf
32 init:
33 @echo "> Scanning files"
35 # This target requires and graphviz and doxygen
36 doxygen: docdirs = $(foreach dir,$(basedirs),${shell find ../${dir} -type d -not -path "*/.*" -not -path "*/obj_*"})
37 doxygen: docsrc = $(docdirs) $(foreach dir,$(docdirs),${shell find $(dir) -type f $(filetypes)}) $(manuals)
38 doxygen:
39 @doxygen Doxyfile
40 @echo "Done, errorlog follows:"
41 @echo ""
42 @cat "doxygen.log"
44 clean:
45 @echo "> Cleaning Documentation"
46 @$(RM) -r "$(docdir)/html"
47 @$(RM) -r "$(docdir)/rtf"
48 @$(RM) -r "$(docdir)/latex"
49 @$(RM) -r "doxygen.log"
50 @echo " done."
52 upload: html #pdf
53 # scp -C latex/refman.pdf adamdunkels@shell.sourceforge.net:/home/groups/c/co/contiki/htdocs/
54 # tar czfv - html | ssh adamdunkels@shell.sourceforge.net "cd /home/groups/c/co/contiki/htdocs/; tar xfz -"
55 (cd html; rsync -rv . r2d2.sics.se:/home/adam/public_html/contiki/docs)
57 test:
58 @echo $(docroot)
59 @echo $(docsrc)