# Makefile for MDLib      
# Type 'make' to compile and create the application mdlib.exe
# Coded by Frodo The Ring Bearer

CFLAGS= -O3 -m486 -ffast-math -fomit-frame-pointer -funroll-loops 
CC = gcc


# Object files
O =     ascmdl.o camera.o mdl.o q1mdl.o q2mdl.o unpak.o


all : $(O)
	@echo Creating libmdl.a and mdlib.exe
	ar rvs libmdl.a $(O)
	cp mdlib.h $(DJDIR)/include/mdlib.h
	cp libmdl.a $(DJDIR)/lib/libmdl.a
	gcc -O3 -m486 -ffast-math -s ../mdlib.c -o ../mdlib.exe -lmdl -lalleg
	@echo All Done. Run mdlib.exe in the parent directory


.c.o : 
	$(CC) -c $(CFLAGS) $*.c -o $*.o

depend :
	@echo Making dependencies:
	$(CC) -M *.c > depend

clean :
	-@rm *.o
	-@rm *.exe
	-@rm depend



# DEPENDENCIES

include depend


