1#!/bin/bash
2
3#
4# mkdoxy.sh - Generate doxygen documentation
5#
6# Written by
7#  groepaz <groepaz@gmx.net>
8#  compyx <b.wassink@ziggo.nl>
9#
10# This file is part of VICE, the Versatile Commodore Emulator.
11# See README for copyright notice.
12#
13#  This program is free software; you can redistribute it and/or modify
14#  it under the terms of the GNU General Public License as published by
15#  the Free Software Foundation; either version 2 of the License, or
16#  (at your option) any later version.
17#
18#  This program is distributed in the hope that it will be useful,
19#  but WITHOUT ANY WARRANTY; without even the implied warranty of
20#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21#  GNU General Public License for more details.
22#
23#  You should have received a copy of the GNU General Public License
24#  along with this program; if not, write to the Free Software
25#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
26#  02111-1307  USA.
27#
28
29################################################################################
30#
31# to get the most out of doxygen we must make sure that it only "sees" the files
32# which belong to a respective configuration. this is done by first specifying
33# all directories which contain actual sourcefiles in the "getinputs" function,
34# and then excluding files which are not required (eg for a specific emulator)
35# in the "getexcludes" function.
36#
37# adding a new configuration:
38# - update "getinputs" and make sure that for that config only directories which
39#   contain sourcefiles for this config go into the INPUT variable.
40# - generate the documentation, and look at the file list
41# - update "getexcludes" and make sure that for this config all files which do
42#   not belong to it are excluded and end up in the EXCLUDE variable.
43# - generate the documentation again and verify all is ok :)
44# - add this config to the list of working ones in the howto
45#
46# http://www.stack.nl/~dimitri/doxygen/config.html - Doyxgen config
47# http://qof.sourceforge.net/doxy/reference.html - Doxygen reference
48################################################################################
49
50################################################################################
51# this function returns all directories which contain input files for a specifc
52# configuration.
53#
54# $1    machine
55# $2    port
56# $3    ui
57#
58# returns path(es) in INPUT
59################################################################################
60function getinputs
61{
62INPUT=" ../src"
63INPUT+=" mainpage.dox"
64
65ARCH_INPUT=" ../src/arch"
66ARCH_INPUT+=" ../src/arch/shared"
67
68ARCH_GTK3_INPUT=" ../src/arch/gtk3"
69ARCH_GTK3_INPUT+=" ../src/arch/gtk3/widgets"
70ARCH_GTK3_INPUT+=" ../src/arch/gtk3/widgets/base"
71
72ARCH_SDL_INPUT=" ../src/arch/sdl"
73
74INPUT+=" ../src/core"
75INPUT+=" ../src/diag"
76INPUT+=" ../src/diskimage"
77INPUT+=" ../src/drive"
78INPUT+=" ../src/drive/iec"
79INPUT+=" ../src/fileio"
80INPUT+=" ../src/fsdevice"
81INPUT+=" ../src/gfxoutputdrv"
82INPUT+=" ../src/hwsiddrv"
83INPUT+=" ../src/iecbus"
84INPUT+=" ../src/imagecontents"
85INPUT+=" ../src/monitor"
86INPUT+=" ../src/parallel"
87INPUT+=" ../src/printerdrv"
88INPUT+=" ../src/raster"
89INPUT+=" ../src/rs232drv"
90INPUT+=" ../src/rtc"
91INPUT+=" ../src/samplerdrv"
92INPUT+=" ../src/serial"
93INPUT+=" ../src/sounddrv"
94INPUT+=" ../src/tape"
95INPUT+=" ../src/tapeport"
96INPUT+=" ../src/userport"
97INPUT+=" ../src/vdrive"
98INPUT+=" ../src/video"
99
100# external libs
101LIB_INPUT=" ../src/lib"
102LIB_INPUT+=" ../src/lib/libffmpeg"
103LIB_INPUT+=" ../src/lib/libffmpeg/libavcodec"
104LIB_INPUT+=" ../src/lib/libffmpeg/libavdevice"
105LIB_INPUT+=" ../src/lib/libffmpeg/libavformat"
106LIB_INPUT+=" ../src/lib/libffmpeg/libavutil"
107LIB_INPUT+=" ../src/lib/libffmpeg/libswscale"
108# FIXME: add subdirs
109LIB_INPUT+=" ../src/lib/liblame"
110# FIXME: add subdirs
111LIB_INPUT+=" ../src/lib/libx264"
112LIB_INPUT+=" ../src/lib/p64"
113
114# chips
115CRTC_INPUT=" ../src/crtc"
116VDC_INPUT=" ../src/vdc"
117VICII_INPUT=" ../src/vicii"
118VICIISC_INPUT=" ../src/viciisc"
119
120SID_INPUT=" ../src/resid"
121SID_INPUT+=" ../src/sid"
122
123DTVSID_INPUT=" ../src/resid-dtv"
124DTVSID_INPUT+=" ../src/sid"
125
126# machines
127
128VSID_INPUT=" ../src/c64"
129
130C64_INPUT=" ../src/c64"
131C64_INPUT+=" ../src/c64/cart"
132C64_INPUT+=" ../src/drive/iec/c64exp"
133C64_INPUT+=" ../src/drive/iecieee"
134C64_INPUT+=" ../src/drive/ieee"
135C64_INPUT+=" ../src/drive/tcbm"
136
137C128_INPUT=" ../src/c128"
138C128_INPUT+=" ../src/drive/iec128dcr"
139C128_INPUT+=" ../src/drive/iecieee"
140C128_INPUT+=" ../src/drive/ieee"
141C128_INPUT+=" ../src/drive/tcbm"
142
143DTV_INPUT=" ../src/c64dtv"
144DTV_INPUT+=" ../src/drive/iecieee"
145DTV_INPUT+=" ../src/drive/ieee"
146DTV_INPUT+=" ../src/drive/tcbm"
147
148CBM2_INPUT=" ../src/cbm2"
149CBM2_INPUT+=" ../src/drive/iecieee"
150CBM2_INPUT+=" ../src/drive/ieee"
151CBM2_INPUT+=" ../src/drive/tcbm"
152
153PET_INPUT=" ../src/pet"
154PET_INPUT+=" ../src/drive/iecieee"
155PET_INPUT+=" ../src/drive/ieee"
156PET_INPUT+=" ../src/drive/tcbm"
157
158PLUS4_INPUT=" ../src/plus4"
159PLUS4_INPUT+=" ../src/drive/iec/plus4exp"
160PLUS4_INPUT+=" ../src/drive/iecieee"
161PLUS4_INPUT+=" ../src/drive/ieee"
162PLUS4_INPUT+=" ../src/drive/tcbm"
163
164VIC20_INPUT=" ../src/vic20"
165VIC20_INPUT+=" ../src/vic20/cart"
166VIC20_INPUT+=" ../src/drive/iecieee"
167VIC20_INPUT+=" ../src/drive/ieee"
168VIC20_INPUT+=" ../src/drive/tcbm"
169
170C1541_INPUT=" ../src"
171
172CARTCONV_INPUT=" ../src"
173
174PETCAT_INPUT=" ../src"
175
176# machine
177case "$1" in
178"vsid")
179    INPUT+="$VSID_INPUT"
180    INPUT+="$SID_INPUT $VICII_INPUT"
181   ;;
182"x128")
183    INPUT+="$C128_INPUT"
184    INPUT+="$SID_INPUT $VICII_INPUT $VDC_INPUT"
185   ;;
186"x64")
187    INPUT+="$C64_INPUT"
188    INPUT+="$SID_INPUT $VICII_INPUT"
189   ;;
190"x64dtv")
191    INPUT+="$DTV_INPUT"
192    INPUT+="$DTVSID_INPUT $SID_INPUT"
193   ;;
194"x64sc")
195    INPUT+="$C64_INPUT"
196    INPUT+="$SID_INPUT $VICIISC_INPUT"
197   ;;
198"xcbm2")
199    INPUT+="$CBM2_INPUT"
200    INPUT+="$CRTC_INPUT"
201   ;;
202"xcbm5x0")
203    INPUT+="$CBM2_INPUT"
204    INPUT+="$SID_INPUT $VICII_INPUT"
205   ;;
206"xpet")
207    INPUT+="$PET_INPUT"
208    INPUT+="$CRTC_INPUT"
209   ;;
210"xplus4")
211    INPUT+="$PLUS4_INPUT"
212    INPUT+="$TED_INPUT"
213   ;;
214"xvic")
215    INPUT+="$VIC20_INPUT"
216    INPUT+="$VIC_INPUT"
217   ;;
218"xscpu64")
219    INPUT+="$C64_INPUT"
220    INPUT+="$SID_INPUT $VICII_INPUT"
221   ;;
222"cartconv")
223    INPUT+="$CARTCONV_INPUT"
224   ;;
225"c1541")
226    INPUT+="$C1541_INPUT"
227   ;;
228"petcat")
229    INPUT+="$PETCAT_INPUT"
230   ;;
231*)
232   ;;
233esac
234
235
236# port
237case "$2" in
238"linux")
239    ARCH_INPUT+="$ARCH_UNIX_INPUT"
240    ;;
241"win32")
242    ARCH_INPUT+="$ARCH_WIN32_INPUT"
243    ;;
244"osx")
245    ARCH_INPUT+="$ARCH_OSX_INPUT"
246    ;;
247*)
248    ;;
249esac
250
251# gui
252case "$3" in
253"gtk3")
254    ARCH_INPUT+="$ARCH_GTK3_INPUT"
255   ;;
256"sdl")
257    ARCH_INPUT+="$ARCH_SDL_INPUT"
258   ;;
259*)
260   ;;
261esac
262
263    INPUT+="$ARCH_INPUT $LIB_INPUT"
264    INCLUDE="$INPUT"
265}
266
267################################################################################
268# this function returns all files which should be excluded from the input for a
269# specific configuration.
270#
271# $1    machine
272# $2    port
273# $3    ui
274#
275# returns file(s) in EXCLUDE
276################################################################################
277function getexcludes
278{
279#echo "getting excludes for" $1 $2 $3
280
281ALWAYS_EXCLUDE=" ../src/monitor/mon_lex.c"
282ALWAYS_EXCLUDE+=" ../src/monitor/mon_parse.c"
283
284ARCH_LINUX_EXCLUDE=" ../src/sounddrv/soundaix.c"
285ARCH_LINUX_EXCLUDE+=" ../src/sounddrv/soundbeos.cc"
286ARCH_LINUX_EXCLUDE+=" ../src/sounddrv/soundallegro.c"
287ARCH_LINUX_EXCLUDE+=" ../src/sounddrv/soundhpux.c"
288ARCH_LINUX_EXCLUDE+=" ../src/sounddrv/soundsgi.c"
289ARCH_LINUX_EXCLUDE+=" ../src/sounddrv/soundsun.c"
290ARCH_LINUX_EXCLUDE+=" ../src/sounddrv/soundcoreaudio.c"
291ARCH_LINUX_EXCLUDE+=" ../src/sounddrv/soundmmos2.c"
292ARCH_LINUX_EXCLUDE+=" ../src/gfxoutputdrv/quicktimedrv.c"
293ARCH_LINUX_EXCLUDE+=" ../src/gfxoutputdrv/quicktimedrv.h"
294ARCH_LINUX_EXCLUDE+=" ../src/video/render1x1_dingoo.h"
295# FIXME: add non unix GTK3 stuff
296ARCH_LINUX_EXCLUDE+=" ../src/arch/gtk3/archdep_win32.c"
297ARCH_LINUX_EXCLUDE+=" ../src/arch/gtk3/archdep_win32.h"
298ARCH_LINUX_EXCLUDE+=" ../src/arch/gtk3/dynlib-win32.h"
299ARCH_LINUX_EXCLUDE+=" ../src/arch/gtk3/joy-osx-hid.h"
300ARCH_LINUX_EXCLUDE+=" ../src/arch/gtk3/joy-osx-hid.c"
301ARCH_LINUX_EXCLUDE+=" ../src/arch/gtk3/joy-osx-hidlib.h"
302ARCH_LINUX_EXCLUDE+=" ../src/arch/gtk3/joy-osx-hidmgr.c"
303ARCH_LINUX_EXCLUDE+=" ../src/arch/gtk3/joy-osx-hidutil.c"
304ARCH_LINUX_EXCLUDE+=" ../src/arch/gtk3/joy-osx.c"
305ARCH_LINUX_EXCLUDE+=" ../src/arch/gtk3/joy-osx.h"
306ARCH_LINUX_EXCLUDE+=" ../src/arch/gtk3/joy-win32-dinput-handle.c"
307ARCH_LINUX_EXCLUDE+=" ../src/arch/gtk3/joy-win32-dinput-handle.h"
308ARCH_LINUX_EXCLUDE+=" ../src/arch/gtk3/joy-win32.c"
309ARCH_LINUX_EXCLUDE+=" ../src/arch/gtk3/joy-win32.h"
310ARCH_LINUX_EXCLUDE+=" ../src/arch/gtk3/rawnetarch_win32.c"
311ARCH_LINUX_EXCLUDE+=" ../src/arch/gtk3/rs232-win32-dev.c"
312# FIXME: add non unix SDL stuff
313
314# FIXME: add non unix shared stuff
315ARCH_LINUX_EXCLUDE+=" ../src/arch/shared/dynlib-win32.c"
316ARCH_LINUX_EXCLUDE+=" ../src/arch/shared/archdep_win32.h"
317ARCH_LINUX_EXCLUDE+=" ../src/arch/shared/rawnetarch_win32.c"
318ARCH_LINUX_EXCLUDE+=" ../src/arch/shared/rs232-win32-dev.c"
319
320GUI_GTK3_EXCLUDE+=" ../src/vice_sdl.h"
321
322C64EXCLUDE+=" ../src/monitor/asm6502dtv.c"
323C64EXCLUDE+=" ../src/monitor/asmz80.c"
324C64EXCLUDE+=" ../src/monitor/mon_assemblez80.c"
325C64EXCLUDE+=" ../src/c1541.c"
326C64EXCLUDE+=" ../src/bin2c.c"
327C64EXCLUDE+=" ../src/cartconv.c"
328C64EXCLUDE+=" ../src/petcat.c"
329C64EXCLUDE+=" ../src/c128ui.h"
330C64EXCLUDE+=" ../src/cbm2ui.h"
331C64EXCLUDE+=" ../src/petui.h"
332C64EXCLUDE+=" ../src/plus4ui.h"
333C64EXCLUDE+=" ../src/vic20ui.h"
334C64EXCLUDE+=" ../src/z80regs.h"
335C64EXCLUDE+=" ../src/mainviccpu.c"
336
337X64EXCLUDE="$C64EXCLUDE"
338X64EXCLUDE+=" ../src/c64/vsidstubs.c"
339X64EXCLUDE+=" ../src/c64/vsidmem.c"
340X64EXCLUDE+=" ../src/c64/vsid.c"
341X64EXCLUDE+=" ../src/vsidui.h"
342
343X64SCEXCLUDE="$C64EXCLUDE"
344X64SCEXCLUDE+=" ../src/c64/vsidstubs.c"
345X64SCEXCLUDE+=" ../src/c64/vsidmem.c"
346X64SCEXCLUDE+=" ../src/c64/vsid.c"
347X64SCEXCLUDE+=" ../src/c64/c64mem.c"
348X64SCEXCLUDE+=" ../src/c64/c64model.c"
349X64SCEXCLUDE+=" ../src/6510core.c"
350X64SCEXCLUDE+=" ../src/vsidui.h"
351X64SCEXCLUDE+=" ../src/maincpu.c"
352
353VSIDEXCLUDE="$C64EXCLUDE"
354
355TOOLSEXCLUDE=" ../src/6510core.c"
356TOOLSEXCLUDE+=" ../src/6510dtvcore.c"
357TOOLSEXCLUDE+=" ../src/65816core.c"
358TOOLSEXCLUDE+=" ../src/65c02core.c"
359TOOLSEXCLUDE+=" ../src/aciacore.c"
360TOOLSEXCLUDE+=" ../src/alarm.c"
361TOOLSEXCLUDE+=" ../src/attach.c"
362TOOLSEXCLUDE+=" ../src/autostart.c"
363TOOLSEXCLUDE+=" ../src/autostart-prg.c"
364TOOLSEXCLUDE+=" ../src/clipboard.c"
365TOOLSEXCLUDE+=" ../src/clkguard.c"
366TOOLSEXCLUDE+=" ../src/cmdline.c"
367TOOLSEXCLUDE+=" ../src/color.c"
368TOOLSEXCLUDE+=" ../src/crc32.c"
369TOOLSEXCLUDE+=" ../src/debug.c"
370TOOLSEXCLUDE+=" ../src/digimaxcore.c"
371TOOLSEXCLUDE+=" ../src/dma.c"
372TOOLSEXCLUDE+=" ../src/embedded.c"
373TOOLSEXCLUDE+=" ../src/event.c"
374TOOLSEXCLUDE+=" ../src/findpath.c"
375TOOLSEXCLUDE+=" ../src/fixpoint.c"
376TOOLSEXCLUDE+=" ../src/fliplist.c"
377TOOLSEXCLUDE+=" ../src/gcr.c"
378TOOLSEXCLUDE+=" ../src/info.c"
379TOOLSEXCLUDE+=" ../src/init.c"
380TOOLSEXCLUDE+=" ../src/initcmdline.c"
381TOOLSEXCLUDE+=" ../src/interrupt.c"
382TOOLSEXCLUDE+=" ../src/ioutil.c"
383TOOLSEXCLUDE+=" ../src/kbdbuf.c"
384TOOLSEXCLUDE+=" ../src/keyboard.c"
385TOOLSEXCLUDE+=" ../src/lib.c"
386TOOLSEXCLUDE+=" ../src/machine-bus.c"
387TOOLSEXCLUDE+=" ../src/machine.c"
388TOOLSEXCLUDE+=" ../src/main65816cpu.c"
389TOOLSEXCLUDE+=" ../src/main.c"
390TOOLSEXCLUDE+=" ../src/mainc64cpu.c"
391TOOLSEXCLUDE+=" ../src/maincpu.c"
392TOOLSEXCLUDE+=" ../src/mainlock.c"
393TOOLSEXCLUDE+=" ../src/mainviccpu.c"
394TOOLSEXCLUDE+=" ../src/midi.c"
395TOOLSEXCLUDE+=" ../src/network.c"
396TOOLSEXCLUDE+=" ../src/opencbmlib.c"
397TOOLSEXCLUDE+=" ../src/palette.c"
398TOOLSEXCLUDE+=" ../src/piacore.c"
399TOOLSEXCLUDE+=" ../src/ps2mouse.c"
400TOOLSEXCLUDE+=" ../src/ram.c"
401TOOLSEXCLUDE+=" ../src/rawfile.c"
402TOOLSEXCLUDE+=" ../src/rawnet.c"
403TOOLSEXCLUDE+=" ../src/resources.c"
404TOOLSEXCLUDE+=" ../src/romset.c"
405TOOLSEXCLUDE+=" ../src/screenshot.c"
406TOOLSEXCLUDE+=" ../src/snapshot.c"
407TOOLSEXCLUDE+=" ../src/socket.c"
408TOOLSEXCLUDE+=" ../src/sound.c"
409TOOLSEXCLUDE+=" ../src/sysfile.c"
410TOOLSEXCLUDE+=" ../src/traps.c"
411TOOLSEXCLUDE+=" ../src/usleep.c"
412TOOLSEXCLUDE+=" ../src/util.c"
413TOOLSEXCLUDE+=" ../src/vicefeatures.c"
414TOOLSEXCLUDE+=" ../src/vsync.c"
415
416TOOLSEXCLUDE+=" ../src/6510core.h"
417TOOLSEXCLUDE+=" ../src/acia.h"
418TOOLSEXCLUDE+=" ../src/alarm.h"
419TOOLSEXCLUDE+=" ../src/archapi.h"
420TOOLSEXCLUDE+=" ../src/attach.h"
421TOOLSEXCLUDE+=" ../src/autostart.h"
422TOOLSEXCLUDE+=" ../src/autostart-prg.h"
423TOOLSEXCLUDE+=" ../src/c128ui.h"
424TOOLSEXCLUDE+=" ../src/c64ui.h"
425TOOLSEXCLUDE+=" ../src/cartio.h"
426TOOLSEXCLUDE+=" ../src/catweaselmkiii.h"
427TOOLSEXCLUDE+=" ../src/cbm2ui.h"
428TOOLSEXCLUDE+=" ../src/cbmdos.h"
429TOOLSEXCLUDE+=" ../src/cbmimage.h"
430TOOLSEXCLUDE+=" ../src/cia.h"
431TOOLSEXCLUDE+=" ../src/clipboard.h"
432TOOLSEXCLUDE+=" ../src/clkguard.h"
433TOOLSEXCLUDE+=" ../src/color.h"
434TOOLSEXCLUDE+=" ../src/config.h"
435TOOLSEXCLUDE+=" ../src/console.h"
436TOOLSEXCLUDE+=" ../src/crc32.h"
437TOOLSEXCLUDE+=" ../src/debug.h"
438TOOLSEXCLUDE+=" ../src/diskconstants.h"
439TOOLSEXCLUDE+=" ../src/diskimage.h"
440TOOLSEXCLUDE+=" ../src/dma.h"
441TOOLSEXCLUDE+=" ../src/dynlib.h"
442TOOLSEXCLUDE+=" ../src/embedded.h"
443TOOLSEXCLUDE+=" ../src/export.h"
444TOOLSEXCLUDE+=" ../src/fileio.h"
445TOOLSEXCLUDE+=" ../src/findpath.h"
446TOOLSEXCLUDE+=" ../src/fixpoint.h"
447TOOLSEXCLUDE+=" ../src/flash040.h"
448TOOLSEXCLUDE+=" ../src/fliplist.h"
449TOOLSEXCLUDE+=" ../src/fsdevice.h"
450TOOLSEXCLUDE+=" ../src/fullscreen.h"
451TOOLSEXCLUDE+=" ../src/gcr.h"
452TOOLSEXCLUDE+=" ../src/gfxoutput.h"
453TOOLSEXCLUDE+=" ../src/h6809regs.h"
454TOOLSEXCLUDE+=" ../src/hardsid.h"
455TOOLSEXCLUDE+=" ../src/iecbus.h"
456TOOLSEXCLUDE+=" ../src/iecdrive.h"
457TOOLSEXCLUDE+=" ../src/imagecontents.h"
458TOOLSEXCLUDE+=" ../src/infocontrib.h"
459TOOLSEXCLUDE+=" ../src/info.h"
460TOOLSEXCLUDE+=" ../src/initcmdline.h"
461TOOLSEXCLUDE+=" ../src/init.h"
462TOOLSEXCLUDE+=" ../src/interrupt.h"
463TOOLSEXCLUDE+=" ../src/ioutil.h"
464TOOLSEXCLUDE+=" ../src/kbdbuf.h"
465TOOLSEXCLUDE+=" ../src/keyboard.h"
466TOOLSEXCLUDE+=" ../src/lib.h"
467TOOLSEXCLUDE+=" ../src/log.h"
468TOOLSEXCLUDE+=" ../src/machine-bus.h"
469TOOLSEXCLUDE+=" ../src/machine-drive.h"
470TOOLSEXCLUDE+=" ../src/machine.h"
471TOOLSEXCLUDE+=" ../src/machine-printer.h"
472TOOLSEXCLUDE+=" ../src/machine-video.h"
473TOOLSEXCLUDE+=" ../src/main65816cpu.h"
474TOOLSEXCLUDE+=" ../src/mainc64cpu.h"
475TOOLSEXCLUDE+=" ../src/maincpu.h"
476TOOLSEXCLUDE+=" ../src/main.h"
477TOOLSEXCLUDE+=" ../src/mainlock.h"
478TOOLSEXCLUDE+=" ../src/mem.h"
479TOOLSEXCLUDE+=" ../src/mididrv.h"
480TOOLSEXCLUDE+=" ../src/midi.h"
481TOOLSEXCLUDE+=" ../src/monitor.h"
482TOOLSEXCLUDE+=" ../src/mos6510dtv.h"
483TOOLSEXCLUDE+=" ../src/mos6510.h"
484TOOLSEXCLUDE+=" ../src/network.h"
485TOOLSEXCLUDE+=" ../src/opencbm.h"
486TOOLSEXCLUDE+=" ../src/opencbmlib.h"
487TOOLSEXCLUDE+=" ../src/palette.h"
488TOOLSEXCLUDE+=" ../src/parallel.h"
489TOOLSEXCLUDE+=" ../src/parsid.h"
490TOOLSEXCLUDE+=" ../src/petui.h"
491TOOLSEXCLUDE+=" ../src/piacore.h"
492TOOLSEXCLUDE+=" ../src/plus4ui.h"
493TOOLSEXCLUDE+=" ../src/printer.h"
494TOOLSEXCLUDE+=" ../src/ps2mouse.h"
495TOOLSEXCLUDE+=" ../src/r65c02.h"
496TOOLSEXCLUDE+=" ../src/ram.h"
497TOOLSEXCLUDE+=" ../src/rawfile.h"
498TOOLSEXCLUDE+=" ../src/rawnetarch.h"
499TOOLSEXCLUDE+=" ../src/rawnet.h"
500TOOLSEXCLUDE+=" ../src/resources.h"
501TOOLSEXCLUDE+=" ../src/riot.h"
502TOOLSEXCLUDE+=" ../src/romset.h"
503TOOLSEXCLUDE+=" ../src/scpu64ui.h"
504TOOLSEXCLUDE+=" ../src/screenshot.h"
505TOOLSEXCLUDE+=" ../src/serial.h"
506TOOLSEXCLUDE+=" ../src/sidcart.h"
507TOOLSEXCLUDE+=" ../src/signals.h"
508TOOLSEXCLUDE+=" ../src/snapshot.h"
509TOOLSEXCLUDE+=" ../src/sound.h"
510TOOLSEXCLUDE+=" ../src/ssi2001.h"
511TOOLSEXCLUDE+=" ../src/sysfile.h"
512TOOLSEXCLUDE+=" ../src/tape.h"
513TOOLSEXCLUDE+=" ../src/tap.h"
514TOOLSEXCLUDE+=" ../src/tpi.h"
515TOOLSEXCLUDE+=" ../src/traps.h"
516TOOLSEXCLUDE+=" ../src/types.h"
517TOOLSEXCLUDE+=" ../src/uiapi.h"
518TOOLSEXCLUDE+=" ../src/uicmdline.h"
519TOOLSEXCLUDE+=" ../src/uicolor.h"
520TOOLSEXCLUDE+=" ../src/uimon.h"
521TOOLSEXCLUDE+=" ../src/usleep.h"
522TOOLSEXCLUDE+=" ../src/util.h"
523TOOLSEXCLUDE+=" ../src/via.h"
524TOOLSEXCLUDE+=" ../src/vic20ui.h"
525TOOLSEXCLUDE+=" ../src/vice-event.h"
526TOOLSEXCLUDE+=" ../src/vicefeatures.h"
527TOOLSEXCLUDE+=" ../src/vicemaxpath.h"
528TOOLSEXCLUDE+=" ../src/vice_sdl.h"
529TOOLSEXCLUDE+=" ../src/vicesocket.h"
530TOOLSEXCLUDE+=" ../src/vicii.h"
531TOOLSEXCLUDE+=" ../src/video.h"
532TOOLSEXCLUDE+=" ../src/viewport.h"
533TOOLSEXCLUDE+=" ../src/vsidui.h"
534TOOLSEXCLUDE+=" ../src/vsyncapi.h"
535TOOLSEXCLUDE+=" ../src/vsync.h"
536TOOLSEXCLUDE+=" ../src/wdc65816.h"
537TOOLSEXCLUDE+=" ../src/z80regs.h"
538TOOLSEXCLUDE+=" ../src/zfile.h"
539TOOLSEXCLUDE+=" ../src/zipcode.h"
540
541TOOLSEXCLUDE+=" ../src/core"
542TOOLSEXCLUDE+=" ../src/diag"
543TOOLSEXCLUDE+=" ../src/diskimage"
544TOOLSEXCLUDE+=" ../src/drive"
545TOOLSEXCLUDE+=" ../src/drive/iec"
546TOOLSEXCLUDE+=" ../src/fileio"
547TOOLSEXCLUDE+=" ../src/gfxoutputdrv"
548TOOLSEXCLUDE+=" ../src/hwsiddrv"
549TOOLSEXCLUDE+=" ../src/iecbus"
550TOOLSEXCLUDE+=" ../src/imagecontents"
551TOOLSEXCLUDE+=" ../src/monitor"
552TOOLSEXCLUDE+=" ../src/parallel"
553TOOLSEXCLUDE+=" ../src/printerdrv"
554TOOLSEXCLUDE+=" ../src/raster"
555TOOLSEXCLUDE+=" ../src/rs232drv"
556TOOLSEXCLUDE+=" ../src/rtc"
557TOOLSEXCLUDE+=" ../src/samplerdrv"
558TOOLSEXCLUDE+=" ../src/serial"
559TOOLSEXCLUDE+=" ../src/sounddrv"
560TOOLSEXCLUDE+=" ../src/tape"
561TOOLSEXCLUDE+=" ../src/tapeport"
562TOOLSEXCLUDE+=" ../src/userport"
563TOOLSEXCLUDE+=" ../src/video"
564TOOLSEXCLUDE+=" ../src/lib"
565TOOLSEXCLUDE+=" ../src/lib/libffmpeg"
566TOOLSEXCLUDE+=" ../src/lib/libffmpeg/libavcodec"
567TOOLSEXCLUDE+=" ../src/lib/libffmpeg/libavdevice"
568TOOLSEXCLUDE+=" ../src/lib/libffmpeg/libavformat"
569TOOLSEXCLUDE+=" ../src/lib/libffmpeg/libavutil"
570TOOLSEXCLUDE+=" ../src/lib/libffmpeg/libswscale"
571# FIXME: add subdirs
572TOOLSEXCLUDE+=" ../src/lib/liblame"
573# FIXME: add subdirs
574TOOLSEXCLUDE+=" ../src/lib/libx264"
575TOOLSEXCLUDE+=" ../src/lib/p64"
576
577TOOLSEXCLUDE+=" ../src/arch/gtk3"
578TOOLSEXCLUDE+=" ../src/arch/gtk3/widgets"
579TOOLSEXCLUDE+=" ../src/arch/gtk3/widgets/base"
580TOOLSEXCLUDE+=" ../src/arch/sdl"
581
582CARTCONVEXCLUDE="$TOOLSEXCLUDE"
583CARTCONVEXCLUDE+=" ../src/c1541.c"
584CARTCONVEXCLUDE+=" ../src/petcat.c"
585CARTCONVEXCLUDE+=" ../src/vdrive"
586CARTCONVEXCLUDE+=" ../src/fsdevice"
587CARTCONVEXCLUDE+=" ../src/cbmdos.c"
588CARTCONVEXCLUDE+=" ../src/cbmimage.c"
589CARTCONVEXCLUDE+=" ../src/charset.c"
590CARTCONVEXCLUDE+=" ../src/log.c"
591CARTCONVEXCLUDE+=" ../src/zfile.c"
592CARTCONVEXCLUDE+=" ../src/zipcode.c"
593#CARTCONVEXCLUDE+=" ../src/charset.h"
594#CARTCONVEXCLUDE+=" ../src/cmdline.h"
595
596PETCATEXCLUDE="$TOOLSEXCLUDE"
597PETCATEXCLUDE+=" ../src/c1541.c"
598PETCATEXCLUDE+=" ../src/cartconv.c"
599PETCATEXCLUDE+=" ../src/vdrive"
600PETCATEXCLUDE+=" ../src/fsdevice"
601PETCATEXCLUDE+=" ../src/cbmdos.c"
602PETCATEXCLUDE+=" ../src/cbmimage.c"
603#PETCATEXCLUDE+=" ../src/charset.c"
604PETCATEXCLUDE+=" ../src/log.c"
605PETCATEXCLUDE+=" ../src/zfile.c"
606PETCATEXCLUDE+=" ../src/zipcode.c"
607PETCATEXCLUDE+=" ../src/cartridge.h"
608#PETCATEXCLUDE+=" ../src/charset.h"
609#PETCATEXCLUDE+=" ../src/cmdline.h"
610
611C1541EXCLUDE="$TOOLSEXCLUDE"
612C1541EXCLUDE+=" ../src/cartconv.c"
613C1541EXCLUDE+=" ../src/petcat.c"
614#C1541EXCLUDE+=" ../src/cbmdos.c"
615#C1541EXCLUDE+=" ../src/cbmimage.c"
616#C1541EXCLUDE+=" ../src/charset.c"
617#C1541EXCLUDE+=" ../src/log.c"
618#C1541EXCLUDE+=" ../src/zfile.c"
619#C1541EXCLUDE+=" ../src/zipcode.c"
620C1541EXCLUDE+=" ../src/cartridge.h"
621C1541EXCLUDE+=" ../src/charset.h"
622C1541EXCLUDE+=" ../src/cmdline.h"
623
624C64_GUI_GTK3_EXCLUDE=" ../src/arch/gtk3/c64dtvui.c"
625C64_GUI_GTK3_EXCLUDE+=" ../src/arch/gtk3/c128ui.c"
626C64_GUI_GTK3_EXCLUDE+=" ../src/arch/gtk3/cbm2ui.c"
627C64_GUI_GTK3_EXCLUDE+=" ../src/arch/gtk3/cbm5x0ui.c"
628C64_GUI_GTK3_EXCLUDE+=" ../src/arch/gtk3/petui.c"
629C64_GUI_GTK3_EXCLUDE+=" ../src/arch/gtk3/plus4ui.c"
630C64_GUI_GTK3_EXCLUDE+=" ../src/arch/gtk3/scpu64ui.c"
631C64_GUI_GTK3_EXCLUDE+=" ../src/arch/gtk3/vic20ui.c"
632
633X64_GUI_GTK3_EXCLUDE="$C64_GUI_GTK3_EXCLUDE"
634X64_GUI_GTK3_EXCLUDE+=" ../src/arch/gtk3/c64scui.c"
635X64_GUI_GTK3_EXCLUDE+=" ../src/arch/gtk3/vsidui.c"
636X64_GUI_GTK3_EXCLUDE+=" ../src/arch/gtk3/vsidui.h"
637
638X64SC_GUI_GTK3_EXCLUDE="$C64_GUI_GTK3_EXCLUDE"
639X64SC_GUI_GTK3_EXCLUDE+=" ../src/arch/gtk3/c64ui.c"
640X64SC_GUI_GTK3_EXCLUDE+=" ../src/arch/gtk3/vsidui.c"
641X64SC_GUI_GTK3_EXCLUDE+=" ../src/arch/gtk3/vsidui.h"
642
643VSID_GUI_GTK3_EXCLUDE="$C64_GUI_GTK3_EXCLUDE"
644VSID_GUI_GTK3_EXCLUDE+=" ../src/arch/gtk3/c64ui.c"
645VSID_GUI_GTK3_EXCLUDE+=" ../src/arch/gtk3/c64scui.c"
646
647TOOLS_GUI_GTK3_EXCLUDE="$C64_GUI_GTK3_EXCLUDE"
648TOOLS_GUI_GTK3_EXCLUDE+=" ../src/arch/gtk3/vsidui.c"
649TOOLS_GUI_GTK3_EXCLUDE+=" ../src/arch/gtk3/vsidui.h"
650TOOLS_GUI_GTK3_EXCLUDE+=" ../src/arch/gtk3/c64ui.c"
651TOOLS_GUI_GTK3_EXCLUDE+=" ../src/arch/gtk3/c64scui.c"
652
653CARTCONV_GUI_GTK3_EXCLUDE="$TOOLS_GUI_GTK3_EXCLUDE"
654
655C1541_GUI_GTK3_EXCLUDE="$TOOLS_GUI_GTK3_EXCLUDE"
656
657PETCONV_GUI_GTK3_EXCLUDE="$TOOLS_GUI_GTK3_EXCLUDE"
658
659
660# machine
661case "$1" in
662"vsid")
663    MACHINE_EXCLUDE="$VSIDEXCLUDE"
664    GUI_GTK3_EXCLUDE+="$VSID_GUI_GTK3_EXCLUDE"
665    GUI_SDL_EXCLUDE+="$VSID_GUI_SDL_EXCLUDE"
666   ;;
667"x128")
668    MACHINE_EXCLUDE="$X128EXCLUDE"
669    GUI_GTK3_EXCLUDE+="$X128_GUI_GTK3_EXCLUDE"
670    GUI_SDL_EXCLUDE+="$X128_GUI_SDL_EXCLUDE"
671   ;;
672"x64")
673    MACHINE_EXCLUDE="$X64EXCLUDE"
674    GUI_GTK3_EXCLUDE+="$X64_GUI_GTK3_EXCLUDE"
675    GUI_SDL_EXCLUDE+="$X64_GUI_SDL_EXCLUDE"
676   ;;
677"x64dtv")
678    MACHINE_EXCLUDE="$X64DTVEXCLUDE"
679    GUI_GTK3_EXCLUDE+="$X64DTV_GUI_GTK3_EXCLUDE"
680    GUI_SDL_EXCLUDE+="$X64DTV_GUI_SDL_EXCLUDE"
681   ;;
682"x64sc")
683    MACHINE_EXCLUDE="$X64SCEXCLUDE"
684    GUI_GTK3_EXCLUDE+="$X64SC_GUI_GTK3_EXCLUDE"
685    GUI_SDL_EXCLUDE+="$X64SC_GUI_SDL_EXCLUDE"
686   ;;
687"xcbm2")
688    MACHINE_EXCLUDE="$XCBM2EXCLUDE"
689    GUI_GTK3_EXCLUDE+="$XCBM2_GUI_GTK3_EXCLUDE"
690    GUI_SDL_EXCLUDE+="$XCBM2_GUI_SDL_EXCLUDE"
691   ;;
692"xcbm5x0")
693    MACHINE_EXCLUDE="$XCBM5X0EXCLUDE"
694    GUI_GTK3_EXCLUDE+="$XCBM5X0_GUI_GTK3_EXCLUDE"
695    GUI_SDL_EXCLUDE+="$XCBM5X0_GUI_SDL_EXCLUDE"
696   ;;
697"xpet")
698    MACHINE_EXCLUDE="$XPETEXCLUDE"
699    GUI_GTK3_EXCLUDE+="$XPET_GUI_GTK3_EXCLUDE"
700    GUI_SDL_EXCLUDE+="$XPET_GUI_SDL_EXCLUDE"
701   ;;
702"xplus4")
703    MACHINE_EXCLUDE="$XPLUS4EXCLUDE"
704    GUI_GTK3_EXCLUDE+="$XPLUS4_GUI_GTK3_EXCLUDE"
705    GUI_SDL_EXCLUDE+="$XPLUS4_GUI_SDL_EXCLUDE"
706   ;;
707"xvic")
708    MACHINE_EXCLUDE="$XVICEXCLUDE"
709    GUI_GTK3_EXCLUDE+="$XVIC_GUI_GTK3_EXCLUDE"
710    GUI_SDL_EXCLUDE+="$XVIC_GUI_SDL_EXCLUDE"
711   ;;
712"xscpu64")
713    MACHINE_EXCLUDE="$XSCPU64EXCLUDE"
714    GUI_GTK3_EXCLUDE+="$XSCPU64_GUI_GTK3_EXCLUDE"
715    GUI_SDL_EXCLUDE+="$XSCPU64_GUI_SDL_EXCLUDE"
716   ;;
717"cartconv")
718    MACHINE_EXCLUDE="$CARTCONVEXCLUDE"
719    GUI_GTK3_EXCLUDE+="$CARTCONV_GUI_GTK3_EXCLUDE"
720    GUI_SDL_EXCLUDE+="$CARTCONV_GUI_SDL_EXCLUDE"
721   ;;
722"c1541")
723    MACHINE_EXCLUDE="$C1541EXCLUDE"
724    GUI_GTK3_EXCLUDE+="$C1541_GUI_GTK3_EXCLUDE"
725    GUI_SDL_EXCLUDE+="$C1541_GUI_SDL_EXCLUDE"
726   ;;
727"petcat")
728    MACHINE_EXCLUDE="$PETCATEXCLUDE"
729    GUI_GTK3_EXCLUDE+="$PETCAT_GUI_GTK3_EXCLUDE"
730    GUI_SDL_EXCLUDE+="$PETCAT_GUI_SDL_EXCLUDE"
731   ;;
732*)
733   ;;
734esac
735
736# port
737case "$2" in
738"linux")
739    ARCH_EXCLUDE="$ARCH_LINUX_EXCLUDE"
740   ;;
741"win32")
742    ARCH_EXCLUDE="$ARCH_WIN32_EXCLUDE"
743   ;;
744"osx")
745    ARCH_EXCLUDE="$ARCH_OSX_EXCLUDE"
746   ;;
747*)
748   ;;
749esac
750
751# gui
752case "$3" in
753"gtk3")
754    GUI_EXCLUDE="$GUI_GTK3_EXCLUDE"
755   ;;
756"sdl")
757    GUI_EXCLUDE="$GUI_SDL_EXCLUDE"
758   ;;
759*)
760   ;;
761esac
762
763EXCLUDE="$ALWAYS_EXCLUDE $MACHINE_EXCLUDE $ARCH_EXCLUDE $GUI_EXCLUDE"
764
765}
766
767################################################################################
768# this function creates the documentation for one specific configuration
769#
770# $1    machine
771# $2    port
772# $3    ui
773################################################################################
774function makedocs
775{
776    echo "making docs for "$1" source ("$2", "$3") ["$VERSION"]"
777    OUTPUT="./doxy/"$1"/"
778    rm -rf $OUTPUT
779    mkdir -p $OUTPUT
780    getinputs $1 $2 $3
781    getexcludes $1 $2 $3
782    echo "INPUT="$INPUT
783    echo "INCLUDE_PATH="$INCLUDE
784    echo "EXCLUDE="$EXCLUDE
785    echo "PREDEFINED="$PREDEFINED
786(cat Doxyfile ;\
787     echo "INPUT=" $INPUT ;\
788     echo "OUTPUT_DIRECTORY=" $OUTPUT ;\
789     echo "INCLUDE_PATH=" $INCLUDE ;\
790     echo "EXCLUDE=" $EXCLUDE ;\
791     echo "PREDEFINED="$PREDEFINE ;\
792     echo "PROJECT_NAME="$1 ;\
793     echo "PROJECT_NUMBER="$VERSION ;\
794    ) | doxygen -
795}
796
797################################################################################
798# this function creates and index.html entry page in ./doxy
799################################################################################
800
801function makeindex
802{
803    echo "making index.html"
804    OUTPUT="./doxy/index.html"
805
806    echo "<html><head>" > $OUTPUT
807    echo "<title>VICE doxy</title></head><body>" >> $OUTPUT
808    echo "<h1>VICE doxy</h1>" >> $OUTPUT
809
810    for I in x64 x64sc x64dtv xscpu64 x128 xcbm2 xcbm5x0 xpet xplus4 xvic vsid c1541 cartconv petcat; do \
811        if [ -a ./doxy/$I ]; then \
812            echo $I; \
813            echo "<a href=\""$I"/html/index.html\">"$I"</a>" >> $OUTPUT; \
814        fi; \
815    done
816
817    echo "</body></html>" >> $OUTPUT
818}
819
820################################################################################
821# handle commandline arguments
822################################################################################
823
824# TODO: detect port/ui automatically
825# TODO: optionally enable call graphs
826# TODO: optionally enable source browser
827
828# defaults
829MACHINE="all"
830PORT="linux"
831GUI="gtk3"
832
833
834# Check for --help
835if [ "$1" = "--help" ]; then
836    cat << EOF
837Usage: ./mkdoxy.sh [machine=$MACHINE [port=$PORT [gui=$GUI]]] | clean | --help
838
839    Where "machine" is one of 'all', 'tools', 'vsid', 'x128, 'x64', 'x64dtv',
840    'x64sc', 'xcbm2', 'xcbm5x0', 'xpet', 'xplus4', 'xvic', 'xscpu64',
841    'c1541', 'cartconv' or 'petcat', "port" is one of 'linux', 'win32' or
842    'osx2', and "gui" is one of 'gtk3' or 'sdl'.
843
844    When given '--help', this text is shown, when given 'clean', the generated
845    files in doc/doxy are deleted.
846EOF
847    exit 0
848fi
849
850
851# Check for clean
852if [ "$1" = "clean" ]; then
853    echo "Cleaning Doxygen docs."
854    rm -rfd ./doxy/*
855    exit 0
856fi
857
858
859# machine
860case "$1" in
861"all")
862   MACHINE="all"
863   ;;
864"tools")
865   MACHINE="tools"
866   ;;
867"vsid")
868   MACHINE="vsid"
869   ;;
870"x128")
871   MACHINE="x128"
872   ;;
873"x64")
874   MACHINE="x64"
875   ;;
876"x64dtv")
877   MACHINE="x64dtv"
878   ;;
879"x64sc")
880   MACHINE="x64sc"
881   ;;
882"xcbm2")
883   MACHINE="xcbm2"
884   ;;
885"xcbm5x0")
886   MACHINE="xcbm5x0"
887   ;;
888"xpet")
889   MACHINE="xpet"
890   ;;
891"xplus4")
892   MACHINE="xplus4"
893   ;;
894"xvic")
895   MACHINE="xvic"
896   ;;
897"xscpu64")
898   MACHINE="xscpu64"
899   ;;
900"cartconv")
901   MACHINE="cartconv"
902   ;;
903"petcat")
904   MACHINE="petcat"
905   ;;
906"c1541")
907   MACHINE="c1541"
908   ;;
909*)
910    # make sure we don't error out on an empty MACHINE, empty means 'all':
911    if [ x"$1" != "x" ]; then
912        echo "Error: unknown machine '$1'."
913        echo "Use ./mkdoxy.sh --help to get a list of supported machines."
914        exit 1
915    fi
916   ;;
917esac
918
919
920# port
921case "$2" in
922"linux")
923   PORT="linux"
924   GUI="gtk3"
925   ;;
926"win32")
927   PORT="win32"
928   GUI="gtk3"
929   ;;
930"osx")
931   PORT="osx"
932   GUI="gtk3"
933   ;;
934*)
935   ;;
936esac
937
938# gui
939case "$3" in
940"gtk3")
941   GUI="gtk3"
942   ;;
943"sdl")
944   GUI="sdl"
945   ;;
946*)
947   ;;
948esac
949
950VERSION=`grep " VERSION " ../src/config.h | sed 's:#define VERSION \"\(.*\)\":\1:'`
951PREDEFINED=`cpp -dD < ../src/config.h | grep define | sed -s 's:#define ::g' | sed -s 's: :=:' | sed -s 's:=$::' | grep -v '__' | tr '\n' ' '`
952
953#echo $MACHINE $PORT $GUI
954
955case "$MACHINE" in
956"all")
957    makedocs "vsid" $PORT $GUI
958    makedocs "x128" $PORT $GUI
959    makedocs "x64" $PORT $GUI
960    makedocs "x64dtv" $PORT $GUI
961    makedocs "x64sc" $PORT $GUI
962    makedocs "xcbm2" $PORT $GUI
963    makedocs "xcbm5x0" $PORT $GUI
964    makedocs "xpet" $PORT $GUI
965    makedocs "xplus4" $PORT $GUI
966    makedocs "xvic" $PORT $GUI
967    makedocs "xscpu64" $PORT $GUI
968    makedocs "petcat" $PORT $GUI
969    makedocs "cartconv" $PORT $GUI
970    makedocs "c1541" $PORT $GUI
971   ;;
972"tools")
973    makedocs "petcat" $PORT $GUI
974    makedocs "cartconv" $PORT $GUI
975    makedocs "c1541" $PORT $GUI
976   ;;
977*)
978    makedocs $MACHINE $PORT $GUI
979   ;;
980esac
981
982makeindex
983