Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
executable file
·89 lines (73 loc) · 1.7 KB
/
Copy pathMakefile
File metadata and controls
executable file
·89 lines (73 loc) · 1.7 KB
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
9AEB
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
# Makefile for bc
# A makefile for bc. This is part of the bc/sbc distribution.
#
#
# Make sure these have the correct directories for your machine.
#
# LIBDIR and BINDIR are where bc and libmath.b will be put.
#
PREFIX = /usr
LIBDIR = $(PREFIX)/lib
BINDIR = $(PREFIX)/bin
#
# Programs definitions for use by make.
#
SHELL = /bin/sh
YACC = yacc
#YACC = bison -y
LEX = flex -I8
#LEX = lex
CC = exec cc
CFLAGS = -D_POSIX_SOURCE
LDFLAGS = -i
#
#
OFILES = scan.o util.o main.o number.o storage.o load.o execute.o
#
SUBDIRS = Examples Test
#
all: bc
bc: $& config.h bc.o $(OFILES) global.o
$(CC) -o bc $(LDFLAGS) bc.o $(OFILES) global.o
sbc: sbc.o $(OFILES) global.o
$(CC) -o sbc $(LDFLAGS) sbc.o $(OFILES) global.o
math.h: libmath.b
$(MAKE) -$(MAKEFLAGS) fbc
./fbc -c libmath.b </dev/null >math.h
/bin/sh ./fix_math.h
rm -f ./fbc
fbc: $(OFILES) bc.o
echo \"\" > math.h
$(CC) -c $(CFLAGS) global.c
$(CC) -o fbc $(LDFLAGS) bc.o $(OFILES) global.o
install: $(BINDIR)/bc $(LIBDIR)/libmath.b
$(BINDIR)/bc: bc
install -cs -o bin $? $@
$(LIBDIR)/libmath.b: libmath.b
install -c -o bin $? $@
clean:
rm -f *.o *.bak core math.h bc sbc
scan.c: scan.l
$(LEX) scan.l
mv lex.yy.c scan.c
scan.o: scan.c
$(CC) -c $(CFLAGS) -wa scan.c
y.tab.h bc.c: bc.y
@echo "expect 1 shift/reduce conflict"
$(YACC) -d bc.y
mv y.tab.c bc.c
sbc.c: sbc.y
$(YACC) -d sbc.y
mv y.tab.c sbc.c
global.o: bcdefs.h global.h math.h
bc.o: bcdefs.h global.h
execute.o: bcdefs.h global.h
load.o: bcdefs.h global.h
main.o: bcdefs.h global.h version.h
number.o: bcdefs.h
sbc.o: bcdefs.h global.h
scan.o: y.tab.h bcdefs.h global.h
storage.o: bcdefs.h global.h
util.o: bcdefs.h global.h version.h
bcdefs.h: number.h const.h config.h
touch bcdefs.h