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
  
285
  
286
  
287
  
288
  
289
  
290
  
291
  
292
  
293
  
294
  
295
  
296
  
297
  
298
  
299
  
300
  
301
  
302
  
303
  
304
  
305
  
306
  
307
  
308
  
309
  
310
  
311
  
312
  
313
  
314
  
315
  
316
  
317
  
318
  
319
  
320
  
321
  
322
  
323
  
324
  
325
  
326
  
327
  
328
  
329
  
330
  
331
  
# 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) 
 
# This is normall the install program in the source directory 
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 
 
# 
# OS dependant flags 
# 
OSFLAGS= 
 
# 
#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@ @CPPFLAGS@ $(OSFLAGS) $(OPTIMIZE) $(WARN) $(PROFIL) 
NOOPTFLAGS=@CFLAGS@ @CPPFLAGS@ $(OSFLAGS) $(WARN) $(PROFIL) 
CFLAGS=$(PREFLAGS) $(OTHERFLAGS) 
 
CC=@CC@ 
CPP=@CPP@ 
 
AR=@AR@ 
 
LD=$(CC) 
LDFLAGS=$(CFLAGS) @LDFLAGS@ @LINKFORSHARED@ 
 
RUNPIKE=$(TMP_BUILDDIR)/pike -m $(TMP_LIBDIR)/master.pike $(PIKEOPTS) 
 
MOST_MAKE_FLAGS = "prefix=$(prefix)" "exec_prefix=$(exec_prefix)" "CC=$(CC)" "TMP_BINDIR=$(TMP_BINDIR)" "DEFINES=$(DEFINES)" "TMP_LIBDIR=$(TMP_LIBDIR)" "RUNPIKE=$(RUNPIKE)" "INSTALL=$(INSTALL)" "NOOPTFLAGS=$(NOOPTFLAGS)" "AR=$(AR)" 
MAKE_FLAGS = $(MOST_MAKE_FLAGS) "OTHERFLAGS=$(OTHERFLAGS)"  
 
# 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 \ 
 cyclic.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 \ 
 las.o \ 
 lex.o \ 
 multiset.o \ 
 signal_handler.o \ 
 pike_types.o \ 
 main.o \ 
 mapping.o \ 
 pike_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) compile_interpret modules/linker_options 
        -@mv pike pike.old 2>/dev/null || true 
        $(LD) $(LDFLAGS) $(OBJ) interpret.o `cat modules/linker_options` $(LIBS) -o pike 
 
# purify 
pure: $(OBJ) compile_interpret module_objects 
        -@mv pike pike.old 2>/dev/null || true 
        purify -free-queue-length=500 -inuse-at-exit=yes -chain-length=12 gcc $(LDFLAGS) $(OBJ) interpret.o `cat modules/linker_options` $(LIBS) -o pike 
 
# purecov 
cover: $(OBJ) compile_interpret module_objects 
        -@mv pike pike.old 2>/dev/null || true 
        purecov purify -free-queue-length=500 -inuse-at-exit=yes -chain-length=12 gcc $(LDFLAGS) $(OBJ) interpret.o `cat modules/linker_options` $(LIBS) -o pike 
 
# quantify 
quant: $(OBJ) compile_interpret module_objects 
        -@mv pike pike.old 2>/dev/null || true 
        quantify gcc $(LDFLAGS) $(OBJ) interpret.o `cat modules/linker_options` $(LIBS) -o pike 
 
# Several optimizers have problems with interpret.c 
# First try compiling with optimization and if that doesn't work, without. 
compile_interpret : force 
        $(MAKE) $(MAKE_FLAGS) interpret.o || NO_ULIMIT=yes $(MAKE) $(MOST_MAKE_FLAGS) "OTHERFLAGS=$(NOOPTFLAGS)" interpret.o 
 
force : 
 
# install 
install: 
        @echo 
        @echo Installing Pike... 
        @echo 
        @for d in "$(prefix)" "$(exec_prefix)" "$(prefix)/lib" "$(lib_prefix)" "$(prefix)/include" "$(prefix)/include/pike"; do if [ \! -d "$$d/." ]; then echo "$$d"; mkdir "$$d"; chmod 755 "$$d"; else : ; fi; done 
        @for d in `cd "$(TMP_LIBDIR)"; find . -type d -print`; do if [ \! -d "$(lib_prefix)/$$d/." ]; then echo "$(lib_prefix)/$$d"; mkdir "$(lib_prefix)/$$d"; chmod 755 "$(lib_prefix)/$$d/."; else : ; fi; done 
        @if [ -f "$(exec_prefix)/pike" ]; then \ 
          echo Renaming old "$(exec_prefix)/pike" to "$(exec_prefix)/pike.old"; \ 
          mv -f "$(exec_prefix)/pike" "$(exec_prefix)/pike.old"; \ 
        fi 
        @echo "$(exec_prefix)/pike"; $(INSTALL) ./pike $(exec_prefix) 
        @if [ -f $(SRCDIR)/../bin/hilfe ]; then \ 
          echo "$(exec_prefix)/hilfe"; \ 
          if [ "$(exec_prefix)" != "/usr/local/bin" -a \ 
               "$(exec_prefix)" != "/usr/local/bin/" ]; then \ 
            if [ -f $(exec_prefix)/hilfe ]; then \ 
              mv $(exec_prefix)/hilfe $(exec_prefix)/hilfe.old; \ 
            else : ; fi && \ 
            sed -e 's!/usr/local/bin!$(exec_prefix)!' <$(SRCDIR)/../bin/hilfe \ 
              >$(exec_prefix)/hilfe && \ 
            chmod 755 $(exec_prefix)/hilfe; \ 
          else $(INSTALL) $(SRCDIR)/../bin/hilfe $(exec_prefix); fi; \ 
        else : ; fi 
        @for a in $(SRCDIR)/*.h *.h ; do $(INSTALL) $$a $(prefix)/include/pike ; done 
        @for f in `cd "$(TMP_LIBDIR)"; find . -type f -print`; do echo "$(lib_prefix)/$$f"; if [ -f "$(lib_prefix)/$$f" ]; then mv -f "$(lib_prefix)/$$f" "$(lib_prefix)/$$f.old"; else : ; fi; cp "$(TMP_LIBDIR)/$$f" "$(lib_prefix)/$$f"; done 
 
# 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)/*~ $(TMP_BINDIR)/#*# 
        -rm -f pike pike.old l.outa* 
        -rm -f modules/*/testsuite 
        -rm -rf lib 
 
# 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 
 
sure: 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 SIGFPE nostop noprint pass 
        @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 
 
feature_list: 
        $(RUNPIKE) $(TMP_BINDIR)/feature_list 
 
lib: $(LIBDIR_SRC) $(LIBDIR_SRC)/master.pike $(LIBDIR_SRC)/modules $(LIBDIR_SRC)/include 
        cp -r $(LIBDIR_SRC) . 
        -touch ./lib 
 
# 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 Odbc Oracle _Crypto Crypto 
 
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 
depend: $(SRCDIR)/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: machine.h global.h modules/static_module_makefile modules/dynamic_module_makefile $(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 
 
# Internal testing target 
run_yacc: $(SRCDIR)/language.c 
 
modules/modlist.h: 
        ( cd modules ; ${MAKE} $(MAKE_FLAGS) ) 
 
modules/modlist_headers.h: modules/modlist.h 
        touch modules/modlist_headers.h 
 
module.o:  modules/modlist_headers.h modules/modlist.h 
 
$(SRCDIR)/configure: $(SRCDIR)/configure.in 
        cd $(SRCDIR) && autoconf 
 
config.status: $(SRCDIR)/configure 
        ./config.status --recheck 
 
modules/static_module_makefile: $(SRCDIR)/modules/static_module_makefile.in config.status 
        CONFIG_FILES=modules/static_module_makefile CONFIG_HEADERS="" ./config.status 
 
modules/dynamic_module_makefile: $(SRCDIR)/@dmmsrc@ config.status 
        CONFIG_FILES=modules/dynamic_module_makefile:@dmmsrc@ CONFIG_HEADERS="" ./config.status 
 
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@