
#
#  Changes from 1.1 to 1.2:
#    - dependencies described directly, no more makedepend required
#    - all .c source files rename to .cc files
#    - strip command included after a successful compilation
#    - this makefile is now "Star Trek The Next Generation" compatible!
#


CFLAGS = $(COMPILERFLAGS) # -DLINUX  -ffast-math -m486 -m80387 -O3 -ggdb
# -fomit-frame-pointer -DDAMN_INTEL_BYTE_ORDER
# debugging: -ggdb -DDEBUG
# profiling: -pg (gprof) or -p (prof)
# strip command has to be removed for debugging or profiling

COMPILER = /usr/i386-linux-uclibc/bin/i386-uclibc-gcc 

#-c -O3 -DLINUX -DDAMN_INTEL_BYTE_ORDER  


#COMPILER = gcc

#-O3 -m486 -m80387 -ffast-math -fomit-frame-pointer -DLINUX -DDAMN_INTEL_BYTE_ORDER   

OBJS = ibitstream.o header.o scalefactors.o subband_layer_1.o subband_layer_2.o \
       synthesis_filter.o obuffer.o crc.o layer3.o bit_res.o huffman.o inv_mdct.o maplay.o 

# ulaw.o

.SUFFIXES:	.cc

#install:
#		@./configuration.sh

all:		maplay

maplay:		$(OBJS)
		$(COMPILER) $(CFLAGS) $(OBJS) -o $@ $(LIBRARIES) -L/usr/i386-linux-uclibc/lib -lm
#		-strip $@

.cc.o:
		$(COMPILER) -c $(CFLAGS) $(INCLUDEDIRS) $*.cc -o $@

depend:
		makedepend $(INCLUDEDIRS) -w100 *.cc

clean:
		-rm -f maplay makedepend_done Makefile.bak audio_includes.h
		-rm -f *.o

tags:
		-rm -f TAGS
		etags *.cc *.h Makefile configuration.sh

it:
		@echo >/dev/null
so:
		@echo I\'ll do my very best, Captain.
		@make install
		@echo Further orders, Sir\?


#l3type.h l3type.h l3type.h l3type.h l3type.h l3type.h l3type.h l3type.h 

bit_res.o:	bit_res.cc all.h bit_res.h
crc.o:		crc.cc crc.h all.h
header.o:	header.cc header.h all.h ibitstream.h  crc.h
huffman.o:	huffman.cc all.h bit_res.h huffman.h
ibitstream.o:	ibitstream.cc all.h ibitstream.h  header.h crc.h
inv_mdct.o:	inv_mdct.cc all.h inv_mdct.h
layer3.o:	layer3.cc all.h  ibitstream.h obuffer.h header.h \
		crc.h bit_res.h synthesis_filter.h huffman.h \
		layer3.h inv_mdct.h
maplay.o:	maplay.cc all.h crc.h header.h ibitstream.h  \
		obuffer.h subband.h synthesis_filter.h \
		subband_layer_1.h subband_layer_2.h layer3.h bit_res.h
obuffer.o:	obuffer.cc obuffer.h all.h header.h ibitstream.h  \
		crc.h
scalefactors.o:	scalefactors.cc scalefactors.h all.h
subband_layer_1.o: subband_layer_1.cc subband_layer_1.h all.h \
		subband.h ibitstream.h  header.h crc.h synthesis_filter.h \
		obuffer.h scalefactors.h
subband_layer_2.o: subband_layer_2.cc subband_layer_2.h all.h \
		subband.h ibitstream.h  header.h crc.h synthesis_filter.h \
		obuffer.h scalefactors.h
synthesis_filter.o: synthesis_filter.cc all.h synthesis_filter.h \
		obuffer.h header.h ibitstream.h crc.h

#ulaw.o:		ulaw.cc ulaw.h all.h


# DO NOT DELETE THIS LINE -- make depend depends on it.
