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
  
211
  
212
  
213
  
214
  
215
  
216
  
217
  
218
  
219
  
220
  
221
  
222
  
223
  
224
  
225
  
226
  
227
  
228
  
229
  
230
  
231
  
232
  
233
  
234
  
235
  
236
  
237
  
238
  
239
  
240
  
241
  
242
  
243
  
244
  
245
  
246
  
247
  
248
  
249
  
250
  
251
  
252
  
253
  
254
  
255
  
256
  
257
  
258
  
259
  
260
  
261
  
262
  
263
  
264
  
265
  
266
  
267
  
268
  
269
  
270
  
271
  
272
  
273
  
274
  
275
  
276
  
277
  
278
  
279
  
280
  
281
  
282
  
283
  
284
  
# This line is needed on some machines. 
@SET_MAKE@ 
 
# Don't change this line.  Define EXTRALIBS before this line if you 
# wish to add any libraries. 
LIBS=@LIBS@ $(EXTRALIBS) 
 
# not used yet 
INSTALL=@INSTALL@ 
 
SRCDIR=@srcdir@ 
VPATH=@srcdir@ 
 
# These are used while compiling 
LIBDIR_SRC = @LIBDIR@ 
TMP_BINDIR = @BINDIR@ 
TMP_BUILDDIR = @BUILDDIR@ 
TMP_DOCDIR = @DOCDIR@ 
TMP_LIBDIR = $(TMP_BUILDDIR)/lib 
 
prefix = @prefix@ 
exec_prefix = $(prefix)/bin 
lib_prefix = $(prefix)/lib/pike 
 
# 
# use bison please, yacc isn't good enough. 
# 
YACC=@YACC@ 
YFLAGS=-d -v 
 
# If you don't have 'strchr', then add next flag to CFLAGS. 
# -Dstrchr=index -Dstrrchr=rindex 
# 
PROFIL= 
#PROFIL=-pg 
 
# 
#Enable warnings from the compiler, if wanted. 
# 
WARN=@WARN@ 
 
#add extra defines here 
# Be sure to use -g  when looking for bugs 
DEFINES=@CPPFLAGS@ 
 
# -O should work with all compilers 
OPTIMIZE=@OPTIMIZE@ 
 
# Preprocessor flags. 
PREFLAGS=-I. -I$(SRCDIR) $(DEFINES) 
OTHERFLAGS=@CFLAGS@ $(OSFLAGS) $(OPTIMIZE) $(WARN) $(PROFIL) 
CFLAGS=$(PREFLAGS) $(OTHERFLAGS) 
 
CC=@CC@ 
CPP=@CPP@ 
 
LD=$(CC) 
LDFLAGS=$(CFLAGS) @LDFLAGS@ @LINKFORSHARED@ 
 
RUNPIKE=$(TMP_BUILDDIR)/pike -m $(TMP_LIBDIR)/master.pike $(PIKEOPTS) 
 
MAKE_FLAGS = "prefix=$(prefix)" "exec_prefix=$(exec_prefix)" "CC=$(CC)" "OTHERFLAGS=$(OTHERFLAGS)" "TMP_BINDIR=$(TMP_BINDIR)" "DEFINES=$(DEFINES)" "TMP_LIBDIR=$(TMP_LIBDIR)" "RUNPIKE=$(RUNPIKE)" "INSTALL=$(INSTALL)" 
 
# Add alloca.o if you don't have alloca() on your machine. 
# Add ualarm.o if you don't have ualarm() on your machine. 
# 
OBJ= \ 
 language.o \ 
 constants.o \ 
 array.o \ 
 backend.o \ 
 builtin_functions.o \ 
 callback.o \ 
 encode.o \ 
 docode.o \ 
 dynamic_buffer.o \ 
 dynamic_load.o \ 
 error.o \ 
 fd_control.o \ 
 fsort.o \ 
 gc.o \ 
 hashtable.o \ 
 interpret.o \ 
 las.o \ 
 lex.o \ 
 multiset.o \ 
 signal_handler.o \ 
 pike_types.o \ 
 main.o \ 
 mapping.o \ 
 memory.o \ 
 module.o \ 
 module_support.o \ 
 object.o \ 
 opcodes.o \ 
 operators.o \ 
 peep.o \ 
 port.o \ 
 program.o \ 
 rusage.o \ 
 stralloc.o \ 
 stuff.o \ 
 threads.o \ 
 version.o \ 
 svalue.o @EXTRA_OBJS@ 
 
# 
# User callable targets 
# 
 
 
all: module_objects 
        $(MAKE) $(MAKE_FLAGS) pike 
 
pike: $(OBJ) modules/linker_options 
        -mv pike pike.old 
        $(LD) $(LDFLAGS) $(OBJ) `cat modules/linker_options` $(LIBS) -o pike 
 
# purify 
pure: $(OBJ) module_objects 
        -mv pike pike.old 
        purify -free-queue-length=500 -inuse-at-exit=yes -chain-length=12 gcc $(LDFLAGS) $(OBJ) `cat modules/linker_options` $(LIBS) -o pike 
 
# purecov 
cover: $(OBJ) module_objects 
        -mv pike pike.old 
        purecov purify -free-queue-length=500 -inuse-at-exit=yes -chain-length=12 gcc $(LDFLAGS) $(OBJ) `cat modules/linker_options` $(LIBS) -o pike 
 
# quantify 
quant: $(OBJ) module_objects 
        -mv pike pike.old 
        quantify gcc $(LDFLAGS) $(OBJ) `cat modules/linker_options` $(LIBS) -o pike 
 
# install 
install: 
        if [ ! -d "$(prefix)" ]; then mkdir "$(prefix)" ; chmod 755 "$(prefix)" ; else : ; fi 
        if [ ! -d "$(exec_prefix)" ]; then mkdir "$(exec_prefix)" ; chmod 755 "$(exec_prefix)" ; else : ; fi 
        $(INSTALL) ./pike $(exec_prefix) 
        $(INSTALL) $(SRCDIR)/../bin/hilfe $(exec_prefix) 
        if [ ! -d "$(prefix)/lib" ]; then mkdir "$(prefix)/lib" ; chmod 755 "$(prefix)/lib" ; else : ; fi 
        if [ ! -d "$(lib_prefix)" ]; then mkdir "$(lib_prefix)" ; chmod 755 "$(lib_prefix)" ; else : ; fi 
        if [ ! -d "$(prefix)/include" ]; then mkdir "$(prefix)/include"; chmod 755 "$(prefix)/include"; fi 
        if [ ! -d "$(prefix)/include/pike" ]; then mkdir "$(prefix)/include/pike"; chmod 755 "$(prefix)/include/pike"; fi 
        $(INSTALL) $(SRCDIR)/*.h *.h $(prefix)/include/pike 
        cp -r $(TMP_LIBDIR) $(lib_prefix) 
 
# tidy up a bit 
tidy: 
        -rm -f *.o core y.output y.tab.c y.tab.h 
        -rm -f $(TMP_BINDIR)/core *.o *.i *.i~ testsuite 
 
# make clean 
clean: tidy 
        -( cd modules; ${MAKE} $(MAKE_FLAGS) clean ) 
        -rm -f TAGS tags 
        -rm -f yacc.acts yacc.debug yacc.tmp *.debug.log a.out 
 
# make _really_ clean 
spotless: clean 
        rm -f Makefile machine.h 
        find . -type f '(' -name '*~' -o -name '.*~' -o -name core -o -name '.nfs*' -name '#*#' ')' -print | xargs rm -f 
        -rm -f lexical.c mon.out *.ln config.status 
        -rm -f $(TMP_BINDIR)/driver $(TMP_BINDIR)/*~ $(TMP_BINDIR)/#*# 
        -rm -f .pure driver* l.outa* 
        -rm -f modules/*/testsuite 
 
# create tags 
tags: 
        ctags *.c 
 
TAGS: 
        etags -t *.h *.c 
 
# verify / debug 
verify_modules: 
        ( cd modules ; $(MAKE) $(MAKE_FLAGS) verify ) 
 
verbose_verify_modules: 
        ( cd modules ; $(MAKE) $(MAKE_FLAGS) verbose_verify ) 
 
verify: testsuite verify_modules 
        $(RUNPIKE) $(TMP_BINDIR)/test_pike.pike testsuite 
 
check: verify 
 
# verify / debug verbose 
verbose_verify: testsuite verbose_verify_modules 
        $(RUNPIKE) $(TMP_BINDIR)/test_pike.pike testsuite --verbose 
 
# verify & debug VERBOSE 
gdb_verify: testsuite 
        @echo >.gdbinit handle SIGUSR1 nostop noprint pass 
        @echo >>.gdbinit run -Mmodules -DNOT_INSTALLED -m $(TMP_LIBDIR)/master.pike $(PIKEOPTS) $(TMP_BINDIR)/test_pike.pike testsuite -v -v -f 
        gdb ./pike 
        @rm .gdbinit 
 
# run hilfe, for interactive testing 
run_hilfe: 
        $(RUNPIKE) $(TMP_BINDIR)/hilfe 
 
lib: $(LIBDIR_SRC) $(LIBDIR_SRC)/master.pike 
        cp -r $(LIBDIR_SRC) . 
 
# make export archive (requires compiled Pike) 
# Do not compile in source tree if you want to use this! 
# Beware that export archive this includes bison/yacc/byacc source 
# and thus has to follow the rules stated in that code. 
export: new_peep_engine $(SRCDIR)/language.c $(SRCDIR)/language.h depend 
        chmod +x $(SRCDIR)/install-sh 
        $(RUNPIKE) $(TMP_BINDIR)/export.pike image pipe spider ssleay 
 
full_export: new_peep_engine $(SRCDIR)/language.c $(SRCDIR)/language.h depend 
        chmod +x $(SRCDIR)/install-sh 
        $(RUNPIKE) $(TMP_BINDIR)/export.pike 
 
new_peep_engine: 
        $(RUNPIKE) $(TMP_BINDIR)/mkpeep.pike $(SRCDIR)/peep.in >$(SRCDIR)/peep_engine.c 
 
$(SRCDIR)/peep_engine.c: $(SRCDIR)/peep.in 
        echo "" >$(SRCDIR)/peep_engine.c 
        -$(RUNPIKE) $(TMP_BINDIR)/mkpeep.pike $(SRCDIR)/peep.in >$(SRCDIR)/peep_engine.c 
 
peep.o: $(SRCDIR)/peep_engine.c 
 
# make dependencies (requires compiled Pike) 
depend: language.c 
        gcc -MM $(PREFLAGS) $(SRCDIR)/*.c | $(TMP_BINDIR)/fixdepends.sh $(SRCDIR) 
        ( cd modules ; $(MAKE) $(MAKE_FLAGS) depend ) 
 
docs: 
        mkdir docs 
 
html_docs: docs 
        $(RUNPIKE) $(TMP_BINDIR)/htmlify_docs docs $(TMP_DOCDIR) `echo $(SRCDIR)/modules/*/doc` 
# 
# Pike internal targets 
# 
module_objects: global.h $(SRCDIR)/language.h lib 
        ( cd modules ; ${MAKE} $(MAKE_FLAGS) ) 
 
language.o: $(SRCDIR)/language.c $(SRCDIR)/object.h $(SRCDIR)/interpret.h $(SRCDIR)/program.h 
 
$(SRCDIR)/language.h: $(SRCDIR)/language.yacc 
        @echo "Expect 1 shift/reduce conflict." 
        $(YACC) $(YFLAGS) $(SRCDIR)/language.yacc 
        mv y.tab.c $(SRCDIR)/language.c 
        mv y.tab.h $(SRCDIR)/language.h 
 
$(SRCDIR)/language.c: $(SRCDIR)/language.h 
        touch $(SRCDIR)/language.c 
 
modules/modlist.h: 
        ( cd modules ; ${MAKE} $(MAKE_FLAGS) ) 
 
modules/modlist_headers.h: modules/modlist.h 
        touch modules/modlist_headers.h 
 
$(SRCDIR)/module.c: modules/modlist.h 
 
$(SRCDIR)/configure: $(SRCDIR)/configure.in 
        cd $(SRCDIR) && autoconf 
 
config.status: $(SRCDIR)/configure 
        ./config.status --recheck 
 
Makefile: $(SRCDIR)/Makefile.in $(SRCDIR)/dependencies config.status 
        CONFIG_FILES=Makefile CONFIG_HEADERS= ./config.status 
        @echo "Run make again" 
        @exit 1 
 
$(SRCDIR)/machine.h.in: $(SRCDIR)/stamp-h.in 
$(SRCDIR)/stamp-h.in: $(SRCDIR)/configure.in $(SRCDIR)/acconfig.h 
        cd $(SRCDIR) && autoheader 
        echo foo > $(SRCDIR)/stamp-h.in 
 
machine.h: stamp-h 
stamp-h: $(SRCDIR)/machine.h.in config.status 
        CONFIG_FILES= CONFIG_HEADERS=machine.h ./config.status 
 
testsuite: $(SRCDIR)/testsuite.in 
        $(TMP_BINDIR)/mktestsuite $(SRCDIR)/testsuite.in >testsuite 
 
@dependencies@