# %W% (mg@ukc) %G%
CFLAGS = -O
dbbc: dbbc1.o dbbc2.o bbcplot.o draw.o charset.o tables.o
	cc $(CFLAGS) -o dbbc dbbc1.o dbbc2.o bbcplot.o draw.o charset.o tables.o

bbcplot.o: bbcplot.c bbcplot.h

dbbc2.o: dbbc2.c bbcplot.h

charset.c: charset chargen
	./chargen < charset > charset.c

charset.o: charset.c

tables.o: tables.c types.h bbcplot.h

chargen: chargen.c
	cc $(CFLAGS) -o chargen chargen.c

draw.o: draw.c bbcplot.h
	cc $(CFLAGS) -c draw.c
	ld -x -r draw.o -lm
	mv a.out draw.o

seechars: seechars.o charset.o bbcplot.o
	cc -o seechars seechars.o charset.o bbcplot.o

cktables: cktables.o tables.o charset.o
	cc -o cktables cktables.o tables.o charset.o
	cktables
	rm cktables

inst-dbbc: dbbc
	install -m 751 dbbc /usr/lib/ditroff/dbbc

tags: dbbc1.c dbbc2.c charset.c draw.c bbcplot.c tables.c
	ctags dbbc1.c dbbc2.c charset.c draw.c bbcplot.c tables.c

lint:
	lint -a dbbc1.c dbbc2.c draw.c bbcplot.c charset.c tables.c

clean:
	rm -f *.out *.o chargen cktables charset.c seechars errs tags

print:
	lph -Plppl -L dbbc1.c dbbc2.c tables.c draw.c bbcplot.c bbcplot.h dev.h dbbc.h types.h chargen.c cktables.c seechars.c makefile
