2 ##>! Generate Documentation:
4 ##>! * Zerocat Chipflasher Documentation (HTML, LATEX, etc.)
5 ##>! * Zerocat Connect Documentation (HTML, LATEX, etc.)
6 ##>! * Zerocat Chipflasher Board Documentation (HTML, LATEX, etc.)
8 ##>! @file doc/Makefile
10 ##>! @brief Generate documentation with doxygen.
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
24 #~ DOXYGEN = /usr/bin/doxygen
25 #~ DOXYGEN = ~/.guix-profile/bin/doxygen
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/
42 MSG_ALL = To read the generated html documentation, please open $(PATH_CHIPFLASHER)html/index.html in your browser.
44 ### canned commands ###
45 define canned-doxygenversion
48 define canned-gendoc-chipflasher
49 $(DOXYGEN) $(PATH_RESOURCES)$(DOXYFILE_CHIPFLASHER)
50 @echo The documentation has been created in: $(PATH_CHIPFLASHER)
52 define canned-gendoc-connect
53 $(DOXYGEN) $(PATH_RESOURCES)$(DOXYFILE_CONNECT)
54 @echo The documentation has been created in: $(PATH_CONNECT)
56 define canned-gendoc-board
57 $(DOXYGEN) $(PATH_RESOURCES)$(DOXYFILE_BOARD)
58 @echo The documentation has been created in: $(PATH_BOARD)
66 gen-html-templates-chipflasher \
67 gen-html-templates-connect \
68 gen-html-templates-board \
72 gen-doc-chipflasher-tmplnogen \
73 gen-doc-connect-tmplnogen \
74 gen-doc-board-tmplnogen \
76 folder-files folder-img \
81 all: gen-doc-board gen-doc-connect gen-doc-chipflasher
86 $(canned-doxygenversion)
89 mkdir -p $(PATH_DOCUMENTATION)
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)
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)
102 @echo The Doxyfiles have been updated with:
103 $(canned-doxygenversion)
106 gen-html-templates-chipflasher: update-Doxyfiles
108 $(PATH_RESOURCES)header.html \
109 $(PATH_RESOURCES)footer.html \
110 $(PATH_RESOURCES)style.css \
111 $(PATH_RESOURCES)$(DOXYFILE_CHIPFLASHER)
113 gen-html-templates-connect: update-Doxyfiles
115 $(PATH_RESOURCES)header.html \
116 $(PATH_RESOURCES)footer.html \
117 $(PATH_RESOURCES)style.css \
118 $(PATH_RESOURCES)$(DOXYFILE_CONNECT)
120 gen-html-templates-board: update-Doxyfiles
122 $(PATH_RESOURCES)header.html \
123 $(PATH_RESOURCES)footer.html \
124 $(PATH_RESOURCES)style.css \
125 $(PATH_RESOURCES)$(DOXYFILE_BOARD)
129 mkdir -p $(PATH_FILES)
131 # create image folder
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)
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)
149 # generate chipflasher documentation
150 gen-doc-chipflasher: mkdir-documentation folder-img gen-html-templates-chipflasher
151 $(canned-gendoc-chipflasher)
153 # generate chipflasher documentation with existing resources
154 gen-doc-chipflasher-tmplnogen: mkdir-documentation folder-img
155 $(canned-gendoc-chipflasher)
157 # generate connect documentation
158 gen-doc-connect: mkdir-documentation folder-img gen-html-templates-connect
159 $(canned-gendoc-connect)
161 # generate connect documentation with existing resources
162 gen-doc-connect-tmplnogen: mkdir-documentation folder-img
163 $(canned-gendoc-connect)
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)
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)
173 # call Makefile in ../hardware/doc/
175 $(MAKE) -C $(PATH_HARDWARE_DOC) all
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)