#
# leds
# Linux Editor for D 
# S as in simple(superfoolous) or supperb
# 
# by Antonio Monteiro
#

#
# if you don't have dmd on your path change the DMD definition to the full path
#
DMD = dmd -d -g 

#
# change the phobos location 
#
PHOBOS = ~/dmd/src/phobos
#
# change the DUI location 
#
DUI = ~/devel/D/DUI/src
#PRIVDLIB = ../../DLIB/src
#
# you might need to change the location of these libraries
# probably you want to change just the line "-L/usr/local/lib"
#
GTK_LIBS = -Wl,--export-dynamic \
	-L/usr/local/lib \
	-lgtk-x11-2.0 \
	-lgdk-x11-2.0 \
	-latk-1.0 \
	-lgdk_pixbuf-2.0 \
	-lm \
	-lpangoxft-1.0 \
	-lpangox-1.0 \
	-lpango-1.0 \
	-lgobject-2.0 \
	-lgmodule-2.0 \
	-ldl \
	-lglib-2.0 \
	-lgconf-gtk-1

DUI_LIBS = -L/home/ruimt/devel/D/DUI -ldui -lduiext
	
##############
# no changes should be required beyond this line
##############

SRCDIR = .
OBJDIR = ../obj
INCLUDES = -I$(PHOBOS):$(DUI):$(SRCDIR):$(PRIVDLIB)


DFLAGS = $(INCLUDES)

ledsSRC = \
	$(SRCDIR)/leds/Leds.d \
	$(SRCDIR)/leds/Directory.d \
	$(SRCDIR)/leds/Workspace.d \
	$(SRCDIR)/leds/Project.d \
	$(SRCDIR)/leds/POpen.d \
	$(SRCDIR)/leds/SystemConsole.d \
	$(SRCDIR)/leds/ExecConsole.d \
	$(SRCDIR)/leds/Properties.d \
	$(SRCDIR)/leds/StatusBar.d \
	$(SRCDIR)/leds/Scintilla.d \
	$(SRCDIR)/leds/FileView.d \
	$(SRCDIR)/leds/CodeView.d \
	$(SRCDIR)/leds/ImageView.d \
	$(SRCDIR)/leds/Docker.d \
	$(SRCDIR)/leds/ProjectView.d \
	$(SRCDIR)/leds/FindAndReplace.d \
	$(SRCDIR)/leds/GotoLineDialog.d \
	$(SRCDIR)/leds/TipWindow.d

LEXEROBJS=$(wildcard /usr/down/scintilla/gtk/Lex*.o)	

all:
	cd src ; $(DMD) $(ledsSRC) -c $(DFLAGS) -od$(OBJDIR) -op
	gcc \
	obj/leds/*.o \
	-o leds  \
	-lphobos -lpthread -lm /usr/down/scintilla/bin/scintilla.a \
	-lgconf-2 \
	$(DUI_LIBS) \
	$(LEXEROBJS) \
	`pkg-config --libs gtk+-2.0 gthread-2.0` -lstdc++ -DGTK $^



#	../DLIB/libprivdlib.a \

	
#INCLUDEDIRS=-I/usr/down/newBoa/scintilla/include
#CXXFLAGS= -DGTK -DSCI_LEXER -W -Wall
#LEXEROBJS=$(wildcard /usr/down/newBoa/scintilla/gtk/Lex*.o)
#
#all: bait
#
#.c.o:
#        gcc `pkg-config --cflags gtk+-2.0` $(INCLUDEDIRS) $(CXXFLAGS) -c $< -o $@
#bait: bait.o $(LEXEROBJS) /usr/down/newBoa/scintilla/bin/scintilla.a
#        gcc `pkg-config --libs gtk+-2.0 gthread-2.0` -lstdc++ -DGTK $^ -o $@


clean:
	rm obj/*.o