1# 2# Copyright (c) 1987 Regents of the University of California. 3# All rights reserved. 4# 5# Redistribution and use in source and binary forms are permitted 6# provided that the above copyright notice and this paragraph are 7# duplicated in all such forms and that any documentation, 8# advertising materials, and other materials related to such 9# distribution and use acknowledge that the software was developed 10# by the University of California, Berkeley. The name of the 11# University may not be used to endorse or promote products derived 12# from this software without specific prior written permission. 13# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 14# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 15# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 16# 17# @(#)Makefile 7.10 (Berkeley) 05/01/89 18# 19 20RELOC= 800 21MTBOOTRELOC= e0000 22BOOTRELOC= e0000 23LDT1MBSYSOPT= -T ${MTBOOTRELOC} -x 24LDTSYSOPT= -T ${BOOTRELOC} -x 25LDTOPT= -T ${RELOC} -e _entry -x 26 27DESTDIR= 28VPATH= ../stand 29LIBS= libsa.a ${DESTDIR}/lib/libc.a 30COPTS= -O -I. -I../stand -I../h 31CFLAGS= -DSTANDALONE -DCOMPAT_42 -DTAHOE -DRELOC=0x${RELOC} ${COPTS} 32SUBDIR= vdformat 33ALL= boot cat copy ls 34 35SRCS= boot.c cat.c conf.c copy.c dev.c getfile.c gets.c ls.c prf.c \ 36 srt0.c sys.c vd.c cy.c hd.c 37DRIVERS=cy.o vd.o hd.o 38 39#all: srt0.o libsa.a ${ALL} ${SUBDIR} 40all: srt0.o libsa.a ${ALL} 41 42${SUBDIR}: 43 cd $@; make ${MFLAGS} 44 45machdep.o: machdep.c ../tahoe/mtpr.h ../tahoe/mem.h ../tahoe/SYS.h 46 ${CC} -E ${CFLAGS} machdep.c | ${AS} -o machdep.o 47 48libsa.a: conf.o dev.o getfile.o gets.o machdep.o prf.o printn.o sys.o \ 49 ${DRIVERS} 50 ar crv $@ $? 51 ranlib $@ 52 53boot: boot.o bootsrt0.o ${LIBS} 54 ld ${LDTSYSOPT} bootsrt0.o boot.o ${LIBS} 55 nm -u a.out 56 size a.out 57 dd if=a.out of=boot ibs=1024 skip=1 58 -rm -f a.out 59 60boot1mb: boot.o boot1mbsrt0.o ${LIBS} 61 ld ${LDT1MBSYSOPT} boot1mbsrt0.o boot.o ${LIBS} 62 nm -u a.out 63 size a.out 64 dd if=a.out of=boot1mb ibs=1024 skip=1 65 -rm -f a.out 66 67cat: cat.o srt0.o ${LIBS} 68 ld ${LDTOPT} -o $@ -s srt0.o cat.o ${LIBS} 69 70copy: copy.o srt0.o ncy.o ${LIBS} 71 ld ${LDTOPT} -o $@ srt0.o copy.o ncy.o ${LIBS} 72 73xpformat: xpformat.o srt0.o ${LIBS} 74 ld ${LDTOPT} -o $@ srt0.o xpformat.o ${LIBS} 75 76ls: ls.o srt0.o ${LIBS} 77 ld ${LDTOPT} -o $@ -s srt0.o ls.o ${LIBS} 78 79srt0.o: srt0.c 80 ${CC} -E ${CFLAGS} srt0.c | ${AS} -o srt0.o 81 82bootsrt0.o: srt0.c 83 ${CC} -E -DBOOTRELOC=0x${BOOTRELOC} -DREL ${CFLAGS} srt0.c | \ 84 ${AS} -o bootsrt0.o 85 86boot1mbsrt0.o: srt0.c 87 ${CC} -E -DBOOTRELOC=0x${MTBOOTRELOC} -DREL ${CFLAGS} srt0.c | \ 88 ${AS} -o boot1mbsrt0.o 89 90ncy.c: cy.c 91 rm -f ncy.c 92 ln cy.c ncy.c 93 94ncy.o: ncy.c 95 ${CC} -DNOBLOCK ${CFLAGS} -c ncy.c 96 97clean: 98 rm -f ${ALL} *.o *.map *.bak a.out ncy.c libsa.a 99 for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} clean); done 100 101cleandir: clean 102 rm -f ${MAN} tags .depend 103 for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} cleandir); done 104 105depend: ${SRCS} 106 mkdep ${COPTS} ${SRCS} 107 for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} depend); done 108 109install: 110 -mkdir ${DESTDIR}/stand 111 for i in ${ALL}; do \ 112 install -o bin -g bin -m 644 $$i ${DESTDIR}/stand/$$i; \ 113 done 114 rm -f ${DESTDIR}/boot; 115 cp ${DESTDIR}/stand/boot ${DESTDIR}/boot 116 for i in ${SUBDIR}; do \ 117 (cd $$i; make ${MFLAGS} DESTDIR=${DESTDIR} install) \ 118 done 119 120tags: ${SRCS} 121 ctags ${SRCS} 122 for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} tags); done 123