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