# this makefile converts the .pcx graphics files to a lib file
# so that the main makefile just has to include this lib and not all the graphics stuff


RODATASUFF := all.rodata.o
CURRENTIMGS :=   $(notdir $(wildcard $(CURDIR)/*.pcx))
PALETTENAME :=   $(notdir $(CURDIR)).pal
LIBNAME :=   lib$(notdir $(CURDIR)).a
CURRENTOFILES := $(CURRENTIMGS:%.pcx=%.$(RODATASUFF)) \
		$(CURRENTIMGS:%.pcx=%.map.$(RODATASUFF)) \
 		$(PALETTENAME).$(RODATASUFF)
OUTDIR := ../../o
allTarget  := $(foreach file,$(notdir $(CURRENTIMGS)), $(OUTDIR)/$(file))
GFX2GBAFLAGS :=  -T8 -t8 -m -F -c16 -q 
MOVE := $(COPY)
.PHONY : raws maps all

$(LIBNAME) :  $(CURRENTOFILES) 
all :  $(LIBNAME)
clean :  
	@-rm -f $(CURRENTOFILES)
	@-rm -f $(LIBNAME) $(PALETTENAME)
	@-rm -f $(CURRENTIMGS:%.pcx=%.raw) 
	@-rm -f $(CURRENTIMGS:%.pcx=%.map) 


