
AGGPAS := software

PC := fpc
PFLAGS := -Mdelphi
PFLAGS += -Fi$(AGGPAS)
PFLAGS += -Fu$(AGGPAS)

TEMP := units
PFLAGS += -FU$(TEMP)

ifdef DEBUG
PFLAGS += -dDEBUG
else
PFLAGS += -B -CX -Xs -XX
endif

ifdef FREETYPE
PFLAGS += -dFORCE_FREETYPE
endif

chessimage2: chessimage2.pas settings.pas $(TEMP)
	$(PC) $< $(PFLAGS)

test: chessimage2
	./chessimage2 'rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3 0 1'
ifeq ($(USER),roland)
	see chessimage2.png
endif

$(TEMP):
	mkdir $(TEMP)

clean:
	@rm -fv $(TEMP)/*.a $(TEMP)/*.o $(TEMP)/*.ppu

distclean: clean
	@rm -fv chessimage2

# make clean && make PC=/home/roland/Applications/fpc-322-x86_64-win64/fpc.exe FREETYPE=1
