CFLAGS = -O

.SUFFIXES: .L

LOUT = conf.L iotab.L

OBJ = conf.o iotab.o 

.c.c:
	get $?
.s.s:
	get $?
.c.L:
	@/lib/cpp -Dlint $< | /usr/lib/lint/lint1 -dhn-L$< > $@
.s.L:
	@/lib/cpp -Dlint $< | /usr/lib/lint/lint1 -dhn-L$< > $@
.c.o:
	cc -c $(CFLAGS) $<
.s.o:
	cc -c $<

unix:   $(OBJ) ../sys/a.out ../dev/a.out
	@-echo Linking.
	@-ld -o unix -x $(OBJ) ../dev/a.out ../sys/a.out longops.o ldiv.o
	@size unix
	@nm -n unix>map
omak:   omakzero.o $(OBJ) ../sys/a.out ../dev/a.out ../omak/comak
	@-echo Linking.
	@-ld -o omak -x omakzero.o $(OBJ) ../dev/a.out ../sys/a.out \
		longops.o ldiv.o ../omak/comak
	@size omak
	@nm -n omak>omakmap
produnix: unix.what
	@makeprod
unix.what: unix
	@what unix>unix.what

../sys/a.out: dummy
	cd ../sys;make
../dev/a.out: dummy
	cd ../dev;make
../omak/comak: dummy
	cd ../omak;make

lint:   lints ../sys/lints ../dev/lints
	@echo Linting.;cat lints ../sys/lints ../dev/lints | sort -u | /usr/lib/lint/lint2 -hn
lints:  $(LOUT)
	@cat $(LOUT) > lints
../sys/lints: dummy
	cd ../sys;make lints
../dev/lints: dummy
	cd ../dev;make lints
dummy:  ;

conf.o conf.L: conf.c
iotab.o iotab.L: iotab.c
zero.o: zero.s

conf.c: s.conf.c
iotab.c: s.iotab.c
zero.s: s.zero.s

conf.o conf.L: ../h/param.h
conf.o conf.L: ../h/systm.h
conf.o conf.L: ../h/buf.h
conf.o conf.L: ../h/tty.h
conf.o conf.L: ../h/conf.h
conf.o conf.L: ../h/proc.h
conf.o conf.L: ../h/text.h
conf.o conf.L: ../h/dir.h
conf.o conf.L: ../h/user.h
conf.o conf.L: ../h/file.h
conf.o conf.L: ../h/inode.h
conf.o conf.L: ../h/acct.h
iotab.o iotab.L: ../h/io.h
iotab.o iotab.L: ../h/ios.h
