ALLEGRO_DAT = dat

DST_EXT = tex
TMP_BMP_EXT = bmp
SRC_BMP_EXT = orig.bmp
TMP_PCX_EXT = pcx
SRC_PCX_EXT = orig.pcx

TEXTURES_BMP =  2d \
	3d \
	3x3 \
	ac \
	anaglyph1 \
	anaglyph2 \
	around \
	big \
	blemmya \
	bored \
	card \
	charming \
	chess \
	circle \
	circlus \
	clean \
	confuse \
	dirt \
	egg \
	eyes \
	garden \
	honey \
	honeymoon \
	jabberwocky \
	labyrint \
	logo \
	lost \
	lw \
	metation \
	paper \
	papercut \
	pastel \
	place \
	psyforcegeometry \
	psyforcemultiroom \
	psyforcespheralcube \
	psyforcesquares \
	psyforceultramultiroom \
	puckman \
	rect \
	rectangle \
	rough \
	skullbig \
	skull \
	slimy \
	smile \
	solsystembyn \
	sonnesystem \
	tiles \
	underground \
	watch

TEXTURES_PCX = lwtab002 \
	lwtab003 \
	lwtab004 \
	lwtab006 \
	lwtab008 \
	lwtab009 \
	lwtabbar \
	lwtabdrt \
	lwtabmic \
	lwtabrec \
	lwtabses \
	lwtabto2 \
	lwtabto4 \
	lwtabtom \
	lwtabtru

DST_FILES = $(addsuffix .$(DST_EXT),$(TEXTURES_BMP)) $(addsuffix .$(DST_EXT),$(TEXTURES_PCX))
TMP_FILES_BMP = $(addsuffix .$(TMP_BMP_EXT),$(TEXTURES_BMP))
TMP_FILES_PCX = $(addsuffix .$(TMP_PCX_EXT),$(TEXTURES_PCX))

all: maptex.dat

maptex.dat: $(DST_FILES) $(TMP_FILES_BMP) $(TMP_FILES_PCX)
	@rm -f $@
	@echo Creating $@
	@$(ALLEGRO_DAT) -a $@ $(DST_FILES)

clean:
	@rm -f $(DST_FILES) $(TMP_FILES_BMP) $(TMP_FILES_PCX) *.dat

distclean:
	@rm -f Makefile 

%.$(TMP_BMP_EXT): %.$(SRC_BMP_EXT)
	@echo Converting $< to $@
	@cp $< $@
	@../../utils/liquidwarcol -s 32 32 $@

%.$(DST_EXT): %.$(TMP_BMP_EXT)
	@echo Converting $< to $@
	@../../utils/liquidwartex -s 32 32 $<

%.$(TMP_PCX_EXT): %.$(SRC_PCX_EXT)
	@echo Converting $< to $@
	@cp $< $@
	@../../utils/liquidwarcol -s 32 32 $@

%.$(DST_EXT): %.$(TMP_PCX_EXT)
	@echo Converting $< to $@
	@../../utils/liquidwartex -s 32 32 $<

