Zerocat Chipflasher  v0.4.3 (board-edition-1)
Flash free firmware to BIOS chips, kick the Manageability Engine.
Makefile
Go to the documentation of this file.
1 ##>!
2 ##>! Generate Documentation:
3 ##>!
4 ##>! * Zerocat Chipflasher Documentation (HTML, LATEX, etc.)
5 ##>! * Zerocat Connect Documentation (HTML, LATEX, etc.)
6 ##>! * Zerocat Chipflasher Board Documentation (HTML, LATEX, etc.)
7 ##>!
8 ##>! @file doc/Makefile
9 ##>!
10 ##>! @brief Generate documentation with doxygen.
11 ##>!
12 
13 ##>! @cond
14 ### Doxyfile ###
15 DOXYORIG_CHIPFLASHER = Doxyfile-Chipflasher.orig
16 DOXYORIG_CONNECT = Doxyfile-Connect.orig
17 DOXYORIG_BOARD = Doxyfile-Board.orig
18 DOXYFILE_CHIPFLASHER = Doxyfile-Chipflasher
19 DOXYFILE_CONNECT = Doxyfile-Connect
20 DOXYFILE_BOARD = Doxyfile-Board
21 
22 ### doxygen ###
23 DOXYGEN = doxygen
24 #~ DOXYGEN = /usr/bin/doxygen
25 #~ DOXYGEN = ~/.guix-profile/bin/doxygen
26 
27 ### paths ###
28 PATH_RESOURCES = doxygen-resources/
29 PATH_HARDWARE_DOC = ../hardware/doc/
30 PATH_HARDWARE_ARTWORK = ../hardware/artwork/
31 PATH_HARDWARE_GSCHEM = ../hardware/gschem/
32 PATH_HARDWARE_PCB = ../hardware/pcb/
33 PATH_FILES = generated-files/
34 PATH_IMG = generated-images/
35 # Must be same as Doxyfile’s OUTPUT_DIRECTORY:
36 PATH_DOCUMENTATION = generated-documentation/
37 PATH_CHIPFLASHER = $(PATH_DOCUMENTATION)chipflasher/
38 PATH_CONNECT = $(PATH_DOCUMENTATION)connect/
39 PATH_BOARD = $(PATH_DOCUMENTATION)board/
40 
41 ### messages ###
42 MSG_ALL = To read the generated html documentation, please open $(PATH_CHIPFLASHER)html/index.html in your browser.
43 
44 ### canned commands ###
45 define canned-doxygenversion
46  $(DOXYGEN) --version
47 endef
48 define canned-gendoc-chipflasher
49  $(DOXYGEN) $(PATH_RESOURCES)$(DOXYFILE_CHIPFLASHER)
50  @echo The documentation has been created in: $(PATH_CHIPFLASHER)
51 endef
52 define canned-gendoc-connect
53  $(DOXYGEN) $(PATH_RESOURCES)$(DOXYFILE_CONNECT)
54  @echo The documentation has been created in: $(PATH_CONNECT)
55 endef
56 define canned-gendoc-board
57  $(DOXYGEN) $(PATH_RESOURCES)$(DOXYFILE_BOARD)
58  @echo The documentation has been created in: $(PATH_BOARD)
59 endef
60 
61 .PHONY: all \
62  doxygen-version \
63  mkdir-documentation \
64  cp-Doxyfiles \
65  update-Doxyfiles \
66  gen-html-templates-chipflasher \
67  gen-html-templates-connect \
68  gen-html-templates-board \
69  gen-doc-chipflasher \
70  gen-doc-connect \
71  gen-doc-board \
72  gen-doc-chipflasher-tmplnogen \
73  gen-doc-connect-tmplnogen \
74  gen-doc-board-tmplnogen \
75  png-cp bom-cp \
76  folder-files folder-img \
77  clean \
78  cleanall
79 
80 # generate all
81 all: gen-doc-board gen-doc-connect gen-doc-chipflasher
82  @echo $(MSG_ALL)
83  @echo
84 
85 doxygen-version:
86  $(canned-doxygenversion)
87 
88 mkdir-documentation:
89  mkdir -p $(PATH_DOCUMENTATION)
90 
91 cp-Doxyfiles:
92  cd $(PATH_RESOURCES) && \
93  cp -f $(DOXYORIG_CHIPFLASHER) $(DOXYFILE_CHIPFLASHER) && \
94  cp -f $(DOXYORIG_CONNECT) $(DOXYFILE_CONNECT) && \
95  cp -f $(DOXYORIG_BOARD) $(DOXYFILE_BOARD)
96 
97 update-Doxyfiles: cp-Doxyfiles
98  $(DOXYGEN) -u $(PATH_RESOURCES)$(DOXYFILE_CHIPFLASHER)
99  $(DOXYGEN) -u $(PATH_RESOURCES)$(DOXYFILE_CONNECT)
100  $(DOXYGEN) -u $(PATH_RESOURCES)$(DOXYFILE_BOARD)
101  @echo
102  @echo The Doxyfiles have been updated with:
103  $(canned-doxygenversion)
104  @echo
105 
106 gen-html-templates-chipflasher: update-Doxyfiles
107  $(DOXYGEN) -w html \
108  $(PATH_RESOURCES)header.html \
109  $(PATH_RESOURCES)footer.html \
110  $(PATH_RESOURCES)style.css \
111  $(PATH_RESOURCES)$(DOXYFILE_CHIPFLASHER)
112 
113 gen-html-templates-connect: update-Doxyfiles
114  $(DOXYGEN) -w html \
115  $(PATH_RESOURCES)header.html \
116  $(PATH_RESOURCES)footer.html \
117  $(PATH_RESOURCES)style.css \
118  $(PATH_RESOURCES)$(DOXYFILE_CONNECT)
119 
120 gen-html-templates-board: update-Doxyfiles
121  $(DOXYGEN) -w html \
122  $(PATH_RESOURCES)header.html \
123  $(PATH_RESOURCES)footer.html \
124  $(PATH_RESOURCES)style.css \
125  $(PATH_RESOURCES)$(DOXYFILE_BOARD)
126 
127 # create file folder
128 folder-files:
129  mkdir -p $(PATH_FILES)
130 
131 # create image folder
132 folder-img:
133  mkdir -p $(PATH_IMG)
134 
135 # copy board.png as board.sch.png (used by website)
136 png-cp: board-make folder-img
137  cp $(PATH_HARDWARE_GSCHEM)board.sch.png $(PATH_IMG)board.sch.png
138  cp $(PATH_HARDWARE_GSCHEM)cables.sch.png $(PATH_IMG)cables.sch.png
139  cp $(PATH_HARDWARE_PCB)board.pcb.png $(PATH_IMG)board.pcb.png
140  cp $(PATH_HARDWARE_ARTWORK)front-label.png $(PATH_IMG)front-label.png
141  @echo Generated images have been copied to: $(PATH_IMG)
142 
143 # copy generated bom file
144 bom-cp: board-make folder-files
145  cp $(PATH_HARDWARE_DOC)board.bom.md $(PATH_FILES)
146  cp $(PATH_HARDWARE_DOC)cables.bom.md $(PATH_FILES)
147  @echo The generated BoM-files have been copied to: $(PATH_FILES)
148 
149 # generate chipflasher documentation
150 gen-doc-chipflasher: mkdir-documentation folder-img gen-html-templates-chipflasher
151  $(canned-gendoc-chipflasher)
152 
153 # generate chipflasher documentation with existing resources
154 gen-doc-chipflasher-tmplnogen: mkdir-documentation folder-img
155  $(canned-gendoc-chipflasher)
156 
157 # generate connect documentation
158 gen-doc-connect: mkdir-documentation folder-img gen-html-templates-connect
159  $(canned-gendoc-connect)
160 
161 # generate connect documentation with existing resources
162 gen-doc-connect-tmplnogen: mkdir-documentation folder-img
163  $(canned-gendoc-connect)
164 
165 # generate chipflasher board documentation
166 gen-doc-board: mkdir-documentation board-make png-cp bom-cp gen-html-templates-board
167  $(canned-gendoc-board)
168 
169 # generate chipflasher board documentation with existing resources
170 gen-doc-board-tmplnogen: mkdir-documentation board-make png-cp bom-cp
171  $(canned-gendoc-board)
172 
173 # call Makefile in ../hardware/doc/
174 board-make:
175  $(MAKE) -C $(PATH_HARDWARE_DOC) all
176 
177 # clean:
178 clean:
179  rm -rf $(PATH_FILES) && \
180  rm -rf $(PATH_IMG) && \
181  rm -rf $(PATH_DOCUMENTATION) && \
182  $(MAKE) -C $(PATH_HARDWARE_DOC) clean
183  cd $(PATH_RESOURCES) && \
184  rm -f header.html footer.html style.css *.bak \
185  $(DOXYFILE_CHIPFLASHER) $(DOXYFILE_CONNECT) $(DOXYFILE_BOARD)
186 
187 cleanall: clean
188 ##>! @endcond