xref: /freebsd/contrib/byacc/makefile.in (revision 38f0b757fd84d17d0fc24739a7cda160c4516d81)
1# $Id: makefile.in,v 1.19 2014/01/01 14:09:43 tom 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
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################################################################################
114
115$(THIS)$x : $(OBJS)
116	@ECHO_LD@$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(OBJS) $(LIBS)
117
118mostlyclean :
119	- rm -f core .nfs* *$o *.bak *.BAK *.out
120
121clean :: mostlyclean
122	- rm -f $(THIS)$x
123
124distclean :: clean
125	- rm -f config.log config.cache config.status config.h makefile
126	- cd test && rm -f test-*
127
128realclean :: distclean
129	- rm -f tags TAGS
130
131################################################################################
132check:	$(THIS)$x
133	$(SHELL) $(testdir)/run_test.sh $(testdir)
134
135check_make: $(THIS)$x
136	$(SHELL) $(testdir)/run_make.sh $(testdir)
137
138check_lint:
139	$(SHELL) $(testdir)/run_lint.sh $(testdir)
140################################################################################
141tags: $(H_FILES) $(C_FILES)
142	$(CTAGS) $(C_FILES) $(H_FILES)
143
144lint: $(C_FILES)
145	$(LINT) $(CPPFLAGS) $(C_FILES)
146
147@MAKE_UPPER_TAGS@TAGS: $(H_FILES) $(C_FILES)
148@MAKE_UPPER_TAGS@	$(ETAGS) $(C_FILES) $(H_FILES)
149
150depend:
151	makedepend -- $(CPPFLAGS) -- $(C_FILES)
152
153$(OBJS) : defs.h
154
155main$o \
156skeleton$o : makefile VERSION
157
158# DO NOT DELETE THIS LINE -- make depend depends on it.
159