###############################################################################
#
#    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+=$(DEFS) $(INCLUDE)
ARFLAGS=-L. -lgtkshell -L../libantiright -lantiright
GTKFLAGS=$(ARFLAGS) $(LDFLAGS)

#LDFLAGS+=-lefence

objects=y.tab.o lex.yy.o gtkshell.o arguments.o options.o callbacks.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\
	row.o containers.o geometry.o font.o dragdrop.o\
	image_button.o terminal.o terminal_options.o menu.o updated.o\
	guidl_util.o about_dialog.o init.o guidl_dialog.o guidl_dictionary.o\
	guidl_options.o guidl_widgets.o update_manager.o pane.o\
	command_shell.o app_mode.o clock.o tree.o form.o dialog.o swallow.o\
	GSHWidget.o quickstart.o undo.o 

program=main.o 

all: y.tab.c gtkshell

gtkshell: y.tab.h $(objects) $(program)
	ar rcs libgtkshell.a $(objects)
	cc -o gtkshell $(program) $(GTKFLAGS)

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

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

y.tab.c: y.tab.h

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

