# (c) 2007 Electronic Arts Inc.
SHELL=/bin/sh
.SUFFIXES: .cpp .c .a .o

EACINCLUDES=/

all:: avi2chunk huff chimp glump chunkify unchunkify gsr crc imagetohex \
 spit_eg zarg xd math zrun timex copyr zcut tabs zhelp zfilesize zrename makepad bighead \
 cmp cymbal author bingrep bmw gs hashid sleep  txt \
 unslash xl dis sortshp hhmerge uni abstract ztee chunk2avi vid2div sony2dvd dvdmap
 
#whereis rifft recurse bloodhound_eg e url venom zcopy du cdu paddvd

SPITOBJS=spit.o stdgimex.o hashlist.o findfile.o wildmatch.o expr.o range.o ranger.o bloodhound.o gsocket.o
STDLIBS=-lm -lstdc++

%.o: %.cpp
	@echo compiling $*
	@$(ICC) -O2 -I$(EACINCLUDES) -c $*.cpp

%.o: %.c
	@echo compiling $*
	@$(ICC) -O2 -I$(EACINCLUDES) -c $*.c

%: %.o
	@echo linking $*
	@$(ICC) -O1 -I$(EACINCLUDES) -o $* $*.o $(SPITOBJS) $(STDLIBS)

glump:	  glump.o	 $(SPITOBJS)
	@echo I am linking $@
	@$(ICC) -O1 -I$(EACINCLUDES) -L$(EACLIBS) -o $@ $@.o libcodexunixz.a $(SPITOBJS) $(STDLIBS)

huff:	  huff.o huffbest.o huffu.o huffview.o $(SPITOBJS)
	@echo I am linking $@
	@$(ICC) -O1 -I$(EACINCLUDES) -o $@ $@.o huffbest.o huffu.o huffview.o libcodexunixz.a $(SPITOBJS) $(STDLIBS)

imagetohex: imagetohex.o $(SPITOBJS)
avi2chunk: avi2chunk.o $(SPITOBJS)
db: 	  db.o		 $(SPITOBJS)
ie: 	  ie.o		 $(SPITOBJS)
acdc:	  acdc.o	 $(SPITOBJS)
abstract: abstract.o $(SPITOBJS)
author:   author.o	 $(SPITOBJS)
bingrep:  bingrep.o  $(SPITOBJS)
bmw:	  bmw.o 	 $(SPITOBJS)
chimp:	  chimp.o	 $(SPITOBJS)
chunkify: chunkify.o $(SPITOBJS)
unchunkify: unchunkify.o $(SPITOBJS)
cmp:	  cmp.o 	 $(SPITOBJS)
copyr:	  copyr.o	 $(SPITOBJS)
crc:	  crc.o 	 $(SPITOBJS)
cymbal:   cymbal.o	 $(SPITOBJS)
dis:	  dis.o 	 $(SPITOBJS)
e:		  e.o		 $(SPITOBJS)
gs: 	  gs.o		 $(SPITOBJS)
gsr:	  gsr.o 	 $(SPITOBJS)
hashid:   hashid.o	 $(SPITOBJS)
huff:	  huff.o	 $(SPITOBJS)
locomoto: locomoto.o $(SPITOBJS)
math:	  math.o	 $(SPITOBJS)
mathx:	  mathx.o	 $(SPITOBJS)
sleep:	  sleep.o	 $(SPITOBJS)
spit_eg:   spit_eg.o	 $(SPITOBJS)
zarg:     zarg.o	 $(SPITOBJS)
tabs:	  tabs.o	 $(SPITOBJS)
timex:	  timex.o	 $(SPITOBJS)
txt:	  txt.o 	 $(SPITOBJS)
undup:	  undup.o	 $(SPITOBJS)
uni:  	  uni.o      $(SPITOBJS)
unslash:  unslash.o  $(SPITOBJS)
url:	  url.o 	 $(SPITOBJS)
xd: 	  xd.o		 $(SPITOBJS)
xl: 	  xl.o		 $(SPITOBJS)
zcut:	  zcut.o	 $(SPITOBJS)
zhelp:	  zhelp.o	 $(SPITOBJS)
zrename:  zrename.o  $(SPITOBJS) 
zrun:	  zrun.o	 $(SPITOBJS) 
sortshp:  sortshp.o  $(SPITOBJS) 
hhmerge:  hhmerge.o  $(SPITOBJS) 
whereis:  whereis.o  $(SPITOBJS) 
venom:	  venom.o	 $(SPITOBJS)
zfilesize:  zfilesize.o	 $(SPITOBJS)
ztee:       ztee.o        $(SPITOBJS) 
chunk2avi: chunk2avi.o  $(SPITOBJS) 
vid2div:    vid2div.o     $(SPITOBJS) 
sony2dvd:   sony2dvd.o    $(SPITOBJS) 
dvdmap:     dvdmap.o       $(SPITOBJS)
timex.cpp: zrun.cpp
mathx.cpp: math.cpp
gs.cpp: gsr.cpp

