# ZHLT binaries directory
ZHLT_DIR = ./

# Flags
ZHLT_FLAGS = 
CSG_FLAGS = 
BSP_FLAGS = 
#VIS_FLAGS = -fast
#RAD_FLAGS = -extra
#RAD_FLAGS = -chop 128
#RAD_FLAGS = -chop 256

# Command Line
CSG = $(ZHLT_DIR)hlcsg $(ZHLT_FLAGS) $(CSG_FLAGS)
BSP = $(ZHLT_DIR)hlbsp $(ZHLT_FLAGS) $(BSP_FLAGS)
VIS = $(ZHLT_DIR)hlvis $(ZHLT_FLAGS) $(VIS_FLAGS)
RAD = $(ZHLT_DIR)hlrad $(ZHLT_FLAGS) $(RAD_FLAGS)

# Just change the name of your map here
all: mymap.bsp
#CSG_FLAGS = -wadinclude mymap.wad

# Rule to make a map
%.bsp: %.map
	$(CSG) $*.map
	$(BSP) $*.map
	$(VIS) $*.map
	$(RAD) $*.map

# Delete temporary files
clean:
	rm *.lin *.p0 *.p1 *.p2 *.p3 *.prt *.pts *.wic

# Delete temporary files & BSP!!!!!
clean2: clean
	rm *.bsp
