--- Net2/arch/i386/stand/makefile 2018/04/24 18:04:01 1.1 +++ Net2/arch/i386/stand/makefile 2018/04/24 18:12:19 1.1.1.4 @@ -1,41 +1,39 @@ -# @(#)Makefile 7.9 (Berkeley) 5/8/91 - -DESTDIR=/ -STAND= ../../stand -INCPATH=-I../../sys -I../../ -I${STAND} +# from: @(#)Makefile 7.9 (Berkeley) 5/8/91 +# +# PATCHES MAGIC LEVEL PATCH THAT GOT US HERE +# -------------------- ----- ---------------------- +# CURRENT PATCH LEVEL: 1 00088 +# -------------------- ----- ---------------------- +# +# 23 Oct 92 Joerg Lohse added rule to compile 'trimhd' +# (trimhd = 'dd bs=1 skip=32') +# 10 Mar 93 Rodney W. Grimes Fixed DESTDIR and STANDIR so +# that make install works correctly +# + +DESTDIR=/usr +LD=/usr/bin/ld +STAND= /sys/stand +INCPATH=-I/sys/sys -I/sys -I/sys/ufs -I${STAND} VPATH= ${STAND} -STANDDIR= ${DESTDIR}/stand +STANDDIR= ${DESTDIR}/mdec CC= cc -traditional -C2= /usr/libexec/c2 CPP= cpp -traditional ${INCPATH} -DSTANDALONE -DAT386 -RELOC= 70000 -RELOC2= 70200 +RELOC= 98000 +RELOC2= 98200 CFLAGS= -DSTANDALONE -DAT386 -O ${INCPATH} -DRIVERS=cga.c fd.c kbd.c wd.c -SRCS= boot.c bootxx.c conf.c confxx.c copy.c fd.c fdbootblk.c prf.c \ +DRIVERS=cga.c fd.c kbd.c wd.c as.c +SRCS= boot.c fdbootblk.c prf.c \ srt0.c wdbootblk.c ${DRIVERS} ${SASRC} -LIBS= libsa/libsa.a libdrive.a ${DESTDIR}/usr/lib/libc.a -SMLIBS= libsmsa/libsmsa.a libdrive.a ${DESTDIR}/usr/lib/libc.a -BOOTBLOCKS= wdboot bootwd fdboot bootfd -DISKUTILS= boot copy cat ls -ALL= ${BOOTBLOCKS} ${DISKUTILS} +ALL= wdboot bootwd fdboot bootfd asboot bootas all: ${ALL} -libsa/libsa.a:: - cd libsa; make -libsmsa/libsmsa.a:: - cd libsmsa; make - -libdrive.a: conf.o prf.o ${DRIVERS:.c=.o} - ar crv $@ $? - ranlib $@ - # startups srt0.o: srt0.c @@ -56,112 +54,69 @@ wdbootblk.o: wdbootblk.c fdbootblk.o: fdbootblk.c ${CPP} -E -DLOCORE -DRELOC=0x${RELOC} fdbootblk.c | ${AS} -o $@ -# bootable from floppy or real disks +asbootblk.o: asbootblk.c + cc -c -O -DRELOC=0x${RELOC} ${INCPATH} asbootblk.c -boot: boot.o bootconf.o cga.o relsrt0.o ${LIBS} - ld -N -T ${RELOC} -o $@ boot.o bootconf.o cga.o relsrt0.o ${LIBS} +# getting booted from disc -bootconf.o: conf.o - ln -s conf.c bootconf.c - ${CC} -c ${CFLAGS} -DBOOT bootconf.c - rm -f bootconf.c +wdboot: wdbootblk.o trimhd + ${LD} -N -T ${RELOC} wdbootblk.o + rm -f $@; strip a.out; trimhd 32 $@; rm -f a.out; ls -l $@ + +bootwd: wsrt0.o boot.o bmap.o cga.o fs.o kbd.o prf.o wd.o printf.o breadwd.o trimhd + ${LD} -N -T ${RELOC2} wsrt0.o boot.o bmap.o cga.o kbd.o prf.o printf.o \ + breadwd.o fs.o wd.o -lc + size a.out + rm -f $@; strip a.out; trimhd 32 $@; rm -f a.out; ls -l $@ -# utilities +fdboot: fdbootblk.o trimhd + ${LD} -N -T ${RELOC} fdbootblk.o + rm -f $@; strip a.out; trimhd 32 $@; rm -f a.out; ls -l $@ + +bootfd: wsrt0.o boot.o bmap.o cga.o fs.o kbd.o prf.o fd.o printf.o breadfd.o trimhd + ${LD} -N -T ${RELOC2} wsrt0.o boot.o bmap.o cga.o kbd.o prf.o printf.o \ + breadfd.o fs.o fd.o -lc + size a.out + rm -f $@; strip a.out; trimhd 32 $@; rm -f a.out; ls -l $@ -cat: cat.o srt0.o conf.o ${LIBS} - ld -N -o $@ srt0.o cat.o conf.o ${LIBS} +asboot: asbootblk.o trimhd + ${LD} -N -T 7c00 asbootblk.o + rm -f $@; strip a.out; trimhd 32 $@; rm -f a.out; ls -l $@ + +bootas: wsrt0.o boot.o bmap.o cga.o fs.o kbd.o prf.o as.o printf.o breadas.o trimhd + ${LD} -N -T ${RELOC2} wsrt0.o boot.o bmap.o cga.o kbd.o prf.o printf.o \ + breadas.o fs.o as.o -lc + size a.out + rm -f $@; strip a.out; trimhd 32 $@; rm -f a.out; ls -l $@ -ls: ls.o srt0.o conf.o ${LIBS} - ld -N -o $@ srt0.o ls.o conf.o ${LIBS} -copy: copy.o srt0.o conf.o ${LIBS} - ld -N -o $@ srt0.o copy.o conf.o ${LIBS} +breadwd.o: breadwd.c breadxx.o +breadfd.o: breadfd.c breadxx.o +breadas.o: breadas.c breadxx.o -# getting booted from disc +breadxx.o: + touch breadxx.o -wdboot: wdbootblk.o - ld -N -T ${RELOC} wdbootblk.o - cp a.out wdb - rm -f wdboot - strip a.out;dd if=a.out of=wdboot ibs=32 skip=1;rm -f a.out - ls -l wdboot - -bootwd: wdbootblk.o wsrt0.o bootxx.o sm_confwd.o sm_wd.o sm_cga.o ${SMLIBS} - ld -N -T ${RELOC2} wsrt0.o bootxx.o sm_confwd.o sm_wd.o \ - sm_cga.o ${SMLIBS} - size a.out - cp a.out bwd - rm -f bootwd - strip a.out;dd if=a.out of=bootwd ibs=32 skip=1;rm -f a.out - ls -l bootwd - -fdboot: fdbootblk.o - ld -N -T ${RELOC} fdbootblk.o - cp a.out fdb - rm -f fdboot - strip a.out;dd if=a.out of=fdboot ibs=32 skip=1;rm -f a.out - ls -l fdboot +breadwd.c: breadxx.c + rm -f breadwd.c + sed -e 's/XX/wd/' -e 's/xx/wd/g' < breadxx.c >> breadwd.c -bootfd: fdbootblk.o wsrt0.o bootxx.o fd.o sm_cga.o sm_conffd.o ${SMLIBS} - ld -N -T ${RELOC2} wsrt0.o bootxx.o fd.o sm_cga.o sm_conffd.o ${SMLIBS} - size a.out - cp a.out bfd - rm -f bootfd - strip a.out; dd if=a.out of=bootfd ibs=32 skip=1;rm -f a.out - ls -l bootfd - -sm_conffd.o: conffd.c - rm -f sm_conffd.c - ln -s conffd.c sm_conffd.c - ${CC} -S -DSMALL ${CFLAGS} sm_conffd.c - ${AS} sm_conffd.s -o sm_conffd.o - rm -f sm_conffd.s sm_conffd.c - -sm_confwd.o: confwd.c - rm -f sm_confwd.c - ln -s confwd.c sm_confwd.c - ${CC} -S -DSMALL ${CFLAGS} sm_confwd.c - ${AS} sm_confwd.s -o sm_confwd.o - rm -f sm_confwd.s sm_confwd.c - -sm_cga.o: cga.c - rm -f sm_cga.c - ln -s cga.c sm_cga.c - ${CC} -S -DSMALL ${CFLAGS} sm_cga.c - ${AS} sm_cga.s -o sm_cga.o - rm -f sm_cga.s sm_cga.c - -sm_wd.o: wd.c - rm -f sm_wd.c - ln -s wd.c sm_wd.c - ${CC} -S -DSMALL ${CFLAGS} sm_wd.c - ${AS} sm_wd.s -o sm_wd.o - rm -f sm_wd.s sm_wd.c - -confwd.o: confwd.c confxx.o -conffd.o: conffd.c confxx.o - -confxx.o: - touch confxx.o - -confwd.c: confxx.c - rm -f confwd.c - sed -e 's/io->i_dev/0/g' < ${STAND}/dev.c > confwd.c - sed -e 's/XX/wd/' -e 's/xx/wd/g' < confxx.c >> confwd.c - -conffd.c: confxx.c - rm -f conffd.c - sed -e 's/io->i_dev/0/g' < ${STAND}/dev.c > conffd.c - sed -e 's/XX/fd/' -e 's/xx/fd/g' < confxx.c >> conffd.c +breadfd.c: breadxx.c + rm -f breadfd.c + sed -e 's/XX/fd/' -e 's/xx/fd/g' < breadxx.c >> breadfd.c + +breadas.c: breadxx.c + rm -f breadas.c + sed -e 's/XX/as/' -e 's/xx/as/g' < breadxx.c >> breadas.c + +trimhd: trimhd.c + ${CC} ${CFLAGS} -s -o trimhd trimhd.c clean: - rm -f *.o *.exe *.i sm_*.c libdrive.a + rm -f *.o *.exe *.i sm_*.c trimhd rm -f a.out bfd bwd fdb wdb ${ALL} rm -f boot[a-wyz]? boot[a-wyz]?? boot[a-wyz]?.c boot[a-wyz]??.c \ - conf[a-wyz]?.c conf[a-wyz]??.c - rm -f format core sboot bootconf.c - cd libsa; make cleandir - cd libsmsa; make cleandir + conf[a-wyz]?.c conf[a-wyz]??.c bread[a-wyz]?.c cleandir: clean rm -f ${MAN} tags .depend @@ -170,8 +125,4 @@ depend: ${SRCS} mkdep ${INCPATH} -DSTANDALONE ${SRCS} ${DUMMIES} install: ${ALL} - install -c -s boot ${DESTDIR} - cp ${DISKUTILS} ../dist/floppy - cp ${TAPEUTILS} ../dist/tp - cp ${BOOTBLOCKS} ${STANDDIR} - cp ${DISKUTILS} ${STANDDIR} + cp ${ALL} ${STANDDIR}