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