# This is Makefile for extended KS-to-TeX converter.
# It is tested with gcc-2.3.3(UNIX) and emx-0.8f/gcc-2.3.3(OS/2).
# Feel free to adjust for your system.

SHELL = /bin/sh

VERSION = 0.3

SRC1 = htex-mule.c
SRC2 = jhtex.c index.c hanjaa.c hanjab.c hanjac.c hanjad.c hanjae.c
HEADER1 = table.h
HEADER2 = index.h jtablea.h jtableb.h jtablec.h jtabled.h jtablee.h

# For Unix users, uncomment the following line.
PROGRAM = htex
# If you use Mule, uncomment the following two lines.
SRC = $(SRC1)
HEADER = $(HEADER1)
# If you use plain KS editor, uncomment the following two lines.
#SRC = $(SRC2)
#HEADER = $(HEADER1) $(HEADER2)

# For OS/2 users, uncomment the following three lines.
#PROGRAM = htexp.exe
#SRC = $(SRC2)
#HEADER = $(HEADER2)

# Adjust according to your system
LATEX = nfss
PREVIEWER = xdvi

CC = gcc
CFLAGS = -O2

all : $(PROGRAM)

$(PROGRAM) : $(SRC) $(HEADER)
	gcc $(CFLAGS) $(SRC) -o htex

jhtex.c: table.h
index.c: index.h
hanjaa.c: jtablea.h
hanjab.c: jtableb.h
hanjac.c: jtablec.h
hanjad.c: jtabled.h
hanjae.c: jtablee.h

# You need reference table, if you use plain KS editor
ref : ref.ks $(PROGRAM)
	./$(PROGRAM) ref.ks ref.tex
	$(LATEX) ref.tex
	$(PREVIEWER) ref.dvi

dist :
	tar czvf jhtex-$(VERSION).tar.gz $(SRC1) $(SRC2) $(HEADER1) \
	$(HEADER2)  Makefile ref.ks unknown.tex README.* ChangeLog.ks \
	dos/ os2/ contrib/
