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