CC=cc
CFLAGS=-Wall -O3 -g
INCPATH=-I/usr/local/include
LIBPATH=-L/usr/local/lib
LIBS=-lglut

dffviewer: main.c dffviewer.c textures.c archives.c ide.c ../libdff.o ../libtxd.o ../rw.c
	$(CC) $(CFLAGS) main.c -c -o main.o $(INCPATH)
	$(CC) $(CFLAGS) dffviewer.c -c -o dffviewer.o $(INCPATH)
	$(CC) $(CFLAGS) textures.c -c -o textures.o $(INCPATH)
	$(CC) $(CFLAGS) archives.c -c -o archives.o $(INCPATH)
	$(CC) $(CFLAGS) ide.c -c -o ide.o $(INCPATH)
	$(CC) main.o dffviewer.o textures.o archives.o ide.o ../rw.c ../libtxd.o \
		../libdff.o $(LIBS) $(LIBPATH) -o $@
clean:
	rm -rf *.o *.core dffviewer
