BSD 4_3_Net_2 release
[unix-history] / usr / src / sys / hp300 / stand / Makefile
index 076c76c..1f72bcb 100644 (file)
-#
-# Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
-# All rights reserved.
-#
-# %sccs.include.redist.sh%
-#
-#      @(#)Makefile    7.4 (Berkeley) %G%
-#
-DESTDIR=
+#      @(#)Makefile    7.8 (Berkeley) 5/8/91
 
 
-#CC=occ -Dconst= -Dvolatile= -Dsigned= -Dinline=
-#AS=oas
+DESTDIR=
+STAND= ../../stand
+INCPATH=-I. -I${STAND} -I../../sys -I..
+VPATH= ${STAND}
 
 
-CC=cc -Dconst=__const__ -Dvolatile=__volatile__ \
-       -Dsigned=__signed__ -Dinline=__inline__ -fpcc-struct-return
+CC=    cc -fpcc-struct-return
 AS=as
 
 AS=as
 
-INCPATH=-I. -I/usr/include -I../sys -I..
-CONS= -DDCACONSOLE -DITECONSOLE -DDCMCONSOLE
-DEFS= -DSTANDALONE ${CONS} # -DROMPRF # -DDEBUG
-COPTS=
-CFLAGS=        -O ${INCPATH} ${DEFS} ${COPTS}
 # RELOC=FFF80000 allows for boot prog up to 7F000 (520192) bytes long
 RELOC= FFF80000
 
 # RELOC=FFF80000 allows for boot prog up to 7F000 (520192) bytes long
 RELOC= FFF80000
 
-SRCS=  sys.c conf.c prf.c machdep.c autoconf.c \
-       hpib.c nhpib.c fhpib.c rd.c ct.c scsi.c sd.c hil.c \
-       cons.c ite.c ite_subr.c ite_dv.c ite_gb.c ite_rb.c ite_tc.c dca.c dcm.c
-DUMMIES=
-DRIVERS=autoconf.o hpib.o nhpib.o fhpib.o rd.o ct.o scsi.o sd.o hil.o \
-       cons.o ite.o ite_subr.o ite_dv.o ite_gb.o ite_rb.o ite_tc.o dca.o dcm.o
-LIBSA= libsa.a
+CONS= -DDCACONSOLE -DITECONSOLE -DDCMCONSOLE
+DEFS= -DSTANDALONE ${CONS} # -DROMPRF
+CFLAGS=        -O ${INCPATH} ${DEFS}
+
+DRIVERS=autoconf.c cons.c ct.c dca.c dcm.c fhpib.c hil.c hpib.c ite.c \
+       ite_dv.c ite_gb.c ite_rb.c ite_subr.c ite_tc.c nhpib.c rd.c \
+       scsi.c sd.c
+SRCS=  conf.c machdep.c prf.c ${DRIVERS}
+LIBS=  libsa/libsa.a libdrive.a ${DESTDIR}/usr/lib/libc.a
 
 ALL=   dboot nboot tboot tcopy
 
 all: ${ALL}
 
 
 ALL=   dboot nboot tboot tcopy
 
 all: ${ALL}
 
-${LIBSA}: sys.o conf.o ${DRIVERS} prf.o machdep.o
-       ar crv ${LIBSA} $?
-       ranlib ${LIBSA}
+dboot nboot tboot tcopy: ${LIBS}
+
+libsa/libsa.a::
+       cd libsa; make
+
+libdrive.a: conf.o machdep.o prf.o ${DRIVERS:.c=.o}
+       ar crv $@ $?
+       ranlib $@
 
 ${DRIVERS}: samachdep.h
 
 ${DRIVERS}: samachdep.h
-       ${CC} -c ${CFLAGS} $*.c
 
 # startups
 
 srt0.o: srt0.c
 
 # startups
 
 srt0.o: srt0.c
-       ${CC} -E ${INCPATH} ${DEFS} ${COPTS} srt0.c | ${AS} -o srt0.o
+       ${CC} -E ${INCPATH} ${DEFS} srt0.c | ${AS} -o srt0.o
 
 tpsrt0.o: srt0.c
 
 tpsrt0.o: srt0.c
-       ${CC} -E ${INCPATH} ${DEFS} ${COPTS} -DTP srt0.c | ${AS} -o tpsrt0.o
+       ${CC} -E ${INCPATH} ${DEFS} -DTP srt0.c | ${AS} -o tpsrt0.o
 
 # bootable from tape
 
 
 # bootable from tape
 
-tboot: tboot.o srt0.o ${LIBSA}
-       ld -N -T ${RELOC} -e begin srt0.o tboot.o ${LIBSA} -lc -o tboot
+tboot: tboot.o srt0.o ${LIBS}
+       ld -N -T ${RELOC} -e begin srt0.o tboot.o ${LIBS} -o $@
        @size tboot
        @echo tboot total size should not exceed 520192 bytes
 
 tboot.o: boot.o
        cp boot.c tboot.c; chmod +w tboot.c
        @size tboot
        @echo tboot total size should not exceed 520192 bytes
 
 tboot.o: boot.o
        cp boot.c tboot.c; chmod +w tboot.c
-       ${CC} -c -O ${INCPATH} ${COPTS} -DJUSTASK tboot.c
+       ${CC} -c -O ${INCPATH} -DJUSTASK tboot.c
        rm -f tboot.c
 
        rm -f tboot.c
 
-tcopy: copy.o tpsrt0.o ${LIBSA}
-       ld -N -T ${RELOC} -e begin tpsrt0.o copy.o ${LIBSA} -lc -o tcopy
+tcopy: copy.o tpsrt0.o ${LIBS}
+       ld -N -T ${RELOC} -e begin tpsrt0.o copy.o ${LIBS} -o $@
        @size tcopy
        @echo tcopy total size should not exceed 520192 bytes
 
 # bootable from floppy or real disks
 
        @size tcopy
        @echo tcopy total size should not exceed 520192 bytes
 
 # bootable from floppy or real disks
 
-dboot: boot.o srt0.o bootconf.o ${LIBSA}
-       ld -N -T ${RELOC} -e begin -o dboot srt0.o boot.o bootconf.o ${LIBSA} -lc
+dboot: boot.o srt0.o bootconf.o ${LIBS}
+       ld -N -T ${RELOC} -e begin srt0.o boot.o bootconf.o ${LIBS} -o $@ 
        @size dboot
        @echo dboot text+data size should not exceed 57344 bytes
        @echo dboot total size should not exceed 520192 bytes
 
 bootconf.o: conf.o
        @size dboot
        @echo dboot text+data size should not exceed 57344 bytes
        @echo dboot total size should not exceed 520192 bytes
 
 bootconf.o: conf.o
-       cp conf.c bootconf.c
-       ${CC} -c ${INCPATH} ${COPTS} -DBOOT bootconf.c
+       rm -f bootconf.c
+       ln -s conf.c bootconf.c
+       ${CC} -c ${INCPATH} -DBOOT bootconf.c
        rm -f bootconf.c
 
 # non-secure boot
 
        rm -f bootconf.c
 
 # non-secure boot
 
-nboot: nboot.o srt0.o bootconf.o ${LIBSA}
-       ld -N -T ${RELOC} -e begin -o nboot srt0.o nboot.o bootconf.o ${LIBSA} -lc
+nboot: nboot.o srt0.o bootconf.o ${LIBS}
+       ld -N -T ${RELOC} -e begin -o nboot srt0.o nboot.o bootconf.o ${LIBS}
        @size nboot
        @echo nboot text+data size should not exceed 57344 bytes
        @echo nboot total size should not exceed 520192 bytes
 
 nboot.o: boot.o
        @size nboot
        @echo nboot text+data size should not exceed 57344 bytes
        @echo nboot total size should not exceed 520192 bytes
 
 nboot.o: boot.o
-       cp boot.c nboot.c; chmod +w nboot.c
-       ${CC} -c -O ${INCPATH} ${COPTS} -DINSECURE ${DEFS} nboot.c
+       rm -f nboot.c
+       ln -s boot.c nboot.c
+       ${CC} -c -O ${INCPATH} -DINSECURE ${DEFS} nboot.c
        rm -f nboot.c
 
        rm -f nboot.c
 
-dcopy:   copy.o srt0.o conf.o ${LIBSA}
-       ld -N -T ${RELOC} -e begin -o dcopy srt0.o copy.o conf.o ${LIBSA} -lc
+dcopy: copy.o srt0.o conf.o ${LIBS}
+       ld -N -T ${RELOC} -e begin -o dcopy srt0.o copy.o conf.o ${LIBS}
 
 mkboot: mkboot.c
        ${CC} ${CFLAGS} -o mkboot mkboot.c
 
 mkboot: mkboot.c
        ${CC} ${CFLAGS} -o mkboot mkboot.c
@@ -104,20 +100,16 @@ installboot: installboot.c
 
 # utilities
 
 
 # utilities
 
-print:
-       @pr makefile
-       @ls -l | pr 
-       @pr *.h *.c
-
 clean:
        rm -f *.o *.exe *.i errs make.out
        rm -f a.out boot cat tpboot tpcopy copy tpformat
        rm -f boot[a-z]? boot[a-wyz][a-z].c conf[a-wyz][a-z].c
 clean:
        rm -f *.o *.exe *.i errs make.out
        rm -f a.out boot cat tpboot tpcopy copy tpformat
        rm -f boot[a-z]? boot[a-wyz][a-z].c conf[a-wyz][a-z].c
-       rm -f format drtest core sboot bootconf.c
-       rm -f libsa.a mkboot tboot tcopy dboot nboot installboot *.lif
+       rm -f format drtest core sboot bootconf.c nboot.c
+       rm -f libdrive.a mkboot tboot tcopy dboot nboot installboot *.lif
+       cd libsa; make cleandir
 
 lint:
 
 lint:
-       lint ${INCPATH} ${COPTS} -hxbn boot.c ${SRCS} | \
+       lint ${INCPATH} -hxbn boot.c ${SRCS} | \
            grep -v 'possible pointer alignment' | \
            grep -v 'struct/union .* never defined'
 
            grep -v 'possible pointer alignment' | \
            grep -v 'struct/union .* never defined'
 
@@ -133,4 +125,4 @@ install: mkboot installboot ${ALL}
        mv diskboot.lif ndiskboot.lif tapeboot.lif ${DESTDIR}/sys/hpdist/tp
 
 depend: ${SRCS}
        mv diskboot.lif ndiskboot.lif tapeboot.lif ${DESTDIR}/sys/hpdist/tp
 
 depend: ${SRCS}
-       mkdep ${INCPATH} -DSTANDALONE ${SRCS} ${DUMMIES}
+       mkdep ${INCPATH} -DSTANDALONE ${SRCS}