all: door32 testdoor/testdoor testdoor/art.go space-ace/space-ace


font-out: font-out.go
	go build font-out.go
	cd font-show; go build


door32: door32.c
	gcc -g -o door32d door32.c
	gcc -o door32 door32.c

testdoor/fonts.go: font-out
	# echo "package main\n\nimport \"red-green/door\"\n\n" > testdoor/fonts.go
	# ./font-out -f "Amazon Cyan,Medieval,Anarchy Blue,Unchained,Asylum,ArmageonRed,BrainDmgBlu,Boner,Descent,Remorse,Dungeon" TDFONTS.TDF TDFONTS2.TDF TDFONTS9.TDF > testdoor/fonts.go
	./font-out -f "Amazon Cyan,Medieval,Anarchy Blue,Unchained,Asylum,Armageddon,ArmageonRed,BrainDmgBlu,Boner,Descent,Remorse,Dungeon" TDFONTS.TDF TDFONTS2.TDF TDFONTS9.TDF > testdoor/fonts.go
	# cat *_font.go >> testdoor/fonts.go    
	# rm *_font.go

testdoor/rgfont.go: font-out
	./font-out -f "Armageddon" -c 7,1 -c 4,2 TDFONTS2.TDF > testdoor/rgfont.go
	sed -i 's/Armageddon/RedGreen/g' testdoor/rgfont.go

ansi-to-go/ansi-to-go: ansi-to-go/ansi-to-go.go
	cd ansi-to-go; go build

testdoor/art.go: testdoor/growl.ans ansi-to-go/ansi-to-go
	./ansi-to-go/ansi-to-go testdoor/growl.ans > testdoor/art.go

space-ace/space.go: space.ans
	./ansi-to-go.py main space.ans > space-ace/space.go

testdoor/testdoor: testdoor/art.go testdoor/fonts.go testdoor/rgfont.go testdoor/*.go door/*.go
	cd testdoor; go build

space-ace/space-ace: space-ace/*.go door/*.go space-ace/space.go
	cd space-ace; go build -ldflags="-extldflags=-static" -tags sqlite_omit_load_extension


#	./font-out -f "Amazon Cyan,Medieval,Anarchy Blue" TDFONTS.TDF 
#	./font-out -f Unchained,Asylum,ArmageonRed,BrainDmgBlu TDFONTS2.TDF
#	./font-out -f Boner,Descent,Remorse,Dungeon TDFONTS9.TDF