# Generated automatically from Makefile.in by configure.
# Makefile for panels source code.
#
# This makes the following:
#	libraries (normal/debug/profile/shared)
#
# The variable 'srcdir' refers to the source-distribution, and can be set with
# the configure script by "--srcdir=DIR".
#
# The rules are organized to produce the libraries for the configured models,

# turn off _all_ suffix rules; we'll generate our own
.SUFFIXES:

SHELL		= /bin/sh
THIS		= Makefile

MODEL		= normal
srcdir		= .
prefix		= /usr
exec_prefix	= ${prefix}
libdir		= $(exec_prefix)/lib
includedir	= $(prefix)/include/ncurses

# We'd put terminfo in /usr/share/terminfo, but that's not the convention...
ticdir		= $(exec_prefix)/lib/terminfo

INSTALL		= /usr/bin/install -c
INSTALL_DATA	= ${INSTALL} -m 644

AWK		= gawk
LN_S		= ln -s

CC		= gcc
CFLAGS		=  -O -DNDEBUG

CPPFLAGS	= -I. -I../include -I$(includedir) \
		  -DHAVE_CONFIG_H -DTERMINFO=\"$(ticdir)\"

CCFLAGS		= $(CPPFLAGS) $(CFLAGS)

CFLAGS_NORMAL	= $(CCFLAGS)
CFLAGS_DEBUG	= $(CCFLAGS) -g -DTRACE
CFLAGS_PROFILE	= $(CCFLAGS) -pg
CFLAGS_SHARED	= $(CCFLAGS) -fPIC

CFLAGS_DEFAULT	= $(CFLAGS_NORMAL)

LINK		= $(CC)
LDFLAGS		=   -lbsd 

MK_SHARED_LIB	= gcc -o $@.$(REL_VERSION) -shared -Wl,-soname,`basename $@.$(ABI_VERSION)`,-stats
REL_VERSION	= 1.9.6
ABI_VERSION	= 2.0

RANLIB		= ranlib

LIBRARIES	=  ../lib/libpanel.a ../lib/libpanel_g.a

################################################################################
all ::	../include/panel.h $(LIBRARIES)

install :: install.libs

install.libs:: $(includedir) $(libdir)
	$(INSTALL_DATA) $(srcdir)/panel.h $(includedir)/panel.h
	@echo "Make sure you delete any old header files!"

$(includedir) \
$(libdir) :
	$(srcdir)/../mkinstalldirs $@

# make a copy to simplify include-paths while still keeping panel's include
# file in this directory.
../include/panel.h : $(srcdir)/panel.h
	-rm -f $@
	cp $(srcdir)/panel.h $@

tags:
	ctags *.[ch]

TAGS:
	etags *.[ch]

clean ::
	-rm -f tags TAGS *~ ../include/panel.h

distclean: clean
	-rm -f Makefile

mostlyclean: clean

realclean: distclean

###############################################################################
# The remainder of this file is automatically generated during configuration
###############################################################################

NORMAL_OBJS = \
	../objects/panel.o

../lib/libpanel.a : $(NORMAL_OBJS)
	ar rv $@ $?
	$(RANLIB) $@

install.libs :: $(libdir) ../lib/libpanel.a
	@echo installing ../lib/libpanel.a as $(libdir)/libpanel.a 
	$(INSTALL_DATA) ../lib/libpanel.a $(libdir)/libpanel.a 
	$(RANLIB) $(libdir)/libpanel.a

clean ::
	rm -f ../lib/libpanel.a
	rm -f $(NORMAL_OBJS)

# Library objects

../objects/panel.o :	$(srcdir)/panel.c \
			$(srcdir)/panel.h
	cd ../objects; $(CC) $(CFLAGS_NORMAL) -c ../panel/panel.c


DEBUG_OBJS = \
	../obj_g/panel.o

../lib/libpanel_g.a : $(DEBUG_OBJS)
	ar rv $@ $?
	$(RANLIB) $@

install.libs :: $(libdir) ../lib/libpanel_g.a
	@echo installing ../lib/libpanel_g.a as $(libdir)/libpanel_g.a 
	$(INSTALL_DATA) ../lib/libpanel_g.a $(libdir)/libpanel_g.a 
	$(RANLIB) $(libdir)/libpanel_g.a

clean ::
	rm -f ../lib/libpanel_g.a
	rm -f $(DEBUG_OBJS)

# Library objects

../obj_g/panel.o :	$(srcdir)/panel.c \
			$(srcdir)/panel.h
	cd ../obj_g; $(CC) $(CFLAGS_DEBUG) -c ../panel/panel.c

