# Makefile for PDFlib, C++ language binding
# $Id: Makefile.in,v 1.13 2001/04/01 11:02:56 tm Exp $

VERSION		= @VERSION@
LIBPDF		= lib@PDFLIBNAME@
SHELL		= @SHELL@
INSTALL		= @INSTALL@
INSTALL_DATA 	= @INSTALL_DATA@
srcdir		= @srcdir@
top_builddir	= ../..
VPATH		= @srcdir@
EXE		= @EXEEXT@
OBJ		= @OBJEXT@
CXX		= @CXX@
RM      	= @RM@
LIBTOOL		= ../../libtool --silent

PDFLIBLINK	= @PDFLIBLINK@ @STDCPP@

CXXFLAGS	= -I../../pdflib @DEFINES@ $(CPPFLAGS)

.SUFFIXES: .cpp .$(OBJ) .lo

.cpp.lo:
	$(LIBTOOL) --mode=compile $(CXX) -c $(CXXFLAGS) $<

.cpp.$(OBJ):
	$(LIBTOOL) --mode=compile $(CXX) -c $(CXXFLAGS) $<

# ----------------------------------

SRC	= \
	$(srcdir)/pdflib.cpp		\
	$(srcdir)/hello.cpp		\
	$(srcdir)/image.cpp		\
	$(srcdir)/pdfclock.cpp		\
	$(srcdir)/personalize.cpp	\
	$(srcdir)/quickreference.cpp

OBJS	= \
	$(srcdir)/pdflib.lo		\
	$(srcdir)/hello.lo		\
	$(srcdir)/image.lo		\
	$(srcdir)/pdfclock.lo		\
	$(srcdir)/personalize.lo	\
	$(srcdir)/quickreference.lo

all:	hello$(EXE)		\
	image$(EXE)		\
	pdfclock$(EXE)

test: hello$(EXE) image$(EXE) pdfclock$(EXE)
	-./hello
	-./image
	-./pdfclock

pditest: personalize$(EXE) quickreference$(EXE) test
	-./personalize
	-./quickreference

.PHONY: clean

pdflib.$(OBJ): pdflib.cpp

hello$(EXE): hello.lo pdflib.lo ../../pdflib/$(LIBPDF).la
	$(LIBTOOL) --mode=link $(CXX) -static -o $@ hello.lo pdflib.lo $(PDFLIBLINK)

image$(EXE): image.lo pdflib.lo ../../pdflib/$(LIBPDF).la
	$(LIBTOOL) --mode=link $(CXX) -static -o $@ image.lo pdflib.lo $(PDFLIBLINK)

pdfclock$(EXE): pdfclock.lo pdflib.lo ../../pdflib/$(LIBPDF).la
	$(LIBTOOL) --mode=link $(CXX) -static -o $@ pdfclock.lo pdflib.lo $(PDFLIBLINK)

personalize$(EXE): personalize.lo pdflib.lo ../../pdflib/$(LIBPDF).la
	$(LIBTOOL) --mode=link $(CXX) -static -o $@ personalize.lo pdflib.lo $(PDFLIBLINK)

quickreference$(EXE): quickreference.lo pdflib.lo ../../pdflib/$(LIBPDF).la
	$(LIBTOOL) --mode=link $(CXX) -static -o $@ quickreference.lo pdflib.lo $(PDFLIBLINK)

install: 

uninstall:

clean:
	-$(RM) *.$(OBJ) *.lo *.la hello$(EXE) image$(EXE)	\
	pdfclock$(EXE) personalize$(EXE) quickreference$(EXE)	\
	.libs hello_cpp.pdf image_cpp.pdf pdfclock_cpp.pdf	\
	personalize.pdf quickreference.pdf

depend:
	cp Makefile.in Makefile.in.bak
	sed '/^# Automatically generated dependencies/q' Makefile.in.bak >Makefile.in
	$(CXX) $(CXXFLAGS) -MM $(SRC) | sed 's/\.o:/.lo:/g' >>Makefile.in

# Automatically generated dependencies
pdflib.lo: ./pdflib.cpp pdflib.hpp ../../pdflib/pdflib.h
hello.lo: ./hello.cpp pdflib.hpp ../../pdflib/pdflib.h
image.lo: ./image.cpp pdflib.hpp ../../pdflib/pdflib.h
pdfclock.lo: ./pdfclock.cpp pdflib.hpp ../../pdflib/pdflib.h
personalize.lo: ./personalize.cpp pdflib.hpp ../../pdflib/pdflib.h
quickreference.lo: ./quickreference.cpp pdflib.hpp ../../pdflib/pdflib.h
