# Since it's only going to be in memory a few seconds, gamegen should
# be made as small as possible.  Thus, it's optimized for size, not speed.
# The first commented-out bit is for debugging purposes; don't forget to
# comment out the $(STRIP) line in gamegen: if you're debugging.  The second
# line optimizes gamegen for a.out systems.

CC		= gcc
CCFLAGS 	= -Wall -O3 -pipe -fomit-frame-pointer -fno-strength-reduce #-DOPCODE
#CCFLAGS 	= -Wall -ggdb
#CCFLAGS 	= -Wall -O2 -N -bi486-linuxaout -Wl,-Bdynamic -ffast-math

STRIP		= strip
COMPRESS	= gzip -9
TAR		= tar
ZIP		= zip -kq9

all:	 gamegen

gamegen: gamegen.c gamegen.h
	 $(CC) $(CCFLAGS) $< -o $@
	 $(STRIP) $@

backup: backtgz backzip

backtgz:
	 cd .. && $(TAR) cf - gamegen/ | $(COMPRESS) > gamegen.tgz

backzip:
	 cd .. && $(ZIP) gamegen gamegen gamegen/* 
