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