.DEFAULT_GOAL := build
.PHONY := build clean run

clean:
	rm maps/test.bsp
	rm maps/test.prt
	rm maps/test.srf
	rm maps/test/lm*.tga
	rmdir maps/test

build: maps/test.bsp

maps/test.bsp:
	q3map2 -game quake3 -fs_game test -bsp maps/test.map
	q3map2 -game quake3 -fs_game test -vis maps/test.map
	q3map2 -game quake3 -fs_game test -light -external maps/test.map

run:
	quake3 +set sv_pure 0 +set fs_game test +devmap test
