CC = g++
BIN = main
OBJ = main.o
SRC = main.cpp
RM = rm -f

ifdef MINGDIR
	FLAGS = -WAll
	LIBS = -mwindows -lopenlayer -lglyph-agl -lfreetype -lldpng -lpng -lz -lagl -lalleg -luser32 -lgdi32 -lglu32 -lopengl32
else
	FLAGS = -WAll `openlayer-config --cflags`
	LIBS = `openlayer-config --libs`
endif

.PHONY: all clean $(BIN)
all: clean $(BIN)

clean:
	${RM} $(BIN) $(OBJ)

$(OBJ):$(SRC)
	$(CC) -c $(SRC)

$(BIN):$(OBJ)
	$(CC) $(FLAGS) -o $(BIN) $(OBJ) $(LIBS)
