#!/usr/bin/make
#
# This makefile generated by LgiIde
# http://www.memecode.com/lgi.php
#

.SILENT :

CC = gcc
CPP = g++
Target = htmleditor
ifndef Build
	Build = Debug
endif
Gui = X
BuildDir = $(Build)$(Gui)

Flags = -fPIC -w -fno-inline -fpermissive
Defs = -DLINUX -D_REENTRANT -D$(Gui)WIN

ifeq ($(Build),Debug)
	Defs += -D_DEBUG
	Flags += -g
	Tag = d
else
	Flags += -s -Os
endif

# Libraries
Libs = \
			-static-libgcc \
			-lgcc \
			-lpthread \
			-lstdc++ \
			-llgi$(Tag) \
			-L/home/matthew/Code/Lgi/$(BuildDir)

# Includes
Inc =		-I/usr/include/xcb\
			-I/usr/include/glib-2.0\
			-I/usr/lib/glib-2.0/include\
			-I/usr/include/cairo\
			-I/usr/include/pango-1.0 \
			-I../include/common \
			-I../include/linux/Xcb

# Dependencies
Depends =	LgiMain.o \
			Rich.o \
			GHtml2.o \
			GHtmlStatic.o \
			GHtmlEdit.o

# Target
# Executable target
$(Target) : ../$(BuildDir)/liblgi$(Tag).so outputfolder $(Depends)
	@echo Linking $(Target) [$(Gui)/$(Build)]...
	$(CC) -Wl,-soname,$(TargetFile),-export-dynamic,-R. -f -o \
		$(Target) $(addprefix $(BuildDir)/,$(Depends)) $(Libs)
	@echo Done.

../$(BuildDir)/liblgi$(Tag).so : FORCE
	export Build=$(Build); \
		export Gui=$(Gui); \
		$(MAKE) -C .. -f Makefile.linux

FORCE :

# Create the output folder
outputfolder :
	-mkdir -p $(BuildDir) 2> /dev/null

# Clean out targets
clean :
	rm -f $(BuildDir)/*.o $(Target).
	@echo Cleaned $(BuildDir)

LgiMain.o : ../src/common/Lgi/LgiMain.cpp ../include/common/Lgi.h
	@echo $(<F) [$(Gui)]
	$(CPP) $(Inc) $(Flags) $(Defs) -c $< -o $(BuildDir)/$(@F)

Rich.o : ./Rich.cpp ../include/common/Lgi.h \
	../include/common/GHtmlEdit.h \
	../include/common/GTextView3.h
	@echo $(<F) [$(Gui)]
	$(CPP) $(Inc) $(Flags) $(Defs) -c $< -o $(BuildDir)/$(@F)

GHtml2.o : ../src/common/Text/GHtml2.cpp ../include/common/Lgi.h \
	../include/common/GHtml2.h \
	../include/common/GHtmlPriv2.h \
	../include/common/GToken.h \
	../include/common/GScrollBar.h \
	../include/common/GVariant.h \
	../include/common/GFindReplaceDlg.h
	@echo $(<F) [$(Gui)]
	$(CPP) $(Inc) $(Flags) $(Defs) -c $< -o $(BuildDir)/$(@F)

GHtmlStatic.o : ../src/common/Text/GHtmlStatic.cpp ../include/common/Lgi.h \
	../include/common/GHtml.h
	@echo $(<F) [$(Gui)]
	$(CPP) $(Inc) $(Flags) $(Defs) -c $< -o $(BuildDir)/$(@F)

GHtmlEdit.o : ../src/common/Widgets/GHtmlEdit.cpp ../include/common/Lgi.h \
	../include/common/GHtmlEdit.h \
	../include/common/GHtmlPriv2.h \
	../include/common/GSkinEngine.h \
	../include/common/GCombo.h
	@echo $(<F) [$(Gui)]
	$(CPP) $(Inc) $(Flags) $(Defs) -c $< -o $(BuildDir)/$(@F)

Lgi.h : ../include/common/LgiInc.h \
	../include/common/LgiMsgs.h \
	../include/common/LgiDefs.h \
	../include/common/GMem.h \
	../include/common/GString.h \
	../include/common/LgiClass.h \
	../include/linux/Xcb/LgiOsDefs.h \
	../include/common/Progress.h \
	../include/common/GFile.h \
	../include/common/Gdc2.h \
	../include/common/LgiRes.h \
	../include/common/LgiClasses.h \
	../include/common/LgiCommon.h

LgiRes.h : ../include/common/Res.h \
	../include/common/GContainers.h

GHtml.h : ../include/common/GMap.h \
	../include/common/GDocView.h \
	../include/common/GHtmlStatic.h

GString.h : ../include/common/LgiInc.h \
	../include/common/LgiDefs.h

GToken.h : ../include/common/GArray.h

GMem.h : ../include/common/LgiDefs.h \
	../include/common/LgiInc.h

LgiDefs.h : ../include/common/GAutoPtr.h

GAutoPtr.h : ../include/common/GMem.h

GHtmlPriv2.h : ../include/common/GCss.h

GContainers.h : ../include/common/LgiInc.h \
	../include/linux/Xcb/LgiOsDefs.h \
	../include/common/GStream.h

GStream.h : ../include/common/GDom.h

GDom.h : ../include/common/LgiInterfaces.h \
	../include/common/GArray.h

GVariant.h : ../include/common/GDom.h \
	../include/common/GDateTime.h \
	../include/common/GContainers.h \
	../include/common/GHashTable.h

GArray.h : ../include/common/LgiDefs.h \
	../include/common/GMem.h

GHtmlStatic.h : ../include/common/GHashTable.h

GHtml2.h : ../include/common/GDocView.h \
	../include/common/GHtmlStatic.h

Gdc2.h : ../include/common/LgiDefs.h \
	../include/common/LgiClass.h \
	../include/linux/Xcb/LgiOsDefs.h \
	../include/common/Progress.h \
	../include/common/GFile.h \
	../include/common/GMem.h \
	../include/linux/Xcb/Core.h \
	../include/common/GContainers.h \
	../include/common/GLibrary.h \
	../include/common/GRect.h \
	../include/common/GFont.h \
	../include/common/GFilter.h

GFont.h : ../include/common/GRect.h \
	../include/common/GProperties.h \
	../include/linux/Xcb/LgiOsClasses.h \
	../include/common/GLibrary.h \
	../include/common/GFilterUtils.h \
	../include/common/GDisplayString.h \
	/usr/include/iconv.h

GFilter.h : ../include/common/GContainers.h \
	../include/common/GProperties.h

GHtmlEdit.h : ../include/common/GHtml2.h

GTextView3.h : ../include/common/GDocView.h \
	../include/common/GUndo.h

Progress.h : ../include/common/GSemaphore.h

LgiClasses.h : ../include/common/GSemaphore.h \
	../include/common/GLibrary.h \
	../include/linux/Xcb/LgiOsClasses.h \
	../include/common/GArray.h \
	../include/common/LgiCommon.h \
	../include/common/GXmlTree.h \
	../include/common/GDragAndDrop.h \
	../include/common/GMenu.h \
	../include/common/LgiWidgets.h \
	../include/common/Progress.h \
	../include/common/GProgress.h \
	../include/common/GFileSelect.h \
	../include/common/GFindReplaceDlg.h \
	../include/common/GToolBar.h \
	../include/common/GThread.h \
	../include/common/GClipBoard.h \
	../include/common/GInput.h \
	../include/common/GPrinter.h

GDragAndDrop.h : ../include/common/GVariant.h

GThread.h : ../include/common/GSemaphore.h

GXmlTree.h : ../include/common/GHashTable.h \
	../include/common/GRefCount.h \
	../include/common/GDom.h

GMenu.h : ../include/common/GMenuImpl.h \
	../include/common/GXmlTree.h \
	../include/common/Res.h

GMenuImpl.h : ../include/common/GPopup.h

GCss.h : ../include/common/LgiDefs.h \
	../include/common/GMem.h \
	../include/common/Gdc2.h \
	../include/common/GAutoPtr.h \
	../include/common/GString.h \
	../include/common/GHashTable.h

LgiInterfaces.h : ../include/common/GArray.h

LgiClass.h : ../include/common/LgiInc.h

GSkinEngine.h : ../include/common/GList.h

GList.h : ../include/common/GPopup.h \
	../include/common/GArray.h

GProperties.h : ../include/common/GContainers.h \
	../include/common/LgiClass.h

GHashTable.h : ../include/common/GArray.h \
	../include/common/GString.h

LgiCommon.h : ../include/common/GArray.h \
	../include/common/LgiClass.h

Res.h : ../include/common/GXmlTree.h \
	../include/common/GProperties.h

LgiOsDefs.h : ../include/common/LgiDefs.h \
	../include/common/LgiInc.h

GFile.h : ../include/linux/Xcb/LgiOsDefs.h \
	../include/common/GMem.h \
	../include/common/GStream.h \
	../include/common/GArray.h

VPATH=%.cpp \
	$(BuildDir)

