# Command definitions
CC := g++
RM := rm -f

# Output file
BIN := test.exe

# Directories
SDIR := Src
3RDPARTY_DIR := $(SDIR)/Lib

# Flags
CFLAGS := -W -Wall -Werror -I$(SDIR) -I$(3RDPARTY_DIR)
CFLAGS += -I../Libs/SFML/branches/sfml2/include
ARFLAGS := -ruvcs
LINKFLAGS := 
LIBS := libsfml-audio-s.a libsfml-graphics-s.a libsfml-window-s.a libsfml-system-s.a \
	-lwinmm -lgdi32 -lglu32 -lopengl32 \
	openal32.dll libsndfile-1.dll \
	glew32.dll -lfreetype

######################
# List of source files

MY_OBJS := main.o \
	ZipLoader.o

# Third party objects
3RDPARTY_OBJS := unzip.o ioapi.o

# Add source path to objects
OBJS := $(patsubst %,$(SDIR)/%,$(MY_OBJS))
3RDPARTY_OBJS := $(patsubst %,$(3RDPARTY_DIR)/%,$(3RDPARTY_OBJS))


##########
# Commands
#

# Compile all
all: $(BIN)

# Catches commands so those are not mixed to source files
.PHONY: clean

# Deletes all object files
clean:
	$(RM) $(BIN) $(OBJS) $(DATAFILE)

#########
# Linking
#
$(BIN): $(OBJS)
	$(CC) $(LINKFLAGS) -o $(BIN) $(OBJS) $(3RDPARTY_OBJS) $(LIBS)

###########
# Compiling
#
%.o: %.cpp
	$(CC) -c -o $@ $< $(CFLAGS)

