1# $Id: makefile.in,v 1.18 2012/09/29 13:10:15 Adrian.Bunk Exp $
2#
3# UNIX template-makefile for Berkeley Yacc
4
5THIS		= yacc
6
7#### Start of system configuration section. ####
8
9srcdir 		= @srcdir@
10VPATH  		= @srcdir@
11
12CC		= @CC@
13
14INSTALL		= @INSTALL@
15INSTALL_PROGRAM	= @INSTALL_PROGRAM@
16INSTALL_DATA	= @INSTALL_DATA@
17transform	= @program_transform_name@
18
19DEFINES		=
20EXTRA_CFLAGS	= @EXTRA_CFLAGS@
21CPPFLAGS	= -I. -I$(srcdir) $(DEFINES) -DHAVE_CONFIG_H -DYYPATCH=`cat $(srcdir)/VERSION` @CPPFLAGS@
22CFLAGS		= @CFLAGS@ $(CPPFLAGS) $(EXTRA_CFLAGS)
23
24LDFLAGS		= @LDFLAGS@
25LIBS		= @LIBS@
26
27CTAGS		= @CTAGS@
28ETAGS		= @ETAGS@
29LINT		= @LINT@
30
31prefix		= @prefix@
32exec_prefix	= @exec_prefix@
33
34datarootdir	= @datarootdir@
35bindir		= $(DESTDIR)@bindir@
36mandir		= $(DESTDIR)@mandir@/man1
37manext		= 1
38
39testdir		= $(srcdir)/test
40
41x		= @EXEEXT@
42o		= .@OBJEXT@
43
44#### End of system configuration section. ####
45
46SHELL		= /bin/sh
47@SET_MAKE@
48
49H_FILES = \
50	defs.h
51
52C_FILES = \
53	closure.c \
54	error.c \
55	graph.c \
56	lalr.c \
57	lr0.c \
58	main.c \
59	mkpar.c \
60	output.c \
61	reader.c \
62	skeleton.c \
63	symtab.c \
64	verbose.c \
65	warshall.c
66
67OBJS	= \
68	closure$o \
69	error$o \
70	graph$o \
71	lalr$o \
72	lr0$o \
73	main$o \
74	mkpar$o \
75	output$o \
76	reader$o \
77	skeleton$o \
78	symtab$o \
79	verbose$o \
80	warshall$o
81
82TRANSFORM_BIN = sed 's/$x$$//'       |sed '$(transform)'|sed 's/$$/$x/'
83TRANSFORM_MAN = sed 's/$(manext)$$//'|sed '$(transform)'|sed 's/$$/$(manext)/'
84
85actual_bin = `echo $(THIS)$x        | $(TRANSFORM_BIN)`
86actual_man = `echo $(THIS).$(manext)| $(TRANSFORM_MAN)`
87
88all : $(THIS)$x
89
90install: all installdirs
91	$(INSTALL_PROGRAM) $(THIS)$x $(bindir)/$(actual_bin)
92	- $(INSTALL_DATA) $(srcdir)/$(THIS).1 $(mandir)/$(actual_man)
93
94installdirs:
95	mkdir -p $(bindir)
96	- mkdir -p $(mandir)
97
98uninstall:
99	- rm -f $(bindir)/$(actual_bin)
100	- rm -f $(mandir)/$(actual_man)
101
102################################################################################
103.SUFFIXES : $o .i .html .$(manext) .cat .ps .pdf .txt
104
105.c$o:
106	@RULE_CC@
107	@ECHO_CC@$(CC) -c $(CFLAGS) $<
108
109.c.i :
110	@RULE_CC@
111	@ECHO_CC@$(CPP) -C $(CPPFLAGS) $*.c >$@
112
113.$(manext).cat :
114	- nroff -man $(srcdir)/$(THIS).$(manext) >$@
115
116.$(manext).html :
117	GROFF_NO_SGR=stupid $(SHELL) -c "tbl $*.$(manext) | groff -Thtml -man" >$@
118
119.$(manext).ps :
120	$(SHELL) -c "tbl $*.$(manext) | groff -man" >$@
121
122.$(manext).txt :
123	GROFF_NO_SGR=stupid $(SHELL) -c "tbl $*.$(manext) | nroff -Tascii -man | col -bx" >$@
124
125.ps.pdf :
126	ps2pdf $*.ps
127
128################################################################################
129
130$(THIS)$x : $(OBJS)
131	@ECHO_LD@$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(OBJS) $(LIBS)
132
133mostlyclean :
134	- rm -f core .nfs* *$o *.bak *.BAK *.out
135
136clean : mostlyclean
137	- rm -f $(THIS)$x
138
139distclean : clean
140	- rm -f config.log config.cache config.status config.h makefile
141	- rm -f *.html *.cat *.pdf *.ps *.txt
142	- cd test && rm -f test-*
143
144realclean: distclean
145	- rm -f tags TAGS
146
147################################################################################
148docs :: $(THIS).html \
149	$(THIS).pdf \
150	$(THIS).ps \
151	$(THIS).txt
152$(THIS).html : $(THIS).$(manext)
153$(THIS).pdf : $(THIS).ps
154$(THIS).ps : $(THIS).$(manext)
155$(THIS).txt : $(THIS).$(manext)
156################################################################################
157check:	$(THIS)$x
158	$(SHELL) $(testdir)/run_test.sh $(testdir)
159
160check_make: $(THIS)$x
161	$(SHELL) $(testdir)/run_make.sh $(testdir)
162
163check_lint:
164	$(SHELL) $(testdir)/run_lint.sh $(testdir)
165################################################################################
166tags: $(H_FILES) $(C_FILES) 
167	$(CTAGS) $(C_FILES) $(H_FILES)
168
169lint: $(C_FILES) 
170	$(LINT) $(CPPFLAGS) $(C_FILES)
171
172@MAKE_UPPER_TAGS@TAGS: $(H_FILES) $(C_FILES) 
173@MAKE_UPPER_TAGS@	$(ETAGS) $(C_FILES) $(H_FILES)
174
175depend:
176	makedepend -- $(CPPFLAGS) -- $(C_FILES)
177
178$(OBJS) : defs.h
179
180main$o \
181skeleton$o : makefile VERSION
182
183# DO NOT DELETE THIS LINE -- make depend depends on it.
184