source: trunk/minix/commands/bc/Makefile@ 9

Last change on this file since 9 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 1.7 KB
RevLine 
[9]1# Makefile for bc
2
3# A makefile for bc. This is part of the bc/sbc distribution.
4#
5#
6# Make sure these have the correct directories for your machine.
7#
8# LIBDIR and BINDIR are where bc and libmath.b will be put.
9#
10PREFIX = /usr
11LIBDIR = $(PREFIX)/lib
12BINDIR = $(PREFIX)/bin
13#
14# Programs definitions for use by make.
15#
16SHELL = /bin/sh
17YACC = yacc
18#YACC = bison -y
19LEX = flex -I8
20#LEX = lex
21CC = exec cc
22CFLAGS = -D_POSIX_SOURCE
23LDFLAGS = -i
24#
25#
26OFILES = scan.o util.o main.o number.o storage.o load.o execute.o
27#
28SUBDIRS = Examples Test
29#
30
31
32all: bc
33bc: $& config.h bc.o $(OFILES) global.o
34 $(CC) -o bc $(LDFLAGS) bc.o $(OFILES) global.o
35
36sbc: sbc.o $(OFILES) global.o
37 $(CC) -o sbc $(LDFLAGS) sbc.o $(OFILES) global.o
38
39math.h: libmath.b
40 $(MAKE) -$(MAKEFLAGS) fbc
41 ./fbc -c libmath.b </dev/null >math.h
42 /bin/sh ./fix_math.h
43 rm -f ./fbc
44
45fbc: $(OFILES) bc.o
46 echo \"\" > math.h
47 $(CC) -c $(CFLAGS) global.c
48 $(CC) -o fbc $(LDFLAGS) bc.o $(OFILES) global.o
49
50install: $(BINDIR)/bc $(LIBDIR)/libmath.b
51
52$(BINDIR)/bc: bc
53 install -cs -o bin $? $@
54
55$(LIBDIR)/libmath.b: libmath.b
56 install -c -o bin $? $@
57
58clean:
59 rm -f *.o *.bak core math.h bc sbc
60
61scan.c: scan.l
62 $(LEX) scan.l
63 mv lex.yy.c scan.c
64
65scan.o: scan.c
66 $(CC) -c $(CFLAGS) -wa scan.c
67
68y.tab.h bc.c: bc.y
69 @echo "expect 1 shift/reduce conflict"
70 $(YACC) -d bc.y
71 mv y.tab.c bc.c
72
73sbc.c: sbc.y
74 $(YACC) -d sbc.y
75 mv y.tab.c sbc.c
76
77global.o: bcdefs.h global.h math.h
78bc.o: bcdefs.h global.h
79execute.o: bcdefs.h global.h
80load.o: bcdefs.h global.h
81main.o: bcdefs.h global.h version.h
82number.o: bcdefs.h
83sbc.o: bcdefs.h global.h
84scan.o: y.tab.h bcdefs.h global.h
85storage.o: bcdefs.h global.h
86util.o: bcdefs.h global.h version.h
87
88bcdefs.h: number.h const.h config.h
89 touch bcdefs.h
Note: See TracBrowser for help on using the repository browser.