# Makefile for src/graphics

CXX		= g++
INCLUDES	= -I../common -I.
CPPFLAGS	= -g -Wall -Werror -fPIC `paragui-config --cflags` $(INCLUDES) 
PROFILERFLAGS   = -pg -fprofile-arcs
LFLAGS		= `paragui-config --libs`
OBJECTS		= \
	splash.o maptile.o d_map.o startup_screen.o RuinSearchDialog.o	\
       	player_preferences.o MainWindow.o smallmap.o w_edit.o bigmap.o \
	hero_offer.o ArmyInfo.o stackinfo.o cityinfo.o d_buy_production.o \
	FightDialog.o pgfiledialog.o CityOccupationDialog.o			\
	MapCreationDialog.o# citiesreport.o goldreport.o d_client.o

TARGET		= libflgraphic.so.0.1.0

# Important pattern rule for making object files :)

%.o: %.cpp %.h
	$(CXX) $(CPPFLAGS) -c $< -o $@

# Main Target
# NOTE: remove the symbolic link so that we don't get an errormessage if it already exists
# TODO: this can't be done on MS Windows, there has to be another way ;)

$(TARGET): $(OBJECTS)
	$(CXX) -g -shared -Wl,-soname,libflgraphic.so $(OBJECTS) -o $(TARGET) -lc
	-rm -f libflgraphic.so
	-ln -s libflgraphic.so.0.1.0 libflgraphic.so

clean:
	-rm -f $(OBJECTS) $(TARGET) *.da *~ libflgraphic.so

