Home | History | Annotate | Line # | Download | only in stand
Makefile revision 1.18
      1 #	$NetBSD: Makefile,v 1.18 1995/09/23 17:40:54 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 sys_inst 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 # installation
     85 sys_inst: srt0.o sys_inst.o clock.o instconf.o inst_netio.o tgets.o ${LIBS}
     86 	${LD} -N -T ${RELOC} -e begin srt0.o sys_inst.o clock.o instconf.o inst_netio.o tgets.o ${LIBS} -o $@
     87 	@size $@
     88 	@echo $@ total size should not exceed 1044480 bytes
     89 
     90 instconf.o: ${.CURDIR}/conf.c
     91 	${CC} ${CFLAGS} -DSYS_INST -c ${.CURDIR}/conf.c -o $@
     92 
     93 inst_netio.o: ${.CURDIR}/netio.c
     94 	${CC} ${CFLAGS} -DSYS_INST -c ${.CURDIR}/netio.c -o $@
     95 
     96 # bootable from network
     97 
     98 netboot:	srt0.o netboot.o clock.o netconf.o netio.o tgets.o ${LIBS}
     99 	${LD} -N -T ${RELOC} -e begin srt0.o netboot.o clock.o netconf.o netio.o tgets.o ${LIBS} -o $@
    100 	@size $@
    101 	@echo $@ total size should not exceed 1044480 bytes
    102 
    103 netconf.o: ${.CURDIR}/conf.c
    104 	${CC} ${CFLAGS} -DNETBOOT -c ${.CURDIR}/conf.c -o $@
    105 
    106 # bootable from tape
    107 
    108 tboot:	srt0.o tboot.o conf.o ${LIBS}
    109 	${LD} -N -T ${RELOC} -e begin srt0.o tboot.o conf.o ${LIBS} -o $@
    110 	@size $@
    111 	@echo $@ total size should not exceed 1044480 bytes
    112 
    113 tboot.o: ${.CURDIR}/boot.c
    114 	${CC} ${CFLAGS} -DJUSTASK -c ${.CURDIR}/boot.c -o $@
    115 
    116 tcopy:	tpsrt0.o copy.o conf.o ${LIBS}
    117 	${LD} -N -T ${RELOC} -e begin tpsrt0.o copy.o conf.o ${LIBS} -o $@
    118 	@size $@
    119 	@echo $@ total size should not exceed 1044480 bytes
    120 
    121 # bootable from floppy or real disks
    122 
    123 dboot:	srt0.o boot.o tapeconf.o ${LIBS}
    124 	${LD} -N -T ${RELOC} -e begin srt0.o boot.o tapeconf.o ${LIBS} -o $@
    125 	@size $@
    126 	@echo $@ text+data size should not exceed 57344 bytes
    127 	@echo $@ total size should not exceed 1044480 bytes
    128 
    129 tapeconf.o: ${.CURDIR}/conf.c
    130 	${CC} ${CFLAGS} -DTAPEBOOT -c ${.CURDIR}/conf.c -o $@
    131 
    132 dcopy:	srt0.o copy.o conf.o ${LIBS}
    133 	${LD} -N -T ${RELOC} -e begin srt0.o copy.o conf.o ${LIBS} -o $@
    134 
    135 mkboot: ${.CURDIR}/mkboot.c
    136 	${CC} ${CFLAGS} ${.CURDIR}/mkboot.c -o $@
    137 
    138 installboot: ${.CURDIR}/installboot.sh
    139 	@rm -f installboot
    140 	cp -p ${.CURDIR}/installboot.sh installboot
    141 
    142 # utilities
    143 
    144 clean::
    145 	rm -f *.o *.exe *.i errs make.out
    146 	rm -f a.out pboot cat ls tboot tcopy
    147 	rm -f boot[a-z]? boot[a-wyz][a-z].c conf[a-wyz][a-z].c
    148 	rm -f core sboot
    149 	rm -f libdrive.a mkboot dboot dcopy installboot *.lif
    150 
    151 install: mkboot installboot ${ALL}
    152 	./mkboot pboot netbsdboot.lif
    153 	./mkboot netboot netboot.lif
    154 	./mkboot sys_inst sys_inst.lif
    155 	./mkboot dboot diskboot.lif
    156 	./mkboot tboot tcopy tapeboot.lif
    157 	install -c -o bin -g bin -m 555 installboot ${DESTDIR}/usr/mdec
    158 	install -c -o bin -g bin -m 444 netbsdboot.lif ${DESTDIR}/usr/mdec/rdboot
    159 	rm -f ${DESTDIR}/usr/mdec/bootrd
    160 	ln ${DESTDIR}/usr/mdec/rdboot ${DESTDIR}/usr/mdec/bootrd
    161 	rm -f ${DESTDIR}/usr/mdec/sdboot
    162 	ln ${DESTDIR}/usr/mdec/rdboot ${DESTDIR}/usr/mdec/sdboot
    163 	rm -f ${DESTDIR}/usr/mdec/bootsd
    164 	ln ${DESTDIR}/usr/mdec/sdboot ${DESTDIR}/usr/mdec/bootsd
    165 	install -d -m 755 -o bin -g bin ${DESTDIR}/usr/mdec/rbootd
    166 	install -c -o bin -g bin -m 444 netboot.lif ${DESTDIR}/usr/mdec/rbootd/SYS_NBOOT
    167 	install -c -o bin -g bin -m 444 sys_inst.lif ${DESTDIR}/usr/mdec/rbootd/SYS_INST
    168 	install -c -o bin -g bin -m 644 tapeboot.lif ${DESTDIR}/usr/mdec/bootct
    169 #	install -o bin -g bin -m 755 -d ${DESTDIR}/sys/hpdist/tp
    170 #	install -o bin -g bin -m 444 netbsdboot.lif ${DESTDIR}/sys/hpdist/tp
    171 #	install -o bin -g bin -m 444 tapeboot.lif ${DESTDIR}/sys/hpdist/tp
    172 #	install -o bin -g bin -m 444 diskboot.lif ${DESTDIR}/sys/hpdist/tp
    173 
    174 .include <bsd.prog.mk>
    175 .include <bsd.subdir.mk>
    176