386BSD 0.1 development
[unix-history] / usr / src / usr.bin / groff / pic / Makefile.gnu
CommitLineData
e79d4cdd
WJ
1#Copyright (C) 1989, 1990, 1991 Free Software Foundation, Inc.
2# Written by James Clark (jjc@jclark.uucp)
3#
4#This file is part of groff.
5#
6#groff is free software; you can redistribute it and/or modify it under
7#the terms of the GNU General Public License as published by the Free
8#Software Foundation; either version 1, or (at your option) any later
9#version.
10#
11#groff is distributed in the hope that it will be useful, but WITHOUT ANY
12#WARRANTY; without even the implied warranty of MERCHANTABILITY or
13#FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14#for more details.
15#
16#You should have received a copy of the GNU General Public License along
17#with groff; see the file LICENSE. If not, write to the Free Software
18#Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
19
20BINDIR=/usr/local/bin
21CC=g++
22CFLAGS=-g -O -Wall
23DEFINES=-DTEX_SUPPORT # -DFIG_SUPPORT
24INCLUDES=-I../lib
25MLIBS=-lm
26YACCFLAGS=-v
27YACC=bison -y
28ETAGS=etags
29ETAGSFLAGS=-p
30GPERF=gperf
31GPERFFLAGS=-p -a -t -k 1,3,4 -c -C -N lookup_keyword -T
32
33OBJECTS=pic.tab.o lex.o main.o object.o common.o troff.o tex.o key.o # fig.o
34SOURCES=pic.y lex.c main.c object.c common.c troff.c tex.c key.c \
35 pic.h text.h output.h object.h common.h key.h position.h
36MISC=Makefile TODO pic.gperf
37
38.c.o:
39 $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $<
40
41all: pic
42
43pic: $(OBJECTS) ../lib/libgroff.a
44 $(CC) $(LDFLAGS) -o $@ $(OBJECTS) ../lib/libgroff.a $(MLIBS)
45
46pic.tab.c: pic.y
47 $(YACC) $(YACCFLAGS) -d pic.y
48 mv y.tab.c pic.tab.c
49 mv y.tab.h pic.tab.h
50
51PIC_H= pic.h text.h output.h position.h \
52 ../lib/lib.h ../lib/errarg.h ../lib/error.h ../lib/assert.h \
53 ../lib/stringclass.h ../lib/cset.h
54
55pic.tab.o: $(PIC_H) object.h
56object.o: $(PIC_H) object.h
57troff.o: $(PIC_H) common.h
58tex.o: $(PIC_H) common.h
59# fig.o: $(PIC_H)
60common.o: $(PIC_H) common.h
61main.o: $(PIC_H)
62lex.o: $(PIC_H) pic.tab.c object.h key.h
63key.o: $(PIC_H) key.h pic.tab.c object.h
64
65key.c: pic.gperf
66 $(GPERF) $(GPERFFLAGS) pic.gperf >$@
67
68TAGS : $(SOURCES)
69 $(ETAGS) $(ETAGSFLAGS) $(SOURCES)
70
71clean:
72 -rm -f *.o core pic
73
74distclean: clean
75 -rm -f pic.output y.output TAGS
76
77realclean: distclean
78 -rm -f pic.tab.c pic.tab.h key.c
79
80install.bin: pic
81 -[ -d $(BINDIR) ] || mkdir $(BINDIR)
82 cp pic $(BINDIR)/gpic
83
84install.nobin:
85
86install: install.bin install.nobin