1# @(#)Makefile 7.9 (Berkeley) 02/24/92 2 3DESTDIR= 4STAND= ../../stand 5INCPATH=-I. -I${STAND} -I../../sys -I.. 6VPATH= ${STAND} 7 8CC= cc -fpcc-struct-return 9AS=as 10 11# RELOC=FFF80000 allows for boot prog up to 7F000 (520192) bytes long 12RELOC= FFF80000 13 14CONS= -DDCACONSOLE -DITECONSOLE -DDCMCONSOLE 15DEFS= -DSTANDALONE ${CONS} # -DROMPRF 16CFLAGS= -O ${INCPATH} ${DEFS} 17 18DRIVERS=autoconf.c cons.c ct.c dca.c dcm.c fhpib.c hil.c hpib.c ite.c \ 19 ite_dv.c ite_gb.c ite_rb.c ite_subr.c ite_tc.c nhpib.c rd.c \ 20 scsi.c sd.c 21SRCS= conf.c machdep.c prf.c ${DRIVERS} 22LIBS= libsa/libsa.a libdrive.a ${DESTDIR}/usr/lib/libgnulib.a \ 23 ${DESTDIR}/usr/lib/libc.a 24 25ALL= dboot nboot tboot tcopy 26 27all: ${ALL} 28 29dboot nboot tboot tcopy: ${LIBS} 30 31libsa/libsa.a:: 32 cd libsa; make 33 34libdrive.a: conf.o machdep.o prf.o ${DRIVERS:.c=.o} 35 ar crv $@ $? 36 ranlib $@ 37 38${DRIVERS}: samachdep.h 39 40# startups 41 42srt0.o: srt0.c 43 ${CC} -E ${INCPATH} ${DEFS} srt0.c | ${AS} -o srt0.o 44 45tpsrt0.o: srt0.c 46 ${CC} -E ${INCPATH} ${DEFS} -DTP srt0.c | ${AS} -o tpsrt0.o 47 48# bootable from tape 49 50tboot: tboot.o srt0.o ${LIBS} 51 ld -N -T ${RELOC} -e begin srt0.o tboot.o ${LIBS} -o $@ 52 @size tboot 53 @echo tboot total size should not exceed 520192 bytes 54 55tboot.o: boot.o 56 cp boot.c tboot.c; chmod +w tboot.c 57 ${CC} -c -O ${INCPATH} -DJUSTASK tboot.c 58 rm -f tboot.c 59 60tcopy: copy.o tpsrt0.o ${LIBS} 61 ld -N -T ${RELOC} -e begin tpsrt0.o copy.o ${LIBS} -o $@ 62 @size tcopy 63 @echo tcopy total size should not exceed 520192 bytes 64 65# bootable from floppy or real disks 66 67dboot: boot.o srt0.o bootconf.o ${LIBS} 68 ld -N -T ${RELOC} -e begin srt0.o boot.o bootconf.o ${LIBS} -o $@ 69 @size dboot 70 @echo dboot text+data size should not exceed 57344 bytes 71 @echo dboot total size should not exceed 520192 bytes 72 73bootconf.o: conf.o 74 rm -f bootconf.c 75 ln -s conf.c bootconf.c 76 ${CC} -c ${INCPATH} -DBOOT bootconf.c 77 rm -f bootconf.c 78 79# non-secure boot 80 81nboot: nboot.o srt0.o bootconf.o ${LIBS} 82 ld -N -T ${RELOC} -e begin -o nboot srt0.o nboot.o bootconf.o ${LIBS} 83 @size nboot 84 @echo nboot text+data size should not exceed 57344 bytes 85 @echo nboot total size should not exceed 520192 bytes 86 87nboot.o: boot.o 88 rm -f nboot.c 89 ln -s boot.c nboot.c 90 ${CC} -c -O ${INCPATH} -DINSECURE ${DEFS} nboot.c 91 rm -f nboot.c 92 93dcopy: copy.o srt0.o conf.o ${LIBS} 94 ld -N -T ${RELOC} -e begin -o dcopy srt0.o copy.o conf.o ${LIBS} 95 96mkboot: mkboot.c 97 ${CC} ${CFLAGS} -o mkboot mkboot.c 98 99installboot: installboot.c 100 ${CC} ${CFLAGS} -o installboot installboot.c 101 102# utilities 103 104clean: 105 rm -f *.o *.exe *.i errs make.out 106 rm -f a.out boot cat tpboot tpcopy copy tpformat 107 rm -f boot[a-z]? boot[a-wyz][a-z].c conf[a-wyz][a-z].c 108 rm -f format drtest core sboot bootconf.c nboot.c 109 rm -f libdrive.a mkboot tboot tcopy dboot nboot installboot *.lif 110 cd libsa; make cleandir 111 112lint: 113 lint ${INCPATH} -hxbn boot.c ${SRCS} | \ 114 grep -v 'possible pointer alignment' | \ 115 grep -v 'struct/union .* never defined' 116 117install: mkboot installboot ${ALL} 118 mkboot dboot diskboot.lif 119 mkboot nboot ndiskboot.lif 120 mkboot tboot tcopy tapeboot.lif 121 install -c -s installboot ${DESTDIR}/usr/mdec 122 install -c -m 644 diskboot.lif ${DESTDIR}/usr/mdec/bootrd 123 rm -f ${DESTDIR}/usr/mdec/bootsd 124 ln ${DESTDIR}/usr/mdec/bootrd ${DESTDIR}/usr/mdec/bootsd 125 install -c -m 644 tapeboot.lif ${DESTDIR}/usr/mdec/bootct 126 mv diskboot.lif ndiskboot.lif tapeboot.lif ${DESTDIR}/sys/hpdist/tp 127 128depend: ${SRCS} 129 mkdep ${INCPATH} -DSTANDALONE ${SRCS} 130