CC = gcc

OPTIONS = \
	-O2\
	-W\
	-Wall\
	-m486\
	-fomit-frame-pointer\
	-fcse-follow-jumps\
	-fcse-skip-blocks\
	-fexpensive-optimizations\
	-fpeephole\
	-frerun-cse-after-loop\
	-fstrength-reduce\
	-fthread-jumps\
	-s

INCLUDE_DIRS = ../include
INC_DIRS = $(addprefix -I,$(INCLUDE_DIRS))

LIBRARY_DIRS = ../
LIB_DIRS = $(addprefix -L,$(LIBRARY_DIRS))

LIBRARIES = degui alleg iostr
LIBS = $(addprefix -l,$(LIBRARIES))

all : ex0.exe\
	ex1.exe\
	ex2.exe\
	ex3.exe\
	ex4.exe\
	ex5.exe\
	ex6.exe\
	ex7.exe\
	ex8.exe\
	ex9.exe\
	ex10.exe\
	ex11.exe

%exe : %o
	$(CC) $(LIB_DIRS) -s -o $@ $< $(LIBS)

%o : %cc
	$(CC) -c $(INC_DIRS) $(OPTIONS) $<

%o : %c
	$(CC) -c $(INC_DIRS) $(OPTIONS) $<

clean:
	del *.exe
	del *.o
	del *.gdt

