DESTDIR=
LIBDIR=/usr/local/lib
BINDIR=/usr/local/bin
MANDIR=/usr/man/man1
MANEXT=1

all:

# Each one-byte font may have encoding information as
#       bdf_file_name:encoding
# where encoding is 0 or 1 and defaults to 0.
# You also can specify or override the following definitions
# by manually editing 'CHARSETS'.
ASCII = etl24-latin1.bdf:0
LATIN1 = etl24-latin1.bdf:1
LATIN2 = etl24-latin2.bdf:1
LATIN3 = etl24-latin3.bdf:1
LATIN4 = etl24-latin4.bdf:1
THAI = etl24-thai.bdf:1
GREEK = etl24-greek.bdf:1
HEBREW = etl24-hebrew.bdf:1
KANA = 12x24rk.bdf:1
ROMAN = 12x24rk.bdf:0
CYRILLIC = etl24-cyrillic.bdf:1
LATIN5 = etl24-latin5.bdf:1
CHINESE = gb24st.bdf
JAPANESE = jiskan24.bdf
KOREAN = hanglm24.bdf
JP-HOJO = min-1-24.bdf
BIG5 = taipei24.bdf
VIET = etl24-viscii.bdf
SISHENG = etl24-sisheng.bdf:0
IPA = etl24-ipa.bdf:1
ARABIC0 = etl24-arabic0.bdf:0
ARABIC1 = etl24-arabic1.bdf:0
ARABIC2 = etl24-arabic2.bdf:0
ETHIO = ethiom16f.bdf:0
CNS1=cns-1-24.bdf:0
CNS2=cns-2-24.bdf:0
CNS3=cns-3-24.bdf:0
CNS4=cns-4-24.bdf:0
CNS5=cns-5-24.bdf:0
CNS6=cns-6-24.bdf:0
CNS7=cns-7-24.bdf:0

SED_SCRIPT =\
        -e "/LC:BYTES:/s/\(.*\)/\1[:BDF-FILE[:ENCODING]]/" \
        -e "/ASCII$$/s/\(.*\)/\1:${ASCII}/" \
        -e "/Latin-1$$/s/\(.*\)/\1:${LATIN1}/" \
        -e "/Latin-2$$/s/\(.*\)/\1:${LATIN2}/" \
        -e "/Latin-3$$/s/\(.*\)/\1:${LATIN3}/" \
        -e "/Latin-4$$/s/\(.*\)/\1:${LATIN4}/" \
        -e "/Thai$$/s/\(.*\)/\1:${THAI}/" \
        -e "/Greek$$/s/\(.*\)/\1:${GREEK}/" \
        -e "/Hebrew$$/s/\(.*\)/\1:${HEBREW}/" \
        -e "/Katakana$$/s/\(.*\)/\1:${KANA}/" \
        -e "/Roman$$/s/\(.*\)/\1:${ROMAN}/" \
        -e "/Cyrillic$$/s/\(.*\)/\1:${CYRILLIC}/" \
        -e "/Latin-5$$/s/\(.*\)/\1:${LATIN5}/" \
        -e "/Chinese$$/s/\(.*\)/\1:${CHINESE}/" \
        -e "/Japanese$$/s/\(.*\)/\1:${JAPANESE}/" \
        -e "/Korean$$/s/\(.*\)/\1:${KOREAN}/" \
        -e "/Japanese Supplement$$/s/\(.*\)/\1:${JP-HOJO}/" \
        -e "/Big5/s/\(.*\)/\1:${BIG5}/" \
	-e "/VISCII/s/\(.*\)/\1:${VIET}/" \
        -e "/ZhuYin$$/s/\(.*\)/\1:${SISHENG}/" \
	-e "/IPA/s/\(.*\)/\1:${IPA}/" \
	-e "/Arabic digit$$/s/\(.*\)/\1:${ARABIC0}/" \
	-e "/1-column Arabic/s/\(.*\)/\1:${ARABIC1}/" \
	-e "/2-column Arabic/s/\(.*\)/\1:${ARABIC2}/" \
	-e "/Ethio/s/\(.*\)/\1:${ETHIO}/"\
	-e "/CNS Plane1/s/\(.*\)/\1:${CNS1}/"\
	-e "/CNS Plane2/s/\(.*\)/\1:${CNS2}/"\
	-e "/CNS Plane3/s/\(.*\)/\1:${CNS3}/"\
	-e "/CNS Plane4/s/\(.*\)/\1:${CNS4}/"\
	-e "/CNS Plane5/s/\(.*\)/\1:${CNS5}/"\
	-e "/CNS Plane6/s/\(.*\)/\1:${CNS6}/"\
	-e "/CNS Plane7/s/\(.*\)/\1:${CNS7}/"

CHARSETS: charset
	sed ${SED_SCRIPT} < charset > CHARSETS

mostlyclean:
	-rm -f core

clean distclean realclean:
	-rm -f DOC* core Makefile charset* CHARSETS CODINGS

SOURCES = [0-9A-QS-Z]* README *.[ch16] emacs.* etags.* ledit.l ms-* \
	news.texi rc2log refcard.tex spook-lines termcap.* ulimit.hack \
	vcdiff vipcard.tex xmouse.doc

unlock:
	chmod u+w $(SOURCES)

relock:
	chmod u-w $(SOURCES)
