###############################################################################
#
#    AntiRight
#    (c) 2004-2007 Jeffrey Bedard
#    antiright@gmail.com
# 
#    This file is part of AntiRight.
#
#     AntiRight is free software; you can redistribute it and/or modify
#     it under the terms of the GNU General Public License as published by
#     the Free Software Foundation; either version 2 of the License, or
#     (at your option) any later version.
#
#     AntiRight is distributed in the hope that it will be useful,
#     but WITHOUT ANY WARRANTY; without even the implied warranty of
#     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#     GNU General Public License for more details.
#
#     You should have received a copy of the GNU General Public License
#     along with AntiRight; if not, write to the Free Software
#     Foundation, Inc., 51 Franklin Street, Fifth Floor, 
#     Boston, MA  02110-1301  USA		
#
###############################################################################

include ../config.mk

#CFLAGS+=`pkg-config --cflags gtk+-2.0` -g3 -Wall -W -Werror
GTKFLAGS=`pkg-config --cflags gtk+-2.0` `pkg-config --cflags vte`
CFLAGS+=$(GTKFLAGS) $(DEFS)
LDFLAGS+=-L../libantiright -lantiright
LDFLAGS+=`pkg-config --libs gtk+-2.0` `pkg-config --libs vte`
#LDFLAGS+=-lefence

objects=gtkshell.o arguments.o options.o callbacks.o updated.o\
	label.o button.o text.o updated_label.o updated_progress.o\
	updated_options.o add_options.o option_options.o dialog_options.o\
	file_dialog.o row.o containers.o geometry.o font.o dragdrop.o\
	image_button.o y.tab.o lex.yy.o terminal.o

program=main.o 

sources=gtkshell.c arguments.c options.c callbacks.c updated.c\
	label.c button.c text.c updated_label.c updated_progress.c\
	updated_options.c add_options.c option_options.c dialog_options.c\
	file_dialog.c row.c containers.c geometry.c font.c dragdrop.c\
	image_button.c y.tab.c lex.yy.c terminal.o

all: gtkshell


gtkshell: y.tab.c $(objects) $(program)
	$(CC) -o gtkshell $(objects) $(program) $(LDFLAGS)
	ar rcs libgtkshell.a $(objects)

lex.yy.c: guidl.lex
	lex guidl.lex

y.tab.c: lex.yy.c guidl.y
	yacc -d guidl.y

splint: $(sources)
	splint +posixlib -nullpass -nullstate -temptrans -mustfreeonly `pkg-config --cflags-only-I gtk+-2.0` $(sources) > splint.out

parser-clean:
	rm -f *.yy.c *.tab.c *.tab.h

clean: parser-clean
	rm -f gtkshell *.o libgtkshell.a 

install:
	install gtkshell $(PREFIX)/bin
	install gshterm $(PREFIX)/bin

