VERSION=0.7

DEBUG=-g # -pg
CFLAGS+=-Wall -O2 -DVERSION=\"${VERSION}\" -Wall $(DEBUG)
LDFLAGS+=$(DEBUG) -lsndfile -lfftw3 -lm -lmad

OBJS=fft.o mp3.o ss.o

all: soundsort

soundsort: $(OBJS)
	$(CC) -Wall -W $(OBJS) $(LDFLAGS) -o soundsort

test: test.o
	$(CC) -Wall -W test.o -lfftw3 -lm $(DEBUG) -lgd -o test

install: soundsort
	cp soundsort /usr/bin
	cp soundsort.1 /usr/share/man/man1

clean:
	rm -f $(OBJS) soundsort core

package: clean
	mkdir soundsort-$(VERSION)
	cp *.c* *.h Makefile license.txt readme.txt soundsort-$(VERSION)
	tar czf soundsort-$(VERSION).tgz soundsort-$(VERSION)
	rm -rf soundsort-$(VERSION)
