-
Notifications
You must be signed in to change notification settings - Fork 20
/
Makefile.in.vpath
560 lines (449 loc) · 15.1 KB
/
Makefile.in.vpath
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
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
# Makefile $Revision: 7.16 $
#
# 1) Select the proper EXDIR (path), MANDIR, MANEXT, LIBDIR, SIGVOID,
# REGEX, DFLT_PAGER, and FMOD. Most of the other things aren't
# normally changed (see the comments with each)
# 2) Select the proper machine/compiler/OS section of code
# for MS-DOS look for the pattern 'MS-DOS'
# 3) make install
# 4) If you have the command 'file' that uses /etc/magic add the line:
# 38 string Spreadsheet sc file
RM ?= rm -f
# SRCDIR will be filled in by the configure script, either a full or relative path or .
SRCDIR=
VPATH=$(SRCDIR):
# Specify the name of the program.
# All documentation and installation keys on this value.
#
name=sc
NAME=SC
# The base directory where everything should be installed. If you're
# packaging this with an O/S, for example, you'll probably want to change
# this to /usr. Otherwise, /usr/local is probably more appropriate, unless
# you're replacing the vendor-supplied version.
prefix=/usr/local
# This is where the install step puts it.
EXDIR=${prefix}/bin
# This is where the man page goes.
MANDIR=${prefix}/share/man/man1
MANEXT=1
MANMODE=644
# This is where the library file (tutorial) goes.
#LIBDIR=/usr/local/share/$(name) # reno
LIBDIR=${prefix}/share/$(name)
LIBRARY=-DLIBDIR=\"${LIBDIR}\"
# Set SIMPLE for lex.c if you don't want arrow keys or lex.c blows up
#SIMPLE=-DSIMPLE
SIMPLE=
# Set BROKENCURSES if your curses has the nl/nonl bug
# if it does and you don't set BROKENCURSES, the display will
# be staggered across the screen. Also try IDLOKBAD below.
#BROKENCURSES=-DBROKENCURSES
BROKENCURSES=
# Set USELOCALE to enable country-dependent display of decimal points,
# local character recognition in words, and local @date() format.
#USELOCALE=
USELOCALE=-DUSELOCALE
# Set SIGVOID if signal routines are type void.
# use: SIGVOID=-DSIGVOID for:
# System 5.3, SunOS 4.X, VMS, BSD4.4 (reno), and ANSI C Compliant systems
# use: SIGVOID= for:
# BSD systems (excluding reno, BSD4.4), and the UNIXPC 'cc'
#SIGVOID=
SIGVOID=-DSIGVOID
# Set IEEE_MATH if you need setsticky() calls in your signal handlers
#
#IEEE_MATH=-DIEEE_MATH
IEEE_MATH=
# The -ffloat-store compiler option is necessary for compiling interp.c to
# prevent spurious "Still changing after x iterations" errors, intermittent
# problems with the @round function, comparisons failing when they shouldn't,
# and potentially other similar problems due to FPU registers having greater
# precision than doubles in memory. This is known to be necessary for GCC
# on x86 processors/FPUs, and probably others.
#FLOAT_STORE=-ffloat-store
# Set RINT=-DRINT if you do not have rint() in math.h
# Set RINT= on/with (they have rint):
# SunOS 4.0.3c compiler
# BSD4.4 (reno)
#RINT=-DRINT
RINT=
# If your system supports POSIX.2 regular expressions, REGEX should be
# set to -DREGCOMP. Otherwise, set REGEX to -DREGCMP if you have the
# regcmp/regex regular expression routines (most System V based systems
# do) or to -DRE_COMP if you have the re_comp/re_exec regular expression
# routines (most BSD based systems do). If your system has no support for
# regular expressions, leave REGEX unset.
#REGEX=
#REGEX=-DREGCMP
#REGEX=-DRE_COMP
REGEX=-DREGCOMP
# This is the name of a pager like "more".
# "pg" may be appropriate for SYSV.
#DFLT_PAGER=-DDFLT_PAGER=\"more\" # generic && reno
DFLT_PAGER=-DDFLT_PAGER=\"less\"
# this is the name to save back ups in
SAVE=-DSAVENAME=\"$(NAME).SAVE\"
# path to crypt, do not define if you don't have crypt
# most systems
#CRYPT=-DCRYPT_PATH=\"/bin/crypt\"
# BSD
# CRYPT=-DCRYPT_PATH=\"/usr/bin/crypt\"
# other people?
#CRYPT=-DCRYPT_PATH=\"/usr/local/bin/crypt\"
# If you get errors about fmod being undefined when you try to
# compile, then define NO_FMOD (most likely BSD4.3 and Mt Xinu).
#FMOD=-DNO_FMOD
FMOD=
# buffer size of a single field. It defines the max string length that sc can process.
# The default size is 1024.
FBUF=-DFBUFLEN=10240
#FBUF=
# If your system doesn't have notimeout() in curses define NONOTIMEOUT
NO_NOTIMEOUT=-DNONOTIMEOUT
#NO_NOTIMEOUT=
# flags for lint
LINTFLAGS=-abchxv
# Format of quick reference guide generated by $(name)qref
# Leave undefined for normal text output.
#QREF_FMT=
QREF_FMT=-DTROFF
# *** SPECIAL NOTES ***
# For ULTRIX: define the BSD4.2 section and SIGVOID above
# [email protected] tested on Ultrix 3.1C-0
# HP-UX 7.0: Do NOT use -O
# (known broken, try sc's boolean operators if you wish)
#
# **** SYSV curses bugs... ****
# Try setting IDLOKBAD to fix (with an empty spreadsheet):
# a) Redrawing the bottom half of the screen when you
# move between row 9 <-> 10
# b) the highlighted row labels being trash when you
# move between row 9 <-> 10
# c) On an xterm on Esix Rev. D+ from eating lines
# -goto (or move) a few lines (or more) past the bottom
# of the screen, goto (or move) to the top line on the
# screen, move upward and the current line is deleted, the
# others move up even when they should not, check by
# noticing the rows become 2, 3, 40, 41, 42... (etc).
# Known systems/terminfos w/ curses problems:
# {Esix Rev. D+, AT&T SysV3.2.1}:at386-m,xterm, HP-UX7.0:(not sure)
#IDLOKISBAD=-DIDLOKBAD
IDLOKISBAD=
# If you don't have idlok() in your curses define NOIDLOK
#NO_IDLOK=-DNOIDLOK
NO_IDLOK=
# If moving right off the screen causes the screen to not redraw
# properly, define RIGHT_CBUG to get around a curses problem on some
# boxes, this forces screen redraws when going right off the screen
#RIGHTBUG=-DRIGHT_CBUG
RIGHTBUG=
# IF you have problems w/ your yacc try bison, Berkeley yacc, or
# some other yacc. Some systems don't allow you to
# increase the number of terminals (mostly AT&T), SCO's does though.
# YACC=yacc
# NOTE: Do not use with bison 1.16! Get a new version....
#YACC=bison -y
# MS-DOS needs y_tab instead of the normal y.tab
#YTAB=y_tab
YTAB=y.tab
# Command to use to make temporary copies of some source files.
LN=ln -s
#LN=cp
#LN=ln
#### SYSTEM DEFINES ####
#########################################
# Use this for system AIX V3.1
#CFLAGS= -O -DSYSV2 -DCHTYPE=int -DNLS
#LDFLAGS=
#LDADD=-lm -lPW -lcurses
#########################################
# Use this for system V.2 (includes: HP-UX 7.05, UNIXPC)
#CFLAGS= -O -DSYSV2
#LDFLAGS=
#LDADD=-lm -lPW -lcurses
# with gcc on a Sequent also use:
#CC=att gcc
#CFLAGS= -DSYSV2 -g -pipe -traditional
#########################################
# Use this for system V.3
#CFLAGS= -DSYSV3 -O
#LDFLAGS= -s
#CFLAGS= -DSYSV3 -g
#LDFLAGS= -g
#LDADD=-lm -lncurses -lfl
# with gcc also use:
#CC=gcc
#CFLAGS= -DSYSV3 -O -pipe
# debugging bison (bison 1.16 is broken)
#CFLAGS= -DSYSV3 -g -pipe -traditional
#YACC=bison -y -v -t -l
#########################################
# Use this for system V.4
#CFLAGS= -DSYSV4 -DSYSV3 -O
#LDFLAGS= -s
#LDADD=-lm -lcurses -lgen
# with gcc also use:
#CC=gcc
#CFLAGS= -DSYSV3 -O -pipe
#########################################
# Microport
#CFLAGS= -DSYSV2 -O -DUPORT -Ml
#LDFLAGS=-Ml
#LDADD=-lm -lcurses -lPW
#########################################
# Use this for BSD 4.2
#CFLAGS= -O -DBSD42
#LDFLAGS=
#LDADD=-lm -lcurses -ltermcap
# with gcc also use:
#CC=gcc
#########################################
# Use this for Sequent boxes
#CC=atscc
#CFLAGS=-O -DBSD42
#LDFLAGS=
#LDADD=-lm -lcurses -ltermcap
#PSCLIB=-lseq
# with gcc also use:
#CC=gcc
#CFLAGS= -O -DBSD42 -pipe
#########################################
# Use this for BSD 4.3
#CFLAGS= -O -DBSD43 #-O or -g
#LDFLAGS= # -lg might help if -g used in CFLAGS
#LDADD=-lm -lcurses -ltermcap
#########################################
# Use this for SunOS 4.X if you have the System V package installed.
# This will link with the System V curses which is preferable to the
# BSD curses (especially helps scrolling on slow (9600bps or less)
# serial lines).
#
# Be sure to define SIGVOID and REGEX (to -DRE_COMP) above.
#
#CC=/usr/5bin/cc
#CFLAGS= -O -DSYSV3
#LDFLAGS=
#LDADD=-lm -lcurses
#########################################
# Use this for system III (XENIX)
#CFLAGS= -O -DSYSIII
#LDFLAGS= -i
#LDADD=-lm -lcurses -ltermcap
#########################################
# Use this for XENIX Version 2.3
#CFLAGS= -O -DSYSIII -DXENIX2_3
#LDFLAGS= -i
#LDADD=-lm -lcurses -ltermcap
#########################################
# Use this for VENIX
#CFLAGS= -DVENIX -DBSD42 -DV7
#LDFLAGS= -z -i
#LDADD=-lm -lcurses -ltermcap
#########################################
# For SCO Unix V rel. 3.2.0
# -compile using rcc, cc does not cope with gram.c
# -edit /usr/include/curses.h, rcc does not understand #error
# -link: make CC=cc, rcc's loader gets unresolved __cclass, __range
# (rather strange,?)
#CC=rcc
#CC=cc
#CC=gcc -fstrength-reduce
#SIGVOID=-DSIGVOID
#CFLAGS= -O -DSYSV3
#LDFLAGS=
#LDADD=-lm -lcurses -ltinfo -lPW
#YACC=yacc -Sm10000
#########################################
# Use this for SCO Unix 3.2.2 and ODT 1.1
#CC=cc
#CFLAGS= -O -DSYSV3
#LDFLAGS=
#LDADD=-lm -lcurses -lPW -lmalloc -lc_s
#YACC=yacc -Sm10000
#########################################
# Use this for MS-DOS, Microsoft C 5.1 and NDMAKE
#CC=cl
#CFLAGS= -AL -O -Fo$*.o
#LDFLAGS=/noi /st:0x4000
#LDADD=lcurses
#YACC=bison -y
#
#.SUFFIXES : .o .c
#.c.o:
# $(CC) $(CFLAGS) -c $*.c
#########################################
# Use this for MS-DOS with DJGPP
# REGEX should also be undefined (see above) unless a separate REGEX library
# is installed (gdb includes one, but may result in file conflicts with
# existing DJGPP files).
#CC=gcc
# Only use -Wall for testing, since it produces warnings that are of no
# real effect on the reliability of the program, but may concern some
# people who don't understand them.
#CFLAGS=-DSYSV3 -O2 -Wall -UMSDOS
#CFLAGS=-DSYSV3 -O2 -UMSDOS
#LDADD=-lm -lpdcurses
#########################################
CPPFLAGS += -I$(SRCDIR) -I.
_CFLAGS= $(CPPFLAGS) $(CFLAGS) $(INCDIR_CURSES) $(DEFINES) $(FBUF) $(__CDBG) $(__CLDBG) \
#-DTRACE='"/tmp/trace.txt"'
_LDFLAGS=$(LDFLAGS) $(__CLDBG) -s
LDADD=-lm $(LIBDIR_CURSES) $(LIB_CURSES)
# All of the source files
SRC=Makefile abbrev.c cmds.c color.c crypt.c eres.sed frame.c format.c gram.y \
help.c interp.c lex.c pipe.c psc.c range.c sc.c sc.h screen.c sort.c \
sres.sed version.c vi.c vmtbl.c xmalloc.c
# The objects
OBJS=abbrev.o cmds.o color.o crypt.o format.o frame.o gram.o help.o interp.o \
lex.o pipe.o range.o sc.o screen.o sort.o version.o vi.o vmtbl.o \
xmalloc.o compat.o
# The documents in the Archive
DOCS=CHANGES README sc.doc psc.doc tutorial.sc VMS_NOTES torev build.com
all: $(name) p$(name) $(name)qref $(name).1 p$(name).1 $(name)qref.1 \
x$(name) x$(name).1
$(name):$(PAR) $(OBJS)
$(CC) $(_CFLAGS) ${_LDFLAGS} ${OBJS} $(RPATH_CURSES) -o $(name) \
${LDADD}
# Alternative link for MS-DOS
#$(name): $(OBJS)
# link ${_LDFLAGS} ${OBJS},$(name),,${LDADD};
gram.c: gram.y
$(YACC) -d $<
mv $(YTAB).c gram.c
$(YTAB).h: gram.y
p$(name): psc.c pvmtbl.o pxmalloc.o version.o
$(CC) $(_CFLAGS) ${_LDFLAGS} -o p$(name) $< \
pvmtbl.o pxmalloc.o version.o ${PSCLIB}
# Alternative link for MS-DOS (NB: MSC 5.1 has no getopt.c)
#p$(name): psc.o pvmtbl.o pxmalloc.o getopt.o
# link ${_LDFLAGS} psc.o pvmtbl.o pxmalloc.o getopt.o,p$(name);
qhelp.c: help.c
-$(RM) qhelp.c
${LN} $< qhelp.c
$(name)qref: qhelp.c sc.h
$(CC) $(_CFLAGS) $(_LDFLAGS) -DQREF $(QREF_FMT) \
-DSCNAME=\"$(NAME)\" -o $(name)qref $<
# Alternative link for MS-DOS
#$(name)qref: qhelp.c sc.h
# $(CC) -AL -O -Foqhelp.o -c -DQREF -DSCNAME=\"$(name)\" qhelp.c
# link ${_LDFLAGS} qhelp.o,$(name)qref;
pvmtbl.c: vmtbl.c
-$(RM) pvmtbl.c
${LN} $< pvmtbl.c
pvmtbl.o: pvmtbl.c sc.h
$(CC) $(_CFLAGS) -c -DPSC $<
pxmalloc.c: xmalloc.c
-$(RM) pxmalloc.c
${LN} $< pxmalloc.c
# Objects
abbrev.o: abbrev.c sc.h
$(CC) $(_CFLAGS) ${DFLT_PAGER} -c $<
cmds.o: cmds.c sc.h
$(CC) $(_CFLAGS) ${CRYPT} -c $<
color.o: color.c sc.h
crypt.o: crypt.c sc.h
$(CC) $(_CFLAGS) ${CRYPT} -c $<
format.o: format.c
frame.o: frame.c sc.h
gram.o: gram.y sc.h $(YTAB).h gram.c sres.sed eres.sed
sed < $< > experres.h -f $(filter %eres.sed, $^)
sed < $< > statres.h -f $(filter %sres.sed, $^)
$(CC) $(_CFLAGS) ${USELOCALE} -c $(filter %.c,$^)
help.o: help.c sc.h
$(CC) $(_CFLAGS) ${CRYPT} -c $<
interp.o: interp.c sc.h
$(CC) $(_CFLAGS) ${FLOAT_STORE} ${IEEE_MATH} \
${SIGVOID} ${RINT} ${REGEX} ${FMOD} -c $<
lex.o: sc.h $(YTAB).h gram.o lex.c
$(CC) $(_CFLAGS) ${SIMPLE} ${IEEE_MATH} \
${LIBRARY} ${SIGVOID} ${NO_NOTIMEOUT} -c $(filter %.c,$^)
pipe.o: pipe.c sc.h
pxmalloc.o: pxmalloc.c sc.h
$(CC) $(_CFLAGS) -c -DPSC $<
qhelp.o: qhelp.c sc.h
$(CC) $(_CFLAGS) ${CRYPT} -c $<
range.o: range.c sc.h
sc.o: sc.c sc.h
$(CC) $(_CFLAGS) ${DFLT_PAGER} ${SIGVOID} \
${SAVE} -c $<
screen.o: screen.c sc.h
$(CC) $(_CFLAGS) ${BROKENCURSES} ${IDLOKISBAD} \
${RIGHTBUG} ${SIGVOID} ${NO_IDLOK} -c $<
sort.o: sort.c sc.h
vi.o: vi.c sc.h
$(CC) $(_CFLAGS) ${REGEX} ${HISTORY_FILE} -c $<
# other stuff
clean:
$(RM) *.o *res.h $(YTAB).h debug core gram.c y.output pxmalloc.c \
pvmtbl.c qhelp.c tags
clobber: clean
$(RM) $(name) p$(name) $(name)qref $(name).1 p$(name).1 $(name)qref.1 \
x$(name) x$(name).1
distclean: clean
$(RM) $(name) p$(name) $(name)qref x$(name) Makefile config.log \
$(name).1 p$(name).1 $(name)qref.1 x$(name).1 compat.h
shar: ${SRC} ${DOCS}
shar -c -m 64000 -f shar ${DOCS} ${SRC}
sshar: ${SRC}
shar -c -m 1000000 -f shar ${SRC}
lint: sc.h sc.c lex.c gram.c interp.c cmds.c color.c crypt.c frame.c pipe.c \
range.c help.c vi.c version.c xmalloc.c format.c vmtbl.c
lint ${LINTFLAGS} $(_CFLAGS) ${SIMPLE} \
$(filter %.c,$^) \
$(LDADD)
make lintqref
lintqref: help.c
lint ${LINTFLAGS} $(_CFLAGS) ${SIMPLE} -DQREF \
help.c
lintpsc: psc.c vmtbl.c
lint ${LINTFLAGS} $(_CFLAGS) ${SIMPLE} -DPSC \
psc.c vmtbl.c
.SUFFIXES: .doc .1
.c.o:
$(CC) $(_CFLAGS) -c $<
.doc.1:
name=$(name) NAME=$(NAME) LIBDIR=$(LIBDIR) SRCDIR=$(SRCDIR) sh $(SRCDIR)/torev $< > $@
install: $(EXDIR)/$(name) $(EXDIR)/$(name)qref $(EXDIR)/p$(name) \
$(LIBDIR)/tutorial.$(name) $(MANDIR)/$(name).$(MANEXT) \
$(MANDIR)/p$(name).$(MANEXT) $(MANDIR)/$(name)qref.$(MANEXT) \
$(EXDIR)/x$(name) $(MANDIR)/x$(name).$(MANEXT)
$(EXDIR)/$(name): $(name) $(EXDIR)
install $(name) $(EXDIR)/
$(EXDIR)/$(name)qref: $(name)qref $(EXDIR)
install $(name)qref $(EXDIR)/
$(EXDIR)/p$(name): p$(name) $(EXDIR)
install p$(name) $(EXDIR)/
$(EXDIR)/x$(name): p$(name) $(EXDIR)
install x$(name) $(EXDIR)/
x$(name): xsc.sh
name=$(name) SRCDIR=$(SRCDIR) sh $(SRCDIR)/torev < $< > x$(name)
$(LIBDIR)/tutorial.$(name): tutorial.sc $(LIBDIR) $(LIBDIR)/plugins
install -m $(MANMODE) tutorial.sc $(LIBDIR)/tutorial.$(name)
$(EXDIR):
mkdir -p $(EXDIR)
$(LIBDIR):
mkdir -p $(LIBDIR)
$(LIBDIR)/plugins:
mkdir -p $(LIBDIR)/plugins
$(MANDIR):
mkdir -p $(MANDIR)
$(MANDIR)/$(name).$(MANEXT): $(MANDIR) $(name).1
install -m $(MANMODE) $(name).1 $@
$(MANDIR)/p$(name).$(MANEXT): $(MANDIR) p$(name).1
install -m $(MANMODE) p$(name).1 $@
$(MANDIR)/x$(name).$(MANEXT): $(MANDIR) x$(name).1
install -m $(MANMODE) x$(name).1 $@
$(MANDIR)/$(name)qref.$(MANEXT): $(MANDIR) $(name)qref.1
install -m $(MANMODE) $(name)qref.1 $@
uninstall:
$(RM) $(EXDIR)/$(name)
$(RM) $(EXDIR)/$(name)qref
$(RM) $(EXDIR)/p$(name)
$(RM) $(EXDIR)/x$(name)
$(RM) -r $(LIBDIR)
$(RM) $(MANDIR)/$(name).$(MANEXT)
$(RM) $(MANDIR)/p$(name).$(MANEXT)
$(RM) $(MANDIR)/$(name)qref.$(MANEXT)
files:
@find $(DOCS) $(SRC) -print