# Makefile for dviljk --kb@cs.umb.edu.
version = 2.5

ac_include ../make/paths.make

# See INSTALL for compilation options.
DEFS = $(XDEFS) -Dunix

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

common_objects = tfm.o

program = dvilj
objects = dvilj.o $(common_objects)
objects2p = dvilj2p.o $(common_objects)
program2p = dvilj2p
objects4 = dvilj4.o $(common_objects)
program4 = dvilj4
objects4l = dvilj4l.o $(common_objects)
program4l = dvilj4l

programs = $(program) $(program2p) $(program4) $(program4l)

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

$(program): $(kpathsea) $(objects)
	$(CC) $(LDFLAGS) -o $@ $(objects) $(LOADLIBES)

$(program2p): $(objects2p) $(kpathsea)
	$(CC) $(LDFLAGS) -o $@ $(objects2p) $(LOADLIBES)

$(program4): $(objects4) $(kpathsea)
	$(CC) $(LDFLAGS) -o $@ $(objects4) $(LOADLIBES)

$(program4l): $(objects4l) $(kpathsea)
	$(CC) $(LDFLAGS) -o $@ $(objects4l) $(LOADLIBES)

dvilj.o:
	$(CC) $(CPPFLAGS) $(CFLAGS) -DLJ -c dvi2xx.c
	mv dvi2xx.o $@

dvilj2p.o:
	$(CC) $(CPPFLAGS) $(CFLAGS) -DLJ2P -c dvi2xx.c
	mv dvi2xx.o $@

dvilj4.o:
	$(CC) $(CPPFLAGS) $(CFLAGS) -DLJ4 -c dvi2xx.c
	mv dvi2xx.o $@

dvilj4l.o:
	$(CC) $(CPPFLAGS) $(CFLAGS) -DLJ4 -DLJ4L -c dvi2xx.c
	mv dvi2xx.o $@

ac_include ../make/tkpathsea.make

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

install-exec:
	$(SHELL) $(top_srcdir)/../mkdirchain $(bindir)
	test ! -f $(program) \
	  || $(INSTALL_PROGRAM) $(program) $(bindir)/$(program)
	test ! -f $(program2p) \
	  || $(INSTALL_PROGRAM) $(program2p) $(bindir)/$(program2p)
	test ! -f $(program4) \
	  || $(INSTALL_PROGRAM) $(program4) $(bindir)/$(program4)
	test ! -f $(program4l) \
	  || $(INSTALL_PROGRAM) $(program4l) $(bindir)/$(program4l)
uninstall-exec:
	cd $(bindir); rm -f $(programs)

install-data:
	$(SHELL) $(top_srcdir)/../mkdirchain $(mandir) $(texinputdir) $(fontdir)
	$(INSTALL_DATA) $(srcdir)/dvilj.man $(mandir)/dvilj.$(manext)
	($(install_macros) && (cd tex; $(CP_R) . $(texinputdir))) || true
	($(install_fonts) && (cd fonts; $(CP_R) . $(fontdir))) || true	

uninstall-data:
	rm -f $(mandir)/dvilj.$(manext)


distname = dviljk
program_files = dvilj.man README.fonts
version_files = dvi2xx.c

pre-dist-$(distname):
post-dist-$(distname):
	cd $(distdir); ln -s $(lj)/fonts $(lj)/tex $(lj)/contrib .

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
dvilj.o dvilj2p.o dvilj4.o dvilj4l.o: dvi2xx.c $(kpathsea_srcdir)/config.h ./c-auto.h $(kpathsea_srcdir)/c-std.h \
  $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
  $(kpathsea_srcdir)/c-memstr.h \
  $(kpathsea_srcdir)/c-errno.h $(kpathsea_srcdir)/c-minmax.h \
  $(kpathsea_srcdir)/c-limits.h \
  $(kpathsea_srcdir)/c-proto.h \
  $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/debug.h \
  $(kpathsea_srcdir)/magstep.h $(kpathsea_srcdir)/proginit.h $(kpathsea_srcdir)/progname.h \
  $(kpathsea_srcdir)/tex-glyph.h $(kpathsea_srcdir)/tex-file.h config.h commands.h 
tfm.o: tfm.c $(kpathsea_srcdir)/config.h ./c-auto.h $(kpathsea_srcdir)/c-std.h \
  $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
  $(kpathsea_srcdir)/c-memstr.h \
  $(kpathsea_srcdir)/c-errno.h $(kpathsea_srcdir)/c-minmax.h \
  $(kpathsea_srcdir)/c-limits.h \
  $(kpathsea_srcdir)/c-proto.h \
  $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/debug.h \
  $(kpathsea_srcdir)/c-fopen.h $(kpathsea_srcdir)/tex-file.h config.h
