# Makefile.in
# 
# This file is part of the t1lib-package! See documentation and Readme files
# of the t1lib-package for copyright restrictions.
#
# Targets provided: 
#                      all (default)
#                      install
#                      uninstall
#                      clean
#
# Author:              Rainer Menzner (Rainer.Menzner@web.de)
# Date:                06/20/1997
# Last modified:       2005-05-01
#
# Contributions by H.Kakugawa to use libtool!

LIBTOOL   = ../libtool
SHELL     = /bin/sh
CC        = gcc
CPP       = gcc -E
CFLAGS    = -g -O2 -DT1LIB_IDENT="\"5.1.0\"" -DGLOBAL_CONFIG_DIR="\"${prefix}/share/t1lib\"" -DT1LIB_NO_X11_SUPPORT
OPTIONS   = 
X_LIBS    = 
TOPSRC    = ..
XPM_LIB   = -lXpm
XLIB      =  -lXext -lX11 
LDFLAGS   = 
LDLIBS    = -lm
AR        = ar rc
RANLIB    = ranlib
RM        = rm -f
X_CFLAGS  = 
YACC      = @YACC@
LEX       = @LEX@
LEXLIB    = @LEXLIB@
ALLCFLAGS = $(CFLAGS)

INSTALL         = /bin/install -c
INSTALL_PROGRAM = ${INSTALL}
INSTALL_DATA    = ${INSTALL} -m 644
MKINSTALLDIRS   = ../ac-tools/mkinstalldirs
prefix          = /usr/local
exec_prefix     = ${prefix}
includedir      = ${prefix}/include
bindir          = ${exec_prefix}/bin
datadir         = ${prefix}/share
libdir          = ${exec_prefix}/lib
mandir          = ${prefix}/man/man1
manext          = .1
no_x            = yes

t1lib_version      = 5
t1lib_revision     = 1
t1lib_patchlevel   = 0
T1_AA_TYPE16       = -DT1_AA_TYPE16=short
T1_AA_TYPE32       = -DT1_AA_TYPE32=int
T1_AA_TYPE64       = 
SUBMAKE   = $(MAKE) 'CC=$(CC)' 'CFLAGS=$(ALLCFLAGS) $(T1_AA_TYPE16) $(T1_AA_TYPE32) $(T1_AA_TYPE64)' 'OPTIONS=$(OPTIONS)'




# targets to build: 

MAIN_TARGET = libt1.la
MAIN_HEADER = t1lib.h

TYPE1_OBJS = \
	type1/arith.lo \
	type1/curves.lo \
	type1/fontfcn.lo \
	type1/hints.lo \
	type1/lines.lo \
	type1/objects.lo \
	type1/paths.lo \
	type1/regions.lo \
	type1/scanfont.lo \
	type1/spaces.lo \
	type1/t1io.lo \
	type1/t1snap.lo \
	type1/t1stub.lo \
	type1/token.lo \
	type1/type1.lo \
	type1/util.lo 


T1LIB_OBJS = \
	t1lib/t1finfo.lo \
	t1lib/t1base.lo \
	t1lib/t1delete.lo \
	t1lib/t1enc.lo \
	t1lib/t1env.lo \
	t1lib/t1load.lo \
	t1lib/t1set.lo \
	t1lib/t1trans.lo \
	t1lib/t1aaset.lo \
	t1lib/t1afmtool.lo \
	t1lib/t1outline.lo \
	t1lib/t1subset.lo \
	t1lib/parseAFM.lo 


T1LIBX_OBJS = 


LIBSUBDIRS = \
	type1 \
	t1lib


all: $(MAIN_TARGET)



$(TYPE1_OBJS): type1_target
$(T1LIB_OBJS) $(T1LIBX_OBJS): t1lib_target


type1_target:
	@set -e; (cd type1; $(SUBMAKE) ) || exit 1


t1lib_target:
	@set -e; (cd t1lib; $(SUBMAKE) ) || exit 1


libt1.la: $(TYPE1_OBJS) $(T1LIB_OBJS)
	$(LIBTOOL) --mode=link \
		$(CC) -o $@ $(TYPE1_OBJS) $(T1LIB_OBJS) \
	         -version-info 6:0:1 \
		 -no-undefined -rpath $(libdir)
	cp t1lib/t1lib.h .


libt1x.la: $(T1LIBX_OBJS)
	$(LIBTOOL) --mode=link \
		$(CC) -o $@ $(T1LIBX_OBJS) \
	         -version-info 6:0:1 \
		 -no-undefined -rpath $(libdir)
	cp t1lib/t1libx.h .


.PHONY: clean


dependencies: dummy
	for i in $(LIBSUBDIRS); do \
	  (cd $$i; $(MAKE) dependencies) || exit 1; \
	done


clean: dummy
	for i in $(LIBSUBDIRS); do \
	  (cd $$i; $(MAKE) clean) || exit 1; \
	done
	-$(RM) -f libt1*.la libt1*.a libt1*.so* *~ t1lib*.h .libs/*
	-rmdir .libs


install: dummy
	$(MKINSTALLDIRS) $(DESTDIR)$(libdir)
	$(MKINSTALLDIRS) $(DESTDIR)$(includedir)
	$(MKINSTALLDIRS) $(DESTDIR)${prefix}/share/t1lib
	$(LIBTOOL) --mode=install \
		$(INSTALL_DATA) $(MAIN_TARGET) $(DESTDIR)$(libdir)
	$(LIBTOOL) --mode=install \
		$(INSTALL_DATA) $(MAIN_HEADER) $(DESTDIR)$(includedir)
	if (test -f $(DESTDIR)${prefix}/share/t1lib/t1lib.config) \
	then \
	  echo "Alert: Global configuration file exists, installation skipped!"; \
	else \
	  $(LIBTOOL) --mode=install $(INSTALL_DATA) t1lib.config $(DESTDIR)${prefix}/share/t1lib; \
	fi;


uninstall: dummy
	-$(LIBTOOL) --mode=uninstall $(RM) $(DESTDIR)$(libdir)/libt1.la
	-$(LIBTOOL) --mode=uninstall $(RM) $(DESTDIR)$(libdir)/libt1x.la
	-$(LIBTOOL) --mode=uninstall $(RM) $(DESTDIR)$(includedir)/t1lib.h
	-$(LIBTOOL) --mode=uninstall $(RM) $(DESTDIR)$(includedir)/t1libx.h
	-$(LIBTOOL) --mode=uninstall $(RM) $(DESTDIR)${prefix}/share/t1lib/t1lib.config


dummy:

