CC = g++

CFLAGS = \
	-O2\
	-fomit-frame-pointer\
	-ffast-math\
	-funroll-loops\
	-s\
	-mwindows\
	-D__GTHREAD_HIDE_WIN32API\
	-DALLEGRO_STATICLINK

OBJDIR = obj\mingw
LIB = -lmasking_s -lalfont_s -lalleg_s -luser32 -lgdi32 -lkernel32 -lcomdlg32 -lole32 -ldinput -lddraw -ldxguid -lwinmm -ldsound
EXE = wcol.exe
COMPRESS = upx.exe

include filelist

OBJ = $(addprefix $(OBJDIR)/, $(notdir $(SRC:.cpp=.o)))

RES = $(OBJDIR)/icon.res

all : $(OBJ) main

$(RES):
	windres -O coff -i icon.rc -o $(RES)

$(OBJDIR)/%.o: ./%.cpp
	-$(CC) $(CFLAGS) -o $@ -c $<

main: $(OBJ) $(RES)
	$(CC) $(CFLAGS) -o $(EXE) $(BASEOBJ) $(OBJ) $(LIB) $(RES)

clean:
	-rm -f $(OBJ)
	-rm -f $(EXE)

compress:
	$(COMPRESS) $(EXE)
