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