ifdef WIN32CROSS
OPT = WIN32CROSS=1 \

endif

.PHONY:	all tools grafx2 ziprelease 3rdparty win32installer \
        doc doxygen docarchive doxygenarchive htmldoc \
        updateversion unicodefonts check

all:	grafx2 tools

doc:	doxygen

docarchive:	doxygenarchive

check:
	$(OPT)$(MAKE) -C src/ check

grafx2:	unicodefonts
	$(OPT)$(MAKE) -C src/

unicodefonts:
	$(MAKE) -C tools/8x8fonts/

ziprelease: grafx2
	$(OPT)$(MAKE) -C src/ ziprelease

tools:	src/version.c
	$(MAKE) -C tools/

3rdparty:
	cd 3rdparty/ && $(OPT)$(MAKE) importgpgkeys
	cd 3rdparty/ && $(OPT)$(MAKE)

win32installer:
	$(MAKE) -C install/

# generate Doxygen to doc/doxygen
doxygen:
	$(MAKE) -C tools/ doxygen

doxygenarchive:
	$(MAKE) -C tools/ doxygenarchive

# generate HTML doc to doc/html
htmldoc:
	$(MAKE) -C src/ htmldoc

# this C file is generated by the build
src/version.c:	grafx2

updateversion:	src/version.c
	$(MAKE) -C src gfx2.rc
	$(MAKE) -C install/ updateversion
