###############################################################################
##
##  libLB - The LBPP support library
##  Copyright (C) 2001   Anthony Liguori <ajl13@bellatlantic.net>
##
##  libLB is free software; you can redistribute it and/or
##  modify it under the terms of the GNU Lesser General Public
##  License as published by the Free Software Foundation; either
##  version 2.1 of the License, or (at your option) any later version.
##
##  libLB 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
##  Lesser General Public License for more details.
##
##  You should have received a copy of the GNU Lesser General Public
##  License along with this library; if not, write to the Free Software
##  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
##
###############################################################################

all: $(PROG)

LBLIB_DIR = ../liblb
LBPP = ../src/lbpp

CFLAGS+=  -I$(LBLIB_DIR) `gnome-config --cflags gnomeui`
SRCS = $(PROG).bas
CSRCS = $(SRCS:.bas=.c)
OBJS = $(CSRCS:.c=.o)
#CC = gcc
LBPPFLAGS =
LDFLAGS = -L$(LBLIB_DIR)
LIBS = -lLB -lm `gnome-config --libs gnomeui`

ifdef PROFILE_MEMORY
CFLAGS += -DPROFILE_MEMORY --include $(LBLIB_DIR)/mem_prof.h
endif

%.c : %.bas Makefile
	$(LBPP) $(LBPPFLAGS) -o $@ $<

%.o : %.c Makefile
	$(CC) -c $(CFLAGS) $(CPPFLAGS) -o $@ $<

$(PROG): Makefile $(OBJS)
	$(CC) $(LDFLAGS) -o $(PROG) $(OBJS) $(LIBS)

clean:
	rm -f $(PROG) $(OBJS)

realclean:
	rm -f $(PROG) $(OBJS)
	rm -f *~ \#* .#*
