-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile.in
210 lines (165 loc) · 7.51 KB
/
Makefile.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
# $MawkId: Makefile.in,v 1.49 2016/09/30 11:21:47 tom Exp $
# Makefile-template for MAWK
###############################################################################
# copyright 2009-2015,2016 Thomas E. Dickey
# copyright 2010, Guido Berhoerster
# copyright 2009, Jonathan Nieder
# copyright 2005, Aleksey Cheusov
# copyright 1996, Michael D. Brennan
#
# This is a source file for mawk, an implementation of
# the AWK programming language.
#
# Mawk is distributed without warranty under the terms of
# the GNU General Public License, version 2, 1991.
###############################################################################
SHELL=/bin/sh
####################################
srcdir = @srcdir@
srcdir_sl = @srcdir@/
VPATH = @srcdir@
x = @EXEEXT@
o = .@OBJEXT@
prefix = @prefix@
exec_prefix = @exec_prefix@
datarootdir = @datarootdir@
srcdir = @srcdir@
manext = 1
bindir = @bindir@
mandir = @mandir@/man$(manext)
CC = @CC@
CPP = @CPP@
BUILD_CC = @BUILD_CC@
CPPFLAGS = -I. -I$(srcdir) -DHAVE_CONFIG_H @CPPFLAGS@
EXTRA_CFLAGS = @EXTRA_CFLAGS@
CFLAGS = @CFLAGS@ $(EXTRA_CFLAGS)
LDFLAGS = @CFLAGS@ @LDFLAGS@
LIBS = @LIBS@
BUILD_CFLAGS = @BUILD_CFLAGS@
BUILD_CPPFLAGS = -I. -I$(srcdir) -DHAVE_CONFIG_H @BUILD_CPPFLAGS@
BUILD_LDFLAGS = @BUILD_LDFLAGS@
BUILD_LIBS = @BUILD_LIBS@
BUILD_EXEEXT = @BUILD_EXEEXT@
BUILD_OBJEXT = @BUILD_OBJEXT@
MAKE_RECUR = @cf_cv_makeflags@ prefix=$(prefix) DESTDIR=$(DESTDIR)
YACC = @YACC@
CTAGS = @CTAGS@
ETAGS = @ETAGS@
LINT = @LINT@
LINTOPTS =
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
transform = @program_transform_name@
# where to put mawk
BINDIR = $(DESTDIR)$(bindir)
# where to put the man pages
MANDIR = $(DESTDIR)$(mandir)
#######################################
actual_PROG = `echo mawk| sed '$(transform)'`
binary_PROG = $(actual_PROG)$x
PROG = mawk$x
OBJS = parse$o scan$o memory$o main$o hash$o execute$o code$o \
da$o error$o init$o bi_vars$o cast$o print$o bi_funct$o \
kw$o jmp$o array$o field$o split$o re_cmpl$o regexp$o zmalloc$o \
fin$o files$o scancode$o matherr$o fcall$o version$o @EXTRAOBJS@
.SUFFIXES: .c .i .s $o
.c.i :
@RULE_CC@
@ECHO_CC@$(CPP) -C $(CPPFLAGS) $< >$@
.c.s :
@echo compiling $<
@$(CC) -S $(CFLAGS) $(CPPFLAGS) $< -o $@ # >$@
.c$o :
@RULE_CC@
@ECHO_CC@$(CC) -c $(CPPFLAGS) $(CFLAGS) $<
all : $(PROG)
check : mawk_test fpe_test
$(PROG) : $(OBJS)
@ECHO_LD@$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
CHECK = MAWK=`pwd`/$(PROG); export MAWK; cd $(srcdir)/test; echo "** $@"
mawk_test : $(PROG) # test that we have a sane mawk
@sh -c '$(CHECK); ./mawktest'
fpe_test : $(PROG) # test FPEs are handled OK
@sh -c '$(CHECK); ./fpe_test'
parse.c : parse.y
@echo expect 4 shift/reduce conflicts
$(YACC) -d parse.y
sed -e '/^#line/s%"y.tab.c"%"parse.c"%' y.tab.c >parse.c
rm -f y.tab.c
-if cmp -s y.tab.h parse.h ;\
then rm y.tab.h ;\
else mv y.tab.h parse.h ; fi
NOIDENT = sed -e 's/[$$]MawkId\([^$$]*\)[$$]/@MawkId\1@/'
array.c : array.w
-@rm -f $@
notangle -R'"array.c"' array.w | $(NOIDENT) | cpif array.c
array.h : array.w
-@rm -f $@
notangle -R'"array.h"' array.w | $(NOIDENT) | cpif array.h
scancode.c : $(srcdir)/makescan.c scancode.h nstd.h config.h
@ECHO_LD@$(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) -o makescan$x $(srcdir)/makescan.c
rm -f scancode.c
./makescan$x > scancode.c
rm makescan$x
MAWK_BIN = $(BINDIR)/$(binary_PROG)
MAWK_MAN = $(MANDIR)/$(actual_PROG).$(manext)
install : $(BINDIR) $(MANDIR) $(PROG)
$(INSTALL_PROGRAM) $(PROG) $(MAWK_BIN)
$(INSTALL_DATA) man/mawk.1 $(MAWK_MAN)
uninstall :
rm -f $(MAWK_BIN)
rm -f $(MAWK_MAN)
clean :
-cd man && $(MAKE) $(MAKE_RECUR) $@
-rm -f y.tab.c y.tab.h makescan$x
-rm -f *$o test/$(PROG) *core* test/*core* $(PROG)
distclean : clean
-cd man && $(MAKE) $(MAKE_RECUR) $@
-rm -f scancode.c
-rm -f man2html.tmp
-rm -f defines.out maxint.out fpe_check$x tags makedeps.awk
-rm -f config.h Makefile config.status config.log config.cache
maintainer-clean : distclean
-rm -f parse.c parse.h
-rm -f array.c array.h
-rm -f configure config.guess config.sub install-sh
-rm -fr autom4te.cache
lint :
$(LINT) $(LINTOPTS) $(CPPFLAGS) $(OBJS:$o=.c)
tags :
$(CTAGS) *.[ch] */*.[ch]
@MAKE_UPPER_TAGS@TAGS :
@MAKE_UPPER_TAGS@ $(ETAGS) *.[ch] */*.[ch]
$(BINDIR) \
$(MANDIR) :
mkdir -p "$@"
# output from makedeps.sh
array.o : array.h bi_vars.h config.h field.h mawk.h memory.h nstd.h sizes.h symtype.h types.h zmalloc.h
bi_funct.o : array.h bi_funct.h bi_vars.h config.h field.h files.h fin.h init.h mawk.h memory.h nstd.h regexp.h repl.h sizes.h symtype.h types.h zmalloc.h
bi_vars.o : array.h bi_vars.h config.h field.h init.h mawk.h memory.h nstd.h sizes.h symtype.h types.h zmalloc.h
cast.o : array.h config.h field.h mawk.h memory.h nstd.h parse.h repl.h scan.h scancode.h sizes.h symtype.h types.h zmalloc.h
code.o : array.h code.h config.h field.h init.h jmp.h mawk.h memory.h nstd.h sizes.h symtype.h types.h zmalloc.h
da.o : array.h bi_funct.h code.h config.h field.h mawk.h memory.h nstd.h repl.h sizes.h symtype.h types.h zmalloc.h
error.o : array.h bi_vars.h config.h mawk.h nstd.h parse.h scan.h scancode.h sizes.h symtype.h types.h
execute.o : array.h bi_funct.h bi_vars.h code.h config.h field.h fin.h mawk.h memory.h nstd.h regexp.h repl.h sizes.h symtype.h types.h zmalloc.h
fcall.o : array.h code.h config.h mawk.h memory.h nstd.h sizes.h symtype.h types.h zmalloc.h
field.o : array.h bi_vars.h config.h field.h init.h mawk.h memory.h nstd.h parse.h regexp.h repl.h scan.h scancode.h sizes.h symtype.h types.h zmalloc.h
files.o : array.h config.h files.h fin.h init.h mawk.h memory.h nstd.h sizes.h symtype.h types.h zmalloc.h
fin.o : array.h bi_vars.h config.h field.h fin.h mawk.h memory.h nstd.h parse.h scan.h scancode.h sizes.h symtype.h types.h zmalloc.h
hash.o : array.h config.h mawk.h memory.h nstd.h sizes.h symtype.h types.h zmalloc.h
init.o : array.h bi_vars.h code.h config.h field.h init.h mawk.h memory.h nstd.h sizes.h symtype.h types.h zmalloc.h
jmp.o : array.h code.h config.h init.h jmp.h mawk.h memory.h nstd.h sizes.h symtype.h types.h zmalloc.h
kw.o : array.h config.h init.h mawk.h nstd.h parse.h sizes.h symtype.h types.h
main.o : array.h code.h config.h files.h init.h mawk.h memory.h nstd.h sizes.h symtype.h types.h zmalloc.h
makescan.o : config.h nstd.h scancode.h
matherr.o : array.h config.h init.h mawk.h nstd.h sizes.h symtype.h types.h
memory.o : config.h mawk.h memory.h nstd.h sizes.h types.h zmalloc.h
parse.o : array.h bi_funct.h bi_vars.h code.h config.h field.h files.h jmp.h mawk.h memory.h nstd.h sizes.h symtype.h types.h zmalloc.h
print.o : array.h bi_funct.h bi_vars.h config.h field.h files.h mawk.h memory.h nstd.h parse.h scan.h scancode.h sizes.h symtype.h types.h zmalloc.h
re_cmpl.o : array.h config.h mawk.h memory.h nstd.h parse.h regexp.h repl.h scan.h scancode.h sizes.h symtype.h types.h zmalloc.h
scan.o : array.h code.h config.h field.h files.h fin.h init.h mawk.h memory.h nstd.h parse.h repl.h scan.h scancode.h sizes.h symtype.h types.h zmalloc.h
split.o : array.h bi_funct.h bi_vars.h config.h field.h mawk.h memory.h nstd.h parse.h regexp.h repl.h scan.h scancode.h sizes.h symtype.h types.h zmalloc.h
version.o : array.h config.h init.h mawk.h nstd.h patchlev.h sizes.h symtype.h types.h
zmalloc.o : config.h mawk.h nstd.h sizes.h types.h zmalloc.h
regexp.o : rexpdb.c rexp4.c rexp2.c regexp_system.c sizes.h mawk.h rexp0.c rexp1.c config.h rexp.h regexp.h nstd.h rexp3.c rexp.c field.h