# Makefile for kpse_tools, te@informatik.uni-hannover.de
version = 0.2
package = kpsetools-$(version)

ac_include ../make/paths.make

# See INSTALL for compilation options.
DEFS = $(XDEFS)
LDFLAGS = $(CFLAGS)

ac_include ../make/common.make
ac_include ../make/programs.make

programs = kpsetool

default: $(programs)
all: $(programs)

kpsetool:    kpsetool.o $(kpathsea)
	$(CC) $(LDFLAGS) -o $@ kpsetool.o $(kpathsea)
	@cd ../bin; rm -f kpsetool kpsepath kpsewhich kpsexpand
	@ln -s ../kpsetool/kpsetool ../bin/kpsetool
	@ln -s kpsetool ../bin/kpsepath
	@ln -s kpsetool ../bin/kpsewhich
	@ln -s kpsetool ../bin/kpsexpand

install: install-exec install-data
uninstall: uninstall-exec uninstall-data

install-exec: default
	$(SHELL) $(top_srcdir)/../mkdirchain $(bindir)
	test ! -f kpsetool || \
	    $(INSTALL_PROGRAM) kpsetool $(bindir)/kpsetool
	rm -f $(bindir)/kpsepath $(bindir)/kpsewhich $(bindir)/kpsexpand
	test ! -f $(bindir)/kpsetool || \
	    ln -s kpsetool $(bindir)/kpsepath
	test ! -f $(bindir)/kpsetool || \
	    ln -s kpsetool $(bindir)/kpsewhich
	test ! -f $(bindir)/kpsetool || \
	    ln -s kpsetool $(bindir)/kpsexpand

uninstall-exec:
	cd $(bindir); rm -f $(programs)

install-data:

uninstall-data:


distname = tools
program_files = 
version_files = 

pre-dist-$(distname):
post-dist-$(distname):

ac_include ../make/dist.make
ac_include ../make/config.make

info dvi check:

ac_include ../make/misc.make

mostlyclean::
	rm -f $(programs)

ac_include ../make/rdepend.make
kpsetool.o : kpsetool.c $(kpathsea_dir)/config.h ./c-auto.h $(kpathsea_dir)/c-std.h \
  $(kpathsea_dir)/c-unistd.h $(kpathsea_dir)/systypes.h \
  $(kpathsea_dir)/c-memstr.h \
  $(kpathsea_dir)/c-errno.h $(kpathsea_dir)/c-minmax.h $(kpathsea_dir)/c-limits.h \
  $(kpathsea_dir)/c-proto.h \
  $(kpathsea_dir)/lib.h $(kpathsea_dir)/types.h $(kpathsea_dir)/debug.h $(kpathsea_dir)/c-fopen.h \
  $(kpathsea_dir)/tex-file.h $(kpathsea_dir)/paths.h
