#
# GNU PIC Programmer & Debugger
# The Graphical User Interface
#
# Copyright (C) 2003 Sylvain Giroudon
# Creation: 25-JAN-2003
#
# This program 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.
#
# This program 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 this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.  
#

#
# $Revision: 1.4 $
# $Date: 2004/07/19 17:12:40 $
#

.SUFFIXES: .c .o
-include ../Makefile.defs

VPATH = ../lib

ifdef INSTALLDIR
PIXMAPDIR=$(INSTALLDIR)/share/gpicd/pixmaps
CFLAGS = -DPIXMAPDIR=\"$(INSTALLROOT)/share/gpicd/pixmaps\"
else
PIXMAPDIR=$(PWD)
CFLAGS = -DPIXMAPDIR=\"$(PWD)\"
endif

CFLAGS += -Wall -O2 -I.. -I../lib
CFLAGS += -DGTK_ENABLE_BROKEN
CFLAGS += $(shell pkg-config --cflags gtk+-2.0)
LDFLAGS = $(shell pkg-config --libs gtk+-2.0)

SRCS =  main.c support.c interface.c \
	colors.c gtkgears.c status.c err_gui.c \
	source_sym.c source_file.c source.c \
	config_gui.c config_port_gui.c config_icsp_gui.c \
	memwatch.c gui.c
OBJECTS = $(SRCS:%.c=%.o)
PIXMAPS = load1.xpm goto.xpm chip.xpm

BINS = gpicd

all: $(BINS)
ifdef INSTALLDIR
	$(MKDIR) $(INSTALLDIR)/bin
	$(CP) $(BINS) $(INSTALLDIR)/bin
ifdef PIXMAPDIR
	$(MKDIR) $(PIXMAPDIR)
	$(CP) $(PIXMAPS) $(PIXMAPDIR)
endif
endif

clean:
	$(RM) *~ *.o $(BINS)

gpicd: $(OBJECTS) gpicd.a
	$(CC) $(LDFLAGS) -o $@ $^
