#####################################
##
# This ia a BIG5 fix program
#
#####################################
#
CC=gcc
OPT=-g
#BIG5FIXLIB = /usr/local/lib/big5fix
BIG5FIXLIB = /tmp/big5fix
######################################33
CFLAGS= -DBIG5FIXLIB=\"$(BIG5FIXLIB)\"
VERSION=0.10
OBJS =big5fix.o readstat.o file.o
SRCS =big5fix.c readstat.c file.c
EXES = big5fix big5cmp readstat
TABS = fix-char.tab fix-word.tab fix-misc.tab

.c.o:
	$(CC) -c $(OPT) $(CFLAGS) $*.c


all: $(EXES)

big5fix: $(OBJS)
	$(CC) -o big5fix $(OBJS)

big5cmp: big5cmp.o
	$(CC) -o big5cmp big5cmp.o

readstat: readstat.o  file.o
	$(CC) -o readstat $(CFLAGS) -DREADSTAT readstat.c file.o

clean:
	rm -f *.o core big5fix big5cmp readstat

depend:
	 makedepend -- $(CFLAGS) -- $(SRCS)

install:
	(test -d $(BIG5FIXLIB) || mkdir $(BIG5FIXLIB))
	cp $(TABS) $(BIG5FIXLIB)
	big5fix -v < /dev/null

distribution:
	/bin/rm -rf /tmp/big5fix-$(VERSION)
	mkdir /tmp/big5fix-$(VERSION)
	cp pass7 corrupt.fix corrupt.sample corrupt.txt $(TABS) README $(SRCS) *.h big5cmp.c Makefile /tmp/big5fix-$(VERSION)
	(cd /tmp; tar cf - big5fix-$(VERSION) | gzip -c > big5fix-$(VERSION).tar.gz)

ftp:
	rcp /tmp/big5fix-$(VERSION).tar.gz README ccsun42:/home/CSIE/big5fix
	
# DO NOT DELETE THIS LINE -- make depend depends on it.
