#	Copyright (c) 1987 ALTOS COMPUTERS
#	  All Rights Reserved

#	@(#) /usr/sys/Makefile 1.15 88/03/19 

# This is the /usr/sys/Makefile that is shipped to the customer
# for the 386/1000 so that the kernel parameters can be re-configured.
# Please do not modify it without serious forethought.

# for speed and consistency
SHELL=/bin/sh

# directory where new unix will be installed
INSDIR=/

BOOTFILES = boot.d/CLKDEV boot.d/CLOCK boot.d/CLONE \
	boot.d/DB boot.d/DISP boot.d/DU boot.d/DUFST boot.d/ETDRV \
	boot.d/GENTTY boot.d/IOPMEM boot.d/LD0 boot.d/LOG \
	boot.d/MDC boot.d/MDCMEM boot.d/ME boot.d/MEM boot.d/MSG \
	boot.d/NSDRV boot.d/NTTY boot.d/PTY boot.d/S5 boot.d/SC boot.d/SD \
	boot.d/SEM boot.d/SHM boot.d/SP boot.d/SXT boot.d/TIMOD \
	boot.d/TIRDWR boot.d/WORKNET boot.d/XSEM \
	boot.d/FD boot.d/SCSI boot.d/CT_1000 boot.d/WT \
	boot.d/VPIX

# ADD NEW MODULES BEFORE THIS LINE.  DO NOT REMOVE OR CHANGE THIS LINE
# IT IS USED BY INSTALLATION SCRIPTS

MAKE_BOOT = /etc/mkboot -m master.d -d boot.d $@

# no way for customer to re-create the BOOTFILES!
.PRECIOUS: $(BOOTFILES)

all:	unix

# create the new unix if any configuration has been done, or the
# system file has been modified.
# Modifiy the version file so the administrator can always tell
# which version of the kernel is running by typing 'what /unix'
# Save the previous version(s) of the unix as documented in Ch. 9
# of the operations guide.
unix:	$(BOOTFILES) boot.d/KERNEL system
	@chmod 664 master.d/version
	@echo "g/WHATSTRING=/d\n\$$a\nWHATSTRING=\"@(#)Configured at `date '+%T on %D by '`$$LOGNAME\"\n.\nw\nq\n1,\$$p\n" | ed - master.d/version 
	/etc/mkboot -m master.d -d boot.d boot.d/VERSION
	/etc/ldunix -b boot.d -s system
	@rm -f $@
	/etc/mkunix -i kernel -o $@
	@rm -f kimag* ksymbols 
	@-sh -c 'if [ -f $(INSDIR)$@.old ] ; then \
		echo \\tmv $(INSDIR)$@.old $(INSDIR)$@.older ; \
		mv $(INSDIR)$@.old $(INSDIR)$@.older; fi'
	@-sh -c 'if [ -f $(INSDIR)$@ ] ; then \
		echo \\tmv $(INSDIR)$@ $(INSDIR)$@.old ; \
		mv $(INSDIR)$@ $(INSDIR)$@.old; fi'
	ln $@ $(INSDIR)$@

boot.d/KERNEL:	master.d/kernel
	/etc/mkboot -m master.d -d boot.d -k kernel

boot.d/CLONE:	master.d/clone
boot.d/CLKDEV:	master.d/clkdev
boot.d/CLOCK:	master.d/clock
boot.d/DB:	master.d/db
boot.d/DISP:	master.d/disp
boot.d/DUFST:	master.d/dufst
boot.d/DU:	master.d/du
boot.d/ETDRV:	master.d/etdrv
boot.d/GENTTY:	master.d/gentty
boot.d/IOPMEM:	master.d/iopmem
boot.d/LD0:	master.d/ld0
boot.d/LOG:	master.d/log
boot.d/MDC:	master.d/mdc
boot.d/MDCMEM:	master.d/mdcmem
boot.d/ME:	master.d/me
boot.d/MEM:	master.d/mem
boot.d/MSG:	master.d/msg
boot.d/NSDRV:	master.d/nsdrv
boot.d/NTTY:	master.d/ntty
boot.d/PTY:	master.d/pty
boot.d/S5:	master.d/s5
boot.d/SC:	master.d/sc
boot.d/SD:	master.d/sd
boot.d/SEM:	master.d/sem
boot.d/SHM:	master.d/shm
boot.d/SP:	master.d/sp
boot.d/SXT:	master.d/sxt
boot.d/TIMOD:	master.d/timod
boot.d/TIRDWR:	master.d/tirdwr
boot.d/WORKNET:	master.d/worknet
boot.d/WT:	master.d/wt
boot.d/XSEM:	master.d/xsem
boot.d/VPIX:	master.d/vpix

# rest are machine specific (diff for 500, 1000, 2000 models)
boot.d/CT_1000:	master.d/ct_1000
boot.d/FD:	master.d/fd
boot.d/SCSI:	master.d/scsi

$(BOOTFILES):
	$(MAKE_BOOT)
