# $Id: Makefile,v 1.32 2005-06-17 16:58:13 igor Exp $

.PATH: ${.CURDIR}/..

UNAME?=	/usr/bin/uname
SED?=	/usr/bin/sed

#we need this for FreeBSD
.if !defined(OSREL)
OSREV!= ${UNAME} -r | ${SED} -e 's/[-(].*//' 
.endif

PROG= pbrowser
# On FreeBSD replace gram-obsd.y with gram-fbsd.y
SRCS= gram-obsd.y
SRCS+= gram.c pkgobject.c pkgquery.c pbutil.c fail.c \
	pkgcmd.c scan.l sort.c search.c y.tab.h \
	gtkutil.c interface.c callbacks.c main.c

# On FreeBSD enter -release or -current after $(OSREV)
CFLAGS+= -D__OSREL__=\"$(OSREV)-release\"
CFLAGS+= -DPBVERSION=\"\(-current\)\"
CFLAGS+= -D__ARCH__=\"${MACHINE_ARCH}\" -D__OSREV__=\"$(OSREV)\" 
CFLAGS+= -DIMAGEDIR=\"${.CURDIR}/../pixmaps/\"
CFLAGS+= -I${.CURDIR} `pkg-config --cflags glib-2.0 gtk+-2.0 gdk-2.0`
CFLAGS+= -Wall -W -Wmissing-prototypes -Wbad-function-cast
CFLAGS+= -Wmissing-declarations -Wpointer-arith
CFLAGS+= -Wshadow -Wpointer-arith -Wcast-qual -Wsign-compare
#CFLAGS+= -DDEBUG=0 -ggdb
LDADD= `pkg-config --libs glib-2.0 gthread-2.0 gtk+-2.0 gdk-2.0` -lutil 
YFLAGS+= -d
MAN= pbrowser.1
CLEANFILES+= scan.c y.tab.h pbrowser.cat1 pbrowser.1.gz

.depend: gram.c pbutil.c fail.c pkgobject.c pkgquery.c pkgcmd.c scan.c sort.c search.c

.include <bsd.prog.mk>
