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

.SILENT :

CC = g++
Target=lgiide
Build = Debug
Gui = X
BuildDir = $(Build)$(Gui)

Flags = -fPIC -w -fno-inline
Defs= -DWIN32 -D_REENTRANT

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

# Libraries
Libs = 		-lgcc \
			-lpthread \
			-lstdc++ \
			-limm32 \
			-lgdi32 \
			-llgi$(Tag) \
			-L..\$(BuildDir)

# Includes
Inc =		-I..\include\common \
			-I..\include\win32 \
			-I.\Code \
			-I\usr\include\libpng12

# Dependencies
Depends =	FindInFiles.o \
			GHistory.o \
			IdeDoc.o \
			IdeProject.o \
			LgiIde.o \
			LgiUtils.o \
			MemDumpViewer.o \
			SpaceTabConv.o \
			GDocView.o \
			GMdi.o \
			GTextView3.o \
			LgiMain.o \
			Png.o

# Target
# Executable target
$(Target) : ../$(BuildDir)/liblgi$(Tag).dll outputfolder $(Depends)
	@echo Linking $(Target) [$(Gui)/$(Build)]...
	$(CC) -Wl,--disable-auto-import -f -o \
		$(Target) $(addprefix $(BuildDir)/,$(Depends)) $(Libs)
	@echo Done.

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

FORCE :

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

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

FindInFiles.o : ./Code/FindInFiles.cpp ../include/common/Lgi.h \
	./Code/LgiIde.h \
	../include/common/GProcess.h \
	../include/common/GDocView.h \
	../include/common/GToken.h
	@echo $(<F)
	$(CC) $(Inc) $(Flags) $(Defs) -c $< -o $(BuildDir)/$(@F)

GHistory.o : ./Code/GHistory.cpp ../include/common/Lgi.h \
	./Code/GHistory.h \
	../include/common/GList.h
	@echo $(<F)
	$(CC) $(Inc) $(Flags) $(Defs) -c $< -o $(BuildDir)/$(@F)

IdeDoc.o : ./Code/IdeDoc.cpp ../include/common/Lgi.h \
	./Code/LgiIde.h \
	../include/common/GToken.h
	@echo $(<F)
	$(CC) $(Inc) $(Flags) $(Defs) -c $< -o $(BuildDir)/$(@F)

IdeProject.o : ./Code/IdeProject.cpp ../include/common/Lgi.h \
	./Code/LgiIde.h \
	../include/common/GDragAndDrop.h \
	../include/common/GToken.h \
	./Code/resdefs.h \
	../include/common/GProcess.h \
	../include/win32/GCombo.h
	@echo $(<F)
	$(CC) $(Inc) $(Flags) $(Defs) -c $< -o $(BuildDir)/$(@F)

LgiIde.o : ./Code/LgiIde.cpp ../include/common/Lgi.h \
	./Code/LgiIde.h \
	../include/common/GMdi.h \
	../include/common/GToken.h \
	../include/common/GXmlTree.h \
	../include/common/GPanel.h \
	../include/common/GProcess.h \
	./Code/SpaceTabConv.h \
	../include/common/GButton.h \
	../include/common/GTabView.h
	@echo $(<F)
	$(CC) $(Inc) $(Flags) $(Defs) -c $< -o $(BuildDir)/$(@F)

LgiUtils.o : ./Code/LgiUtils.cpp ../include/common/Lgi.h \
	./Code/LgiIde.h
	@echo $(<F)
	$(CC) $(Inc) $(Flags) $(Defs) -c $< -o $(BuildDir)/$(@F)

MemDumpViewer.o : ./Code/MemDumpViewer.cpp ../include/common/Lgi.h \
	./Code/LgiIde.h \
	../include/common/GToken.h \
	../include/common/GEdit.h
	@echo $(<F)
	$(CC) $(Inc) $(Flags) $(Defs) -c $< -o $(BuildDir)/$(@F)

SpaceTabConv.o : ./Code/SpaceTabConv.cpp ../include/win32/GMem.h \
	../include/common/GContainers.h
	@echo $(<F)
	$(CC) $(Inc) $(Flags) $(Defs) -c $< -o $(BuildDir)/$(@F)

GDocView.o : ../src/common/Text/GDocView.cpp ../include/common/Lgi.h \
	../include/common/GDocView.h
	@echo $(<F)
	$(CC) $(Inc) $(Flags) $(Defs) -c $< -o $(BuildDir)/$(@F)

GMdi.o : ../src/common/Lgi/GMdi.cpp ../include/common/Lgi.h \
	../include/common/GMdi.h
	@echo $(<F)
	$(CC) $(Inc) $(Flags) $(Defs) -c $< -o $(BuildDir)/$(@F)

GTextView3.o : ../src/common/Text/GTextView3.cpp ../include/common/Lgi.h \
	../include/common/GTextView3.h \
	../include/common/GInput.h \
	../include/common/GScrollBar.h
	@echo $(<F)
	$(CC) $(Inc) $(Flags) $(Defs) -c $< -o $(BuildDir)/$(@F)

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

Png.o : ../src/common/Gdc2/Filters/Png.cpp ../include/common/Lgi.h \
	../include/common/GFilterUtils.h
	@echo $(<F)
	$(CC) $(Inc) $(Flags) $(Defs) -c $< -o $(BuildDir)/$(@F)

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

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

LgiIde.h : ./Code/resource.h \
	./Code/resdefs.h \
	./Code/IdeDoc.h \
	./Code/IdeProject.h \
	./Code/FindInFiles.h

GProcess.h : ../include/common/GStream.h

FindInFiles.h : ./Code/GHistory.h

IdeDoc.h : ../include/common/GMdi.h \
	../include/common/GTextView3.h

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

GHistory.h : ../include/common/GPopup.h

GContainers.h : ../include/common/LgiInc.h \
	../include/win32/LgiOsDefs.h \
	../include/common/GStream.h

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

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

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

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

LgiClasses.h : ../include/common/GSemaphore.h \
	../include/common/GLibrary.h \
	../include/win32/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

LgiOsClasses.h : ../include/common/GContainers.h

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

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

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

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

LgiWidgets.h : ../include/common/GButton.h \
	../include/common/GEdit.h \
	../include/common/GCheckBox.h \
	../include/common/GTextLabel.h \
	../include/common/GRadioGroup.h \
	../include/win32/GCombo.h \
	../include/common/GList.h \
	../include/common/GTree.h \
	../include/common/GScrollBar.h \
	../include/common/GDataDlg.h

GTree.h : ../include/common/GList.h

GDataDlg.h : ../include/common/GProperties.h

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

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

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

Gdc2.h : ../include/common/LgiDefs.h \
	../include/common/LgiClass.h \
	../include/win32/LgiOsDefs.h \
	../include/common/Progress.h \
	../include/common/GFile.h \
	../include/win32/GMem.h \
	../include/win32/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/win32/LgiOsClasses.h

IdeProject.h : ../include/common/GXmlTree.h \
	../include/common/GDragAndDrop.h \
	../include/common/GTree.h

GDragAndDrop.h : ../include/common/GVariant.h \
	../include/win32/GCom.h

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

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

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

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

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

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

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

VPATH=%.cpp \
	$(BuildDir)

