# $Source: /hpux/shared/supp//usr/src/cmd/bc/./makefile,v $
# $Revision: 72.2 $

# Common makefile for bc

SOURCE = bc.y lib.b.sh
FILES = bc.c hpux_rel.c

default: all

all : bc lib.b
	
metrics: bc.M

bc: $(FILES)
	$(CC) $(CFLAGS) $(LDFLAGS) -o bc $(FILES)

bc.M: $(FILES)
	$(METRICS) $(CFLAGS) -o bc.M $(FILES)

# 	The y.tab.c file created by yacc is copied to bc.c to indicate the
#	source of the .c file (it came from the yacc source) and so that
#	the internal rules of make can compile the .c

$(FILES):
	$(YACC) bc.y && mv y.tab.c bc.x
	cp bc.x bc.c

lib.b:
	cp lib.b.sh lib.b

clean:
	rm -f a.out core *.s *.o
	rm -f bc.c bc.x lib.b

clobber: clean
	rm -f bc bc.c lib.b bc.x bc.M
