#!/usr/bin/make -f
## /*
## Dragon Go Server
## Copyright (C) 2001-  Erik Ouchterlony, Rod Ival
## 
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU Affero General Public License as
## published by the Free Software Foundation, either version 3 of the
## License, or (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU Affero General Public License for more details.
##
## You should have received a copy of the GNU Affero General Public License
## along with this program.  If not, see <http://www.gnu.org/licenses/>.
## */

# Use 'make -f images_makefile' to generate the images

# Needed software: (later versions might work too)
# povray 3.5
# gimp 1.2
# gimp-perl 1.2

SIZES = 5 7 9 11 13 17 21 25 29 35 42 50

BOARD_SIZES = 5/board 7/board 9/board 11/board 13/board 17/board 21/board 25/board 29/board 35/board 42/board 50/board

STONES_SIZES = 5/stones 7/stones 9/stones 11/stones 13/stones 17/stones 21/stones 25/stones 29/stones 35/stones 42/stones 50/stones

BIGSTONES = BigWhite.png BigBlack.png BigBlackMark.png BigWhiteMark.png YinYang.png BigPlayBlack.png BigPlayWhite.png BigBlackBlack.png BigBlackWhite.png BigWhiteBlack.png BigWhiteWhite.png
#BIGSTONES_POV = BigBlack_pov.png BigWhite_pov.png YinYang_pov.png BigPlayBlack_pov.png BigPlayWhite_pov.png

POVFILES = stone.inc stone.pov

POVRAY = povray
POVRAY_ARGS = +D +sp16 +ep4 -P -V +UA +A +J +W1024 +H768 +FN
#POVRAY_ARGS = +D +sp16 +ep4 -P -V +UA +J +W512 +H384 +FN

target: $(BIGSTONES) board stones

BigPlayBlack_pov.png: $(POVFILES)
	$(POVRAY) $(POVRAY_ARGS) Declare=PLAY_B=1 +O$@ stone.pov

BigPlayWhite_pov.png: $(POVFILES)
	$(POVRAY) $(POVRAY_ARGS) Declare=PLAY_W=1 +O$@ stone.pov

BigBlack_pov.png: $(POVFILES)
	$(POVRAY) $(POVRAY_ARGS) Declare=BLACK=1 +O$@ stone.pov

BigWhite_pov.png: $(POVFILES)
	$(POVRAY) $(POVRAY_ARGS) Declare=WHITE=1 +O$@ stone.pov

BigBlackBlack_pov.png: $(POVFILES)
	$(POVRAY) $(POVRAY_ARGS) Declare=B_B_PLAY=1 +O$@ stone.pov

BigBlackWhite_pov.png: $(POVFILES)
	$(POVRAY) $(POVRAY_ARGS) Declare=B_W_PLAY=1 +O$@ stone.pov

BigWhiteBlack_pov.png: $(POVFILES)
	$(POVRAY) $(POVRAY_ARGS) Declare=W_B_PLAY=1 +O$@ stone.pov

BigWhiteWhite_pov.png: $(POVFILES)
	$(POVRAY) $(POVRAY_ARGS) Declare=W_W_PLAY=1 +O$@ stone.pov

YinYang_pov.png: $(POVFILES)
	$(POVRAY) $(POVRAY_ARGS) Declare=YINYANG=1 +O$@ stone.pov

%.png: %_pov.png generate_big_images.pl
	./generate_big_images.pl $@ $<

%Mark.png: %_pov.png %.png generate_big_images.pl
	./generate_big_images.pl $@ $<

%/board: generate_board_images.pl
	./generate_board_images.pl board $*
	touch $@

%/stones: $(BIGSTONES) generate_board_images.pl
	./generate_board_images.pl stones $*
	touch $@

board: $(BOARD_SIZES)

stones: $(STONES_SIZES)

clean:
	 rm -rf $(SIZES)

cleanall:
	 rm -rf $(SIZES) *.png

