# Define executable name
BIN = flare_0_18

# Define source files
CPP_SRCS = Animation.cpp \
AnimationManager.cpp \
AnimationSet.cpp \
AStarNode.cpp \
Avatar.cpp \
BehaviorStandard.cpp \
CampaignManager.cpp \
CombatText.cpp \
EffectManager.cpp\
Enemy.cpp \
EnemyBehavior.cpp \
EnemyGroupManager.cpp \
EnemyManager.cpp \
Entity.cpp \
FileParser.cpp \
FontEngine.cpp \
GameState.cpp \
GameStateConfig.cpp \
GameStateLoad.cpp \
GameStateNew.cpp \
GameStatePlay.cpp \
GameStateTitle.cpp \
GameSwitcher.cpp \
GetText.cpp \
Hazard.cpp \
HazardManager.cpp \
ImageManager.cpp\
InputState.cpp \
ItemManager.cpp \
ItemStorage.cpp \
Loot.cpp\
LootManager.cpp \
main.cpp \
MapCollision.cpp \
MapRenderer.cpp \
Menu.cpp \
MenuActionBar.cpp \
MenuActiveEffects.cpp \
MenuCharacter.cpp \
MenuConfirm.cpp \
MenuEnemy.cpp \
MenuExit.cpp \
MenuHUDLog.cpp \
MenuInventory.cpp \
MenuItemStorage.cpp \
MenuLog.cpp \
MenuManager.cpp \
MenuMiniMap.cpp \
MenuNPCActions.cpp\
MenuPowers.cpp \
MenuStash.cpp \
MenuStatBar.cpp \
MenuTalker.cpp \
MenuVendor.cpp \
MessageEngine.cpp \
ModManager.cpp \
NPC.cpp \
NPCManager.cpp \
PowerManager.cpp \
QuestLog.cpp \
SaveLoad.cpp \
Settings.cpp \
SharedResources.cpp \
SoundManager.cpp\
StatBlock.cpp \
TileSet.cpp \
Utils.cpp \
UtilsDebug.cpp \
UtilsFileSystem.cpp \
UtilsParsing.cpp \
Widget.cpp\
WidgetButton.cpp \
WidgetCheckBox.cpp \
WidgetInput.cpp \
WidgetLabel.cpp \
WidgetListBox.cpp \
WidgetScrollBar.cpp \
WidgetScrollBox.cpp \
WidgetSlider.cpp \
WidgetTabControl.cpp \
WidgetTooltip.cpp

# Define header file paths
INCPATH = -I./

# Define the -L library path(s)
LDFLAGS =-lSDL_image -lSDL_ttf -lfreetype2 -lSDL_mixer -lSDL_gfx -lpng -ljpeg -lz -lvorbisfile -lvorbis -logg -lSDL -lGL


# Define the -l library name(s)
LIBS =

CXX = i386-aros-g++

# Only in special cases should anything be edited below this line
OBJS      = $(CPP_SRCS:.cpp=.o)
CXXFLAGS  = -O3 --fast-math -s $(shell sdl-config --cflags)
DEP_FILE  = .depend


.PHONY = all clean distclean


# Main entry point
#
all: depend $(BIN)


# For linking object file(s) to produce the executable
#
$(BIN): $(OBJS)
	@echo Linking $@
	@$(CXX) $^ $(LDFLAGS) $(LIBS) -o $@


# For compiling source file(s)
#
.cpp.o:
	@echo Compiling $<
	@$(CXX) -c $(CXXFLAGS) $(INCPATH) $<


# For cleaning up the project
#
clean:
	$(RM) $(OBJS)

distclean: clean
	$(RM) $(BIN)
	$(RM) $(DEP_FILE)


# For determining source file dependencies
#
depend: $(DEP_FILE)
	@touch $(DEP_FILE)

$(DEP_FILE):
	@echo Generating dependencies in $@
	@-$(CXX) -E -MM $(CXXFLAGS) $(INCPATH) $(SRCS) >> $(DEP_FILE)

ifeq (,$(findstring clean,$(MAKECMDGOALS)))
ifeq (,$(findstring distclean,$(MAKECMDGOALS)))
-include $(DEP_FILE)
endif
endif
