3 # A makefile for bc. This is part of the bc/sbc distribution.
6 ###############################################################################
8 # Include standard packaging commands.
11 include $(BASEDIR
)/Make.defs
37 ###############################################################################
39 # Make sure these have the correct directories for your machine.
41 # LIBDIR and BINDIR are where bc and libmath.b will be put.
44 LIBDIR
= $(PREFIX
)/lib
45 BINDIR
= $(PREFIX
)/bin
47 # Programs definitions for use by make.
58 CFLAGS
= -ansi
-0 -O
-D_POSIX_SOURCE
61 OFILES
= scan.o util.o main.o number.o storage.o load.o execute.o
63 SUBDIRS
= Examples Test
67 bc
: $& config.h bc.o
$(OFILES
) global.o
68 $(CC
) -o bc
$(LDFLAGS
) bc.o
$(OFILES
) global.o
70 sbc
: sbc.o
$(OFILES
) global.o
71 $(CC
) -o sbc
$(LDFLAGS
) sbc.o
$(OFILES
) global.o
74 $(MAKE
) -$(MAKEFLAGS
) fbc
75 elksemu .
/fbc
-c libmath.b
</dev
/null
>math.h
81 $(CC
) -c
$(CFLAGS
) global.c
82 $(CC
) -o fbc
$(LDFLAGS
) bc.o
$(OFILES
) global.o
84 install: $(BINDIR
)/bc
$(LIBDIR
)/libmath.b
87 install -cs
-o bin
$?
$@
89 $(LIBDIR
)/libmath.b
: libmath.b
90 install -c
-o bin
$?
$@
93 cp
-p bc
$(TARGET_MNT
)/bin
94 cp
-p fbc
$(TARGET_MNT
)/bin
103 rm -f
*.o
*.bak core math.h bc fbc sbc bc.c sbc.c scan.c y.tab.h
110 @echo
"expect 1 shift/reduce conflict"
118 global.o
: bcdefs.h global.h math.h
119 bc.o
: bcdefs.h global.h
120 execute.o
: bcdefs.h global.h
121 load.o
: bcdefs.h global.h
122 main.o
: bcdefs.h global.h version.h
124 sbc.o
: bcdefs.h global.h
125 scan.o
: y.tab.h bcdefs.h global.h
126 storage.o
: bcdefs.h global.h
127 util.o
: bcdefs.h global.h version.h
129 bcdefs.h
: number.h const.h config.h