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

.SILENT :

CC = gcc
CPP = g++
Target = ./lgiide
ifndef Build
	Build = Debug
endif
BuildDir = $(Build)

Flags = -fPIC -w -fno-inline -fpermissive

ifeq ($(Build),Debug)
	Flags += -g -std=c++14
	Tag = d
	Defs = -D_DEBUG -DLINUX -D_REENTRANT -D_FILE_OFFSET_BITS=64 -DPOSIX
	Libs =  \
		-L../Debug \
		-lmagic \
		-lpthread \
		`pkg-config --libs gtk+-3.0` \
		-static-libgcc \
		-llgi-gtk3$(Tag) \
		-L../$(BuildDir)
	Inc =  \
		`pkg-config --cflags gtk+-3.0` \
		-I./Resources \
		-I./Code \
		-I../include/lgi/linux/Gtk \
		-I../include/lgi/linux \
		-I../include
else
	Flags += -s -Os -std=c++14
	Defs = -DLINUX -D_REENTRANT -D_FILE_OFFSET_BITS=64 -DPOSIX
	Libs =  \
		-L../Release \
		-lmagic \
		-lpthread \
		`pkg-config --libs gtk+-3.0` \
		-static-libgcc \
		-llgi-gtk3$(Tag) \
		-L../$(BuildDir)
	Inc =  \
		`pkg-config --cflags gtk+-3.0` \
		-I./Resources \
		-I./Code \
		-I../include/lgi/linux/Gtk \
		-I../include/lgi/linux \
		-I../include
endif

# Dependencies
Source =	Code/WebFldDlg.cpp \
			Code/SysCharSupport.cpp \
			Code/SpaceTabConv.cpp \
			Code/SimpleCppParser.cpp \
			Code/PythonParser.cpp \
			Code/ProjectNode.cpp \
			Code/NewProjectFromTemplate.cpp \
			Code/MissingFiles.cpp \
			Code/MemDumpViewer.cpp \
			Code/LgiUtils.cpp \
			Code/LgiIde.cpp \
			Code/levenshtein.c \
			Code/JavascriptParser.cpp \
			Code/IdeProjectSettings.cpp \
			Code/IdeProject.cpp \
			Code/IdeDoc.cpp \
			Code/IdeCommon.cpp \
			Code/GHistory.cpp \
			Code/GDebugger.cpp \
			Code/GDebugContext.cpp \
			Code/FtpThread.cpp \
			Code/FindSymbol.cpp \
			Code/FindInFiles.cpp \
			Code/DocEditStyling.cpp \
			Code/DocEdit.cpp \
			Code/AddFtpFile.cpp \
			../src/common/Text/TextConvert.cpp \
			../src/common/Text/HtmlParser.cpp \
			../src/common/Text/HtmlCommon.cpp \
			../src/common/Text/Html.cpp \
			../src/common/Text/Homoglyphs/HomoglyphsTable.cpp \
			../src/common/Text/Homoglyphs/Homoglyphs.cpp \
			../src/common/Text/DocView.cpp \
			../src/common/Net/OpenSSLSocket.cpp \
			../src/common/Net/Http.cpp \
			../src/common/Net/Ftp.cpp \
			../src/common/Lgi/SubProcess.cpp \
			../src/common/Lgi/Mdi.cpp \
			../src/common/Lgi/LgiMain.cpp \
			../src/common/Lgi/About.cpp \
			../src/common/Gdc2/Filters/Png.cpp \
			../src/common/Coding/ParseCpp.cpp \
			../src/common/Coding/LexCpp.cpp

SourceLst := $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(Source)))

Objects := $(addprefix $(BuildDir)/,$(SourceLst))

# Target
# Executable target
$(Target) : ../$(BuildDir)/liblgi-gtk3$(Tag).so $(Objects)
	mkdir -p $(BuildDir)
	@echo Linking $(Target) [$(Build)]...
	$(CPP) -Wl,-export-dynamic,-R. -o \
		$(Target) $(Objects) $(Libs)
	@echo Done.

../$(BuildDir)/liblgi-gtk3$(Tag).so : ../include/lgi/common/App.h \
	../include/lgi/common/Array.h \
	../include/lgi/common/AutoPtr.h \
	../include/lgi/common/Base64.h \
	../include/lgi/common/Bitmap.h \
	../include/lgi/common/Box.h \
	../include/lgi/common/Button.h \
	../include/lgi/common/CairoSurface.h \
	../include/lgi/common/Cancel.h \
	../include/lgi/common/Capabilities.h \
	../include/lgi/common/Charset.h \
	../include/lgi/common/CheckBox.h \
	../include/lgi/common/ClipBoard.h \
	../include/lgi/common/Colour.h \
	../include/lgi/common/ColourSpace.h \
	../include/lgi/common/Com.h \
	../include/lgi/common/Combo.h \
	../include/lgi/common/Containers.h \
	../include/lgi/common/Core.h \
	../include/lgi/common/Css.h \
	../include/lgi/common/CssTools.h \
	../include/lgi/common/CurrentTime.h \
	../include/lgi/common/DataDlg.h \
	../include/lgi/common/DateTime.h \
	../include/lgi/common/Dialog.h \
	../include/lgi/common/DisplayString.h \
	../include/lgi/common/DocView.h \
	../include/lgi/common/Dom.h \
	../include/lgi/common/DomFields.h \
	../include/lgi/common/DragAndDrop.h \
	../include/lgi/common/DropFiles.h \
	../include/lgi/common/Edit.h \
	../include/lgi/common/Error.h \
	../include/lgi/common/EventTargetThread.h \
	../include/lgi/common/File.h \
	../include/lgi/common/FileSelect.h \
	../include/lgi/common/Filter.h \
	../include/lgi/common/FindReplaceDlg.h \
	../include/lgi/common/Font.h \
	../include/lgi/common/FontCache.h \
	../include/lgi/common/FontSelect.h \
	../include/lgi/common/Gdc2.h \
	../include/lgi/common/GdcTools.h \
	../include/lgi/common/GdiLeak.h \
	../include/lgi/common/HashTable.h \
	../include/lgi/common/ImageList.h \
	../include/lgi/common/Input.h \
	../include/lgi/common/ItemContainer.h \
	../include/lgi/common/Json.h \
	../include/lgi/common/Layout.h \
	../include/lgi/common/Lgi.h \
	../include/lgi/common/LgiClasses.h \
	../include/lgi/common/LgiCommon.h \
	../include/lgi/common/LgiDefs.h \
	../include/lgi/common/LgiInc.h \
	../include/lgi/common/LgiInterfaces.h \
	../include/lgi/common/LgiMsgs.h \
	../include/lgi/common/LgiNetInc.h \
	../include/lgi/common/LgiRes.h \
	../include/lgi/common/LgiString.h \
	../include/lgi/common/LgiUiBase.h \
	../include/lgi/common/Library.h \
	../include/lgi/common/LibraryUtils.h \
	../include/lgi/common/List.h \
	../include/lgi/common/ListItemCheckBox.h \
	../include/lgi/common/ListItemRadioBtn.h \
	../include/lgi/common/Mail.h \
	../include/lgi/common/Matrix.h \
	../include/lgi/common/Mem.h \
	../include/lgi/common/Menu.h \
	../include/lgi/common/Message.h \
	../include/lgi/common/Mime.h \
	../include/lgi/common/Mru.h \
	../include/lgi/common/Mutex.h \
	../include/lgi/common/Net.h \
	../include/lgi/common/NetTools.h \
	../include/lgi/common/Notifications.h \
	../include/lgi/common/OAuth2.h \
	../include/lgi/common/OptionsFile.h \
	../include/lgi/common/Palette.h \
	../include/lgi/common/Panel.h \
	../include/lgi/common/Password.h \
	../include/lgi/common/Path.h \
	../include/lgi/common/PixelRops.h \
	../include/lgi/common/Point.h \
	../include/lgi/common/Popup.h \
	../include/lgi/common/PopupList.h \
	../include/lgi/common/Printer.h \
	../include/lgi/common/Profile.h \
	../include/lgi/common/Progress.h \
	../include/lgi/common/ProgressDlg.h \
	../include/lgi/common/ProgressView.h \
	../include/lgi/common/Properties.h \
	../include/lgi/common/RadioGroup.h \
	../include/lgi/common/Range.h \
	../include/lgi/common/Rect.h \
	../include/lgi/common/RectF.h \
	../include/lgi/common/RefCount.h \
	../include/lgi/common/RegKey.h \
	../include/lgi/common/Res.h \
	../include/lgi/common/Rops.h \
	../include/lgi/common/ScrollBar.h \
	../include/lgi/common/SkinEngine.h \
	../include/lgi/common/Slider.h \
	../include/lgi/common/Splitter.h \
	../include/lgi/common/StatusBar.h \
	../include/lgi/common/Store3Defs.h \
	../include/lgi/common/Stream.h \
	../include/lgi/common/StringClass.h \
	../include/lgi/common/StringLayout.h \
	../include/lgi/common/SubProcess.h \
	../include/lgi/common/TableLayout.h \
	../include/lgi/common/TabView.h \
	../include/lgi/common/TextFile.h \
	../include/lgi/common/TextLabel.h \
	../include/lgi/common/TextLog.h \
	../include/lgi/common/TextView3.h \
	../include/lgi/common/Thread.h \
	../include/lgi/common/ThreadEvent.h \
	../include/lgi/common/Token.h \
	../include/lgi/common/ToolBar.h \
	../include/lgi/common/ToolTip.h \
	../include/lgi/common/TrayIcon.h \
	../include/lgi/common/Tree.h \
	../include/lgi/common/Undo.h \
	../include/lgi/common/Unicode.h \
	../include/lgi/common/UnicodeString.h \
	../include/lgi/common/UnrolledList.h \
	../include/lgi/common/Variant.h \
	../include/lgi/common/View.h \
	../include/lgi/common/Widgets.h \
	../include/lgi/common/Window.h \
	../include/lgi/common/XmlTree.h \
	../include/lgi/linux/Gtk/LgiOsClasses.h \
	../include/lgi/linux/Gtk/LgiOsDefs.h \
	../include/lgi/linux/Gtk/LgiWidget.h \
	../include/lgi/linux/Gtk/LgiWinManGlue.h \
	../include/lgi/mac/cocoa/LCocoaView.h \
	../include/lgi/mac/cocoa/LgiMac.h \
	../include/lgi/mac/cocoa/LgiOs.h \
	../include/lgi/mac/cocoa/LgiOsClasses.h \
	../include/lgi/mac/cocoa/LgiOsDefs.h \
	../include/lgi/mac/cocoa/ObjCWrapper.h \
	../include/lgi/mac/cocoa/SymLookup.h \
	../private/common/FontPriv.h \
	../private/common/ViewPriv.h \
	../private/linux/AppPriv.h \
	../src/common/Gdc2/15Bit.cpp \
	../src/common/Gdc2/16Bit.cpp \
	../src/common/Gdc2/24Bit.cpp \
	../src/common/Gdc2/32Bit.cpp \
	../src/common/Gdc2/8Bit.cpp \
	../src/common/Gdc2/Alpha.cpp \
	../src/common/Gdc2/Colour.cpp \
	../src/common/Gdc2/Filters/Filter.cpp \
	../src/common/Gdc2/Font/Charset.cpp \
	../src/common/Gdc2/Font/DisplayString.cpp \
	../src/common/Gdc2/Font/Font.cpp \
	../src/common/Gdc2/Font/FontSystem.cpp \
	../src/common/Gdc2/Font/FontType.cpp \
	../src/common/Gdc2/Font/StringLayout.cpp \
	../src/common/Gdc2/Font/TypeFace.cpp \
	../src/common/Gdc2/GdcCommon.cpp \
	../src/common/Gdc2/Path/Path.cpp \
	../src/common/Gdc2/Rect.cpp \
	../src/common/Gdc2/RopsCases.cpp \
	../src/common/Gdc2/Surface.cpp \
	../src/common/Gdc2/Tools/ColourReduce.cpp \
	../src/common/Gdc2/Tools/GdcTools.cpp \
	../src/common/General/Containers.cpp \
	../src/common/General/DateTime.cpp \
	../src/common/General/ExeCheck.cpp \
	../src/common/General/FileCommon.cpp \
	../src/common/General/Password.cpp \
	../src/common/General/Properties.cpp \
	../src/common/Hash/md5/md5.c \
	../src/common/Hash/md5/md5.h \
	../src/common/Hash/sha1/sha1.c \
	../src/common/Hash/sha1/sha1.h \
	../src/common/Lgi/Alert.cpp \
	../src/common/Lgi/AppCommon.cpp \
	../src/common/Lgi/Css.cpp \
	../src/common/Lgi/CssTools.cpp \
	../src/common/Lgi/DataDlg.cpp \
	../src/common/Lgi/DragAndDropCommon.cpp \
	../src/common/Lgi/FileSelect.cpp \
	../src/common/Lgi/FindReplace.cpp \
	../src/common/Lgi/FontSelect.cpp \
	../src/common/Lgi/GuiUtils.cpp \
	../src/common/Lgi/Input.cpp \
	../src/common/Lgi/LgiCommon.cpp \
	../src/common/Lgi/Library.cpp \
	../src/common/Lgi/LMsg.cpp \
	../src/common/Lgi/MemStream.cpp \
	../src/common/Lgi/MenuCommon.cpp \
	../src/common/Lgi/Mru.cpp \
	../src/common/Lgi/Mutex.cpp \
	../src/common/Lgi/Object.cpp \
	../src/common/Lgi/OptionsFile.cpp \
	../src/common/Lgi/Rand.cpp \
	../src/common/Lgi/Stream.cpp \
	../src/common/Lgi/SubProcess.cpp \
	../src/common/Lgi/ThreadCommon.cpp \
	../src/common/Lgi/ThreadEvent.cpp \
	../src/common/Lgi/ToolTip.cpp \
	../src/common/Lgi/TrayIcon.cpp \
	../src/common/Lgi/Variant.cpp \
	../src/common/Lgi/ViewCommon.cpp \
	../src/common/Lgi/WindowCommon.cpp \
	../src/common/Net/Base64.cpp \
	../src/common/Net/MDStringToDigest.cpp \
	../src/common/Net/Net.cpp \
	../src/common/Net/NetTools.cpp \
	../src/common/Net/Uri.cpp \
	../src/common/Resource/LgiRes.cpp \
	../src/common/Resource/Res.cpp \
	../src/common/Skins/Gel/Gel.cpp \
	../src/common/Text/DocView.cpp \
	../src/common/Text/String.cpp \
	../src/common/Text/TextView3.cpp \
	../src/common/Text/Token.cpp \
	../src/common/Text/Unicode.cpp \
	../src/common/Text/Utf8.cpp \
	../src/common/Text/XmlTree.cpp \
	../src/common/Widgets/Bitmap.cpp \
	../src/common/Widgets/Box.cpp \
	../src/common/Widgets/Button.cpp \
	../src/common/Widgets/CheckBox.cpp \
	../src/common/Widgets/Combo.cpp \
	../src/common/Widgets/Edit.cpp \
	../src/common/Widgets/ItemContainer.cpp \
	../src/common/Widgets/List.cpp \
	../src/common/Widgets/Panel.cpp \
	../src/common/Widgets/Popup.cpp \
	../src/common/Widgets/Progress.cpp \
	../src/common/Widgets/ProgressDlg.cpp \
	../src/common/Widgets/RadioGroup.cpp \
	../src/common/Widgets/ScrollBar.cpp \
	../src/common/Widgets/Slider.cpp \
	../src/common/Widgets/Splitter.cpp \
	../src/common/Widgets/StatusBar.cpp \
	../src/common/Widgets/TableLayout.cpp \
	../src/common/Widgets/TabView.cpp \
	../src/common/Widgets/TextLabel.cpp \
	../src/common/Widgets/ToolBar.cpp \
	../src/common/Widgets/Tree.cpp \
	../src/linux/General/File.cpp \
	../src/linux/General/Mem.cpp \
	../src/linux/General/ShowFileProp_Linux.cpp \
	../src/linux/Gtk/Gdc2.cpp \
	../src/linux/Gtk/LgiWidget.cpp \
	../src/linux/Gtk/MemDC.cpp \
	../src/linux/Gtk/PrintDC.cpp \
	../src/linux/Gtk/ScreenDC.cpp \
	../src/linux/Lgi/App.cpp \
	../src/linux/Lgi/ClipBoard.cpp \
	../src/linux/Lgi/DragAndDrop.cpp \
	../src/linux/Lgi/General.cpp \
	../src/linux/Lgi/Layout.cpp \
	../src/linux/Lgi/Menu.cpp \
	../src/linux/Lgi/Printer.cpp \
	../src/linux/Lgi/Thread.cpp \
	../src/linux/Lgi/View.cpp \
	../src/linux/Lgi/Widgets.cpp \
	../src/linux/Lgi/Window.cpp
	export Build=$(Build); \
	$(MAKE) -C .. -f Makefile.linux

.SECONDEXPANSION:
$(Objects): $(BuildDir)/%.o: $$(wildcard %.c*)
	mkdir -p $(@D)
	@echo $(<F) [$(Build)]
ifeq "$(suffix $<)" ".cpp"
	$(CPP) -MMD -MP $(Inc) $(Flags) $(Defs) -c $< -o $@
else
	$(CC) -MMD -MP $(Inc) $(Flags) $(Defs) -c $< -o $@
endif

-include $(Objects:.o=.d)

# Clean just this target
clean :
	rm -rf $(BuildDir)/* $(Target)
	@echo Cleaned $(BuildDir)

# Clean all targets
cleanall :
	rm -rf $(BuildDir)/* $(Target)
	@echo Cleaned $(BuildDir)
	+make -C "../" -f "Makefile.linux" clean

VPATH=%.cpp \
	../../../../codelib/openssl/include \
	../include/lgi/linux/Gtk \
	../include/lgi/linux \
	../include/lgi/common \
	../include \
	./Resources \
	./Code \
	$(BuildDir)

