xref: /freebsd/contrib/byacc/makefile.in (revision 451bcf1b360146af0759ac18c9cc55f0a36cc386)
1# $Id: makefile.in,v 1.24 2015/07/05 22:12:29 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
27AWK		= @AWK@
28CTAGS		= @CTAGS@
29ETAGS		= @ETAGS@
30LINT		= @LINT@
31LINTFLAGS	= @LINT_OPTS@
32
33prefix		= @prefix@
34exec_prefix	= @exec_prefix@
35
36datarootdir	= @datarootdir@
37bindir		= $(DESTDIR)@bindir@
38mandir		= $(DESTDIR)@mandir@/man1
39manext		= 1
40
41testdir		= $(srcdir)/test
42
43SKELETON	= @SKELETON@
44x		= @EXEEXT@
45o		= .@OBJEXT@
46
47#### End of system configuration section. ####
48
49SHELL		= /bin/sh
50@SET_MAKE@
51
52H_FILES = \
53	defs.h
54
55C_FILES = \
56	closure.c \
57	error.c \
58	graph.c \
59	lalr.c \
60	lr0.c \
61	main.c \
62	mkpar.c \
63	mstring.c \
64	output.c \
65	reader.c \
66	$(SKELETON).c \
67	symtab.c \
68	verbose.c \
69	warshall.c
70
71OBJS	= \
72	closure$o \
73	error$o \
74	graph$o \
75	lalr$o \
76	lr0$o \
77	main$o \
78	mkpar$o \
79	mstring$o \
80	output$o \
81	reader$o \
82	$(SKELETON)$o \
83	symtab$o \
84	verbose$o \
85	warshall$o
86
87YACCPAR	= \
88	btyaccpar.c \
89	yaccpar.c
90
91TRANSFORM_BIN = sed 's/$x$$//'       |sed '$(transform)'|sed 's/$$/$x/'
92TRANSFORM_MAN = sed 's/$(manext)$$//'|sed '$(transform)'|sed 's/$$/$(manext)/'
93
94actual_bin = `echo $(THIS)$x        | $(TRANSFORM_BIN)`
95actual_man = `echo $(THIS).$(manext)| $(TRANSFORM_MAN)`
96
97all : $(THIS)$x
98
99install: all installdirs
100	$(INSTALL_PROGRAM) $(THIS)$x $(bindir)/$(actual_bin)
101	- $(INSTALL_DATA) $(srcdir)/$(THIS).1 $(mandir)/$(actual_man)
102
103installdirs:
104	mkdir -p $(bindir)
105	- mkdir -p $(mandir)
106
107uninstall:
108	- rm -f $(bindir)/$(actual_bin)
109	- rm -f $(mandir)/$(actual_man)
110
111################################################################################
112.SUFFIXES : .c $o .i .skel
113
114.c$o:
115	@RULE_CC@
116	@ECHO_CC@$(CC) -c $(CFLAGS) $<
117
118.c.i :
119	@RULE_CC@
120	@ECHO_CC@$(CPP) -C $(CPPFLAGS) $*.c >$@
121
122.skel.c :
123	$(AWK) -f $(srcdir)/skel2c $*.skel > $@
124
125################################################################################
126
127$(THIS)$x : $(OBJS)
128	@ECHO_LD@$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(OBJS) $(LIBS)
129
130mostlyclean :
131	- rm -f core .nfs* *$o *.bak *.BAK *.out
132
133clean :: mostlyclean
134	- rm -f $(THIS)$x
135
136distclean :: clean
137	- rm -f config.log config.cache config.status config.h makefile man2html.tmp
138	- rm -f $(testdir)/yacc/test-* $(testdir)/btyacc/test-*
139
140realclean :: distclean
141	- rm -f tags TAGS
142
143sources : $(YACCPAR)
144
145maintainer-clean :: realclean
146	rm -f $(YACCPAR)
147
148################################################################################
149check:	$(THIS)$x
150	$(SHELL) $(testdir)/run_test.sh $(testdir)
151
152check_make: $(THIS)$x
153	$(SHELL) $(testdir)/run_make.sh $(testdir)
154
155check_lint:
156	$(SHELL) $(testdir)/run_lint.sh $(testdir)
157################################################################################
158tags: $(H_FILES) $(C_FILES)
159	$(CTAGS) $(C_FILES) $(H_FILES)
160
161lint: $(C_FILES)
162	$(LINT) $(LINTFLAGS) $(CPPFLAGS) $(C_FILES)
163
164@MAKE_UPPER_TAGS@TAGS: $(H_FILES) $(C_FILES)
165@MAKE_UPPER_TAGS@	$(ETAGS) $(C_FILES) $(H_FILES)
166
167depend:
168	makedepend -- $(CPPFLAGS) -- $(C_FILES)
169
170$(OBJS) : defs.h makefile
171
172main$o \
173$(SKELETON)$o : VERSION
174
175# DO NOT DELETE THIS LINE -- make depend depends on it.
176