LDFLAGS=-n
TESTDIR = .
OL =
BIN = $(OL)/bin
INSB = /etc/install -f $(BIN)
# CFLAGS= -DM68000 -DNICE  -DNICEVAL=4
CFLAGS= -DNICE -DNICEVAL=4 
SRCDIR = /usr/src/cmd

OFILES1 = args.o \
	blok.o \
	defs.o \
	error.o \
	expand.o \
	fault.o \
	name.o \
	print.o \
	service.o \
	setbrk.o \
	stak.o \
	string.o \
	hash.o \
	hashserv.o

OFILES = cmd.o \
	ctype.o \
	io.o \
	macro.o \
	main.o \
	msg.o \
	word.o \
	xec.o \
	func.o \
	$(OFILES1)

DEFS = defs.h \
	brkincr.h \
	ctype.h \
	mac.h \
	mode.h \
	name.h \
	stak.h \
	hash.h

compile all: sh

sh: $(OFILES)
	$(CC) $(LDFLAGS) $(OFILES) -o sh

$(OFILES1): $(DEFS)
cmd.o macro.o word.o: $(DEFS) sym.h
io.o: $(DEFS) dup.h
main.o: $(DEFS) sym.h timeout.h dup.h
msg.o:	sym.h
xec.o:	sym.h
install:  all
	mv $(BIN)/sh $(BIN)/o.sh; \
	$(INSB) $(TESTDIR)/sh
	rm -f $(BIN)/rsh
	ln $(BIN)/sh $(BIN)/rsh
	sync


clean:
	rm -f $(OFILES)

clobber: clean
	rm -f $(TESTDIR)/sh
