DEBUGFLAGS=-g3 -ggdb3
GGIDIR=/opt/ggi-2.2.2
CPPFLAGS= -I$(GGIDIR)/include -I.
CXXFLAGS=-Os -W -Wall -pedantic $(ARCHFLAGS) $(DEBUGFLAGS)
CXXFLAGS+=-fno-tree-dominator-opts -mpreferred-stack-boundary=2 -fno-tree-loop-optimize
LDFLAGS=-L$(GGIDIR)/lib -lggi -lgii -lgg -lstdc++ -lm
STRIP=strip
STRIP_FLAGS=-s -d -R .comment -R .note

all: supercow

supercow: pcx.cpp supercow.cpp
	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -o $@ $^ $(LDFLAGS)

strip: supercow
	$(STRIP) $(STRIP_FLAGS) $<

supercow.cpp: timer.h pcx.h sprites.h font.h
pxc.cpp: pcx.h

clean:
	rm -f core *~ *.o

realclean: clean
	rm -f supercow

tar:
	tar -cjf $(basename $(PWD))-$(shell date +%Y%m%d-%H%M).tar.bz2 -C .. $(basename $(PWD))

