1 # from: @(#)Makefile 8.1 (Berkeley) 6/10/93 2 # $Id: Makefile,v 1.12 1994/09/19 00:23:36 mycroft Exp $ 3 4 # RELOC=FFF00000 allows for boot prog up to FF000 (1044480) bytes long 5 RELOC= FFF00000 6 7 CONS= -DDCACONSOLE -DITECONSOLE -DDCMCONSOLE 8 DEFS= -DSTANDALONE -DCOMPAT_NOLABEL ${CONS} -Dhp300 # -DROMPRF 9 CFLAGS= -O ${INCPATH} ${DEFS} 10 11 SRCS= autoconf.c cons.c ct.c devopen.c dca.c dcm.c fhpib.c hil.c hpib.c \ 12 ite.c ite_dv.c ite_gb.c ite_rb.c ite_subr.c ite_tc.c ite_hy.c \ 13 nhpib.c rd.c scsi.c sd.c 14 SRCS+= conf.c machdep.c prf.c tgets.c 15 16 S= ${.CURDIR}/../../.. 17 18 .PATH: ${S}/arch/${MACHINE_ARCH}/${MACHINE_ARCH} 19 .PATH: ${S}/stand ${S}/lib/libsa 20 21 INCPATH=-I${.CURDIR} -I${.CURDIR}/../.. -I${S} -I${S}/lib/libsa 22 23 ### find out what to use for libkern 24 .include "$S/lib/libkern/Makefile.inc" 25 LIBKERN= ${KERNLIB} 26 27 .include "$S/lib/libsa/Makefile.inc" 28 LIBSA= ${SA_LIB} 29 30 LIBS= ${LIBSA} libdrive.a \ 31 ${LIBSA} ${LIBKERN} 32 33 BOOTS= pboot dboot nboot dcopy tboot tcopy cat #ls 34 ALL= ${BOOTS} mkboot installboot 35 36 all: ${ALL} 37 38 ${BOOTS}: ${LIBS} 39 40 OBJS= ${SRCS:N*.h:R:S/$/.o/g} 41 libdrive.a: ${OBJS} 42 rm -f $@ 43 ${AR} cq $@ ${OBJS} 44 ${RANLIB} $@ 45 46 # depend on DEFS 47 48 devopen.o machdep.o srt0.o: Makefile 49 cons.o dca.o hil.o: Makefile 50 ite.o ite_subr.o ite_dv.o ite_gb.o ite_hy.o ite_rb.o ite_tc.o: Makefile 51 52 # startups 53 54 srt0.o: ${.CURDIR}/srt0.s 55 ${CC} ${INCPATH} ${DEFS} -c ${.CURDIR}/srt0.s 56 57 tpsrt0.o: ${.CURDIR}/srt0.s 58 ${CC} ${INCPATH} ${DEFS} -DTP -c ${.CURDIR}/srt0.s -o tpsrt0.o 59 60 # new boot 61 pboot: pboot.o srt0.o ${LIBS} 62 ${LD} -N -T ${RELOC} -e begin srt0.o pboot.o ${LIBS} -o $@ 63 @size pboot 64 @echo pboot total size should not exceed 1044480 bytes 65 66 ls: ls.o srt0.o ${LIBS} 67 ${LD} -N -T ${RELOC} -e begin srt0.o ls.o ${LIBS} -o $@ 68 @size ls 69 @echo ls total size should not exceed 1044480 bytes 70 71 cat: cat.o srt0.o ${LIBS} 72 ${LD} -N -T ${RELOC} -e begin srt0.o cat.o ${LIBS} -o $@ 73 @size cat 74 @echo cat total size should not exceed 1044480 bytes 75 76 # bootable from tape 77 78 tboot: tboot.o srt0.o ${LIBS} 79 ${LD} -N -T ${RELOC} -e begin srt0.o tboot.o ${LIBS} -o $@ 80 @size tboot 81 @echo tboot total size should not exceed 1044480 bytes 82 83 tboot.o: boot.c 84 cp ${.CURDIR}/boot.c tboot.c; chmod +w tboot.c 85 ${CC} -c ${CFLAGS} -DJUSTASK tboot.c 86 rm -f tboot.c 87 88 tcopy: copy.o tpsrt0.o ${LIBS} 89 ${LD} -N -T ${RELOC} -e begin tpsrt0.o copy.o ${LIBS} -o $@ 90 @size tcopy 91 @echo tcopy total size should not exceed 1044480 bytes 92 93 # bootable from floppy or real disks 94 95 dboot: boot.o srt0.o bootconf.o ${LIBS} 96 ${LD} -N -T ${RELOC} -e begin srt0.o boot.o bootconf.o ${LIBS} -o $@ 97 @size dboot 98 @echo dboot text+data size should not exceed 57344 bytes 99 @echo dboot total size should not exceed 1044480 bytes 100 101 bootconf.o: ${.CURDIR}/conf.c 102 rm -f bootconf.c 103 ln -s ${.CURDIR}/conf.c bootconf.c 104 ${CC} -c ${CFLAGS} -DBOOT bootconf.c 105 rm -f bootconf.c 106 107 # non-secure boot (allows booting non-root owned or world writable kernels) 108 109 nboot: nboot.o srt0.o bootconf.o ${LIBS} 110 ${LD} -N -T ${RELOC} -e begin -o nboot srt0.o nboot.o bootconf.o ${LIBS} 111 @size nboot 112 @echo nboot text+data size should not exceed 57344 bytes 113 @echo nboot total size should not exceed 1044480 bytes 114 115 nboot.o: ${.CURDIR}/boot.c 116 rm -f nboot.c 117 ln -s ${.CURDIR}/boot.c nboot.c 118 ${CC} -c ${CFLAGS} -DINSECURE nboot.c 119 rm -f nboot.c 120 121 dcopy: copy.o srt0.o conf.o ${LIBS} 122 ${LD} -N -T ${RELOC} -e begin -o dcopy srt0.o copy.o conf.o ${LIBS} 123 124 mkboot: ${.CURDIR}/mkboot.c 125 ${CC} ${CFLAGS} -o mkboot ${.CURDIR}/mkboot.c 126 127 installboot: ${.CURDIR}/installboot.sh 128 @rm -f installboot 129 cp -p ${.CURDIR}/installboot.sh installboot 130 131 # utilities 132 133 clean cleandir: 134 rm -f *.o *.exe *.i errs make.out 135 rm -f a.out pboot cat ls tboot tcopy 136 rm -f boot[a-z]? boot[a-wyz][a-z].c conf[a-wyz][a-z].c 137 rm -f core sboot bootconf.c nboot.c 138 rm -f libdrive.a mkboot dboot dcopy nboot installboot *.lif 139 140 install: mkboot installboot ${ALL} 141 ./mkboot pboot netbsdboot.lif 142 ./mkboot dboot diskboot.lif 143 ./mkboot nboot ndiskboot.lif 144 ./mkboot tboot tcopy tapeboot.lif 145 install -c -o bin -g bin -m 555 installboot ${DESTDIR}/usr/mdec 146 install -c -o bin -g bin -m 444 netbsdboot.lif ${DESTDIR}/usr/mdec/rdboot 147 rm -f ${DESTDIR}/usr/mdec/bootrd 148 ln ${DESTDIR}/usr/mdec/rdboot ${DESTDIR}/usr/mdec/bootrd 149 rm -f ${DESTDIR}/usr/mdec/sdboot 150 ln ${DESTDIR}/usr/mdec/rdboot ${DESTDIR}/usr/mdec/sdboot 151 rm -f ${DESTDIR}/usr/mdec/bootsd 152 ln ${DESTDIR}/usr/mdec/sdboot ${DESTDIR}/usr/mdec/bootsd 153 install -c -o bin -g bin -m 644 tapeboot.lif ${DESTDIR}/usr/mdec/bootct 154 # install -o bin -g bin -m 755 -d ${DESTDIR}/sys/hpdist/tp 155 # install -o bin -g bin -m 444 netbsdboot.lif ${DESTDIR}/sys/hpdist/tp 156 # install -o bin -g bin -m 444 tapeboot.lif ${DESTDIR}/sys/hpdist/tp 157 # install -o bin -g bin -m 444 diskboot.lif ${DESTDIR}/sys/hpdist/tp 158 # install -o bin -g bin -m 444 ndiskboot.lif ${DESTDIR}/sys/hpdist/tp 159 160 .include <bsd.dep.mk> 161 .include <bsd.obj.mk> 162 # XXX This should not be necessary. 163 .include <bsd.subdir.mk> 164 165 FRC: 166