date and time created 91/05/12 22:30:02 by william
[unix-history] / usr / src / sys / tahoe / stand / Makefile
CommitLineData
b6bb6554 1# @(#)Makefile 7.20 (Berkeley) %G%
d3fdcf07
KB
2
3DESTDIR=
4STAND= ../../stand
5INCPATH=-I. -I../..
6VPATH= ${STAND}
7
8CC= cc
9AS= as
16b6eaa3 10
e613cc84
KB
11RELOC= 800
12MTBOOTRELOC= e0000
13BOOTRELOC= e0000
14LDT1MBSYSOPT= -T ${MTBOOTRELOC} -x
15LDTSYSOPT= -T ${BOOTRELOC} -x
16LDTOPT= -T ${RELOC} -e _entry -x
17
d3fdcf07
KB
18DEFS= -DSTANDALONE -DCOMPAT_42 -DTAHOE -DRELOC=0x${RELOC}
19CFLAGS= -O ${INCPATH} ${DEFS}
20
d3fdcf07 21DRIVERS=cy.c hd.c vd.c
d3fdcf07 22SRCS= boot.c cat.c conf.c copy.c cy.c hd.c ls.c prf.c srt0.c \
ebe56e3d 23 ${DRIVERS}
b6bb6554 24LIBS= libsa/libsa.a libdrive.a ${DESTDIR}/usr/lib/libc.a
ebe56e3d
KB
25
26SUBDIR= vdformat
27ALL= boot cat copy ls
30798539 28
ebe56e3d 29all: srt0.o ${ALL} # ${SUBDIR}
30798539 30
bd7117cf 31${SUBDIR}:
e613cc84 32 cd $@; make ${MFLAGS}
30798539 33
b6bb6554
KB
34libsa/libsa.a::
35 cd libsa; make
30798539 36
ebe56e3d 37libdrive.a: conf.o machdep.o prf.o ${DRIVERS:.c=.o}
30798539
SL
38 ar crv $@ $?
39 ranlib $@
40
ebe56e3d
KB
41machdep.o: machdep.c ../include/mtpr.h ../tahoe/mem.h ../tahoe/SYS.h
42 ${CC} -E ${CFLAGS} machdep.c | ${AS} -o machdep.o
43
e613cc84 44boot: boot.o bootsrt0.o ${LIBS}
109688a4
MK
45 ld ${LDTSYSOPT} bootsrt0.o boot.o ${LIBS}
46 nm -u a.out
47 size a.out
48 dd if=a.out of=boot ibs=1024 skip=1
49 -rm -f a.out
30798539 50
109688a4
MK
51boot1mb: boot.o boot1mbsrt0.o ${LIBS}
52 ld ${LDT1MBSYSOPT} boot1mbsrt0.o boot.o ${LIBS}
53 nm -u a.out
54 size a.out
55 dd if=a.out of=boot1mb ibs=1024 skip=1
56 -rm -f a.out
30798539 57
e613cc84
KB
58cat: cat.o srt0.o ${LIBS}
59 ld ${LDTOPT} -o $@ -s srt0.o cat.o ${LIBS}
30798539 60
e613cc84
KB
61copy: copy.o srt0.o ncy.o ${LIBS}
62 ld ${LDTOPT} -o $@ srt0.o copy.o ncy.o ${LIBS}
30798539
SL
63
64xpformat: xpformat.o srt0.o ${LIBS}
e613cc84 65 ld ${LDTOPT} -o $@ srt0.o xpformat.o ${LIBS}
30798539 66
e613cc84
KB
67ls: ls.o srt0.o ${LIBS}
68 ld ${LDTOPT} -o $@ -s srt0.o ls.o ${LIBS}
30798539 69
30798539 70srt0.o: srt0.c
f261dcf3 71 ${CC} -E ${CFLAGS} srt0.c | ${AS} -o srt0.o
30798539
SL
72
73bootsrt0.o: srt0.c
f261dcf3 74 ${CC} -E -DBOOTRELOC=0x${BOOTRELOC} -DREL ${CFLAGS} srt0.c | \
109688a4 75 ${AS} -o bootsrt0.o
30798539
SL
76
77boot1mbsrt0.o: srt0.c
f261dcf3 78 ${CC} -E -DBOOTRELOC=0x${MTBOOTRELOC} -DREL ${CFLAGS} srt0.c | \
109688a4 79 ${AS} -o boot1mbsrt0.o
30798539 80
e613cc84 81ncy.c: cy.c
f261dcf3 82 rm -f ncy.c
30798539
SL
83 ln cy.c ncy.c
84
e613cc84 85ncy.o: ncy.c
30798539
SL
86 ${CC} -DNOBLOCK ${CFLAGS} -c ncy.c
87
bd7117cf 88clean:
ebe56e3d 89 rm -f ${ALL} *.o *.map *.bak a.out ncy.c libdrive.a
b6bb6554 90 cd libsa; make clean
e613cc84
KB
91 for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} clean); done
92
bd7117cf
KB
93cleandir: clean
94 rm -f ${MAN} tags .depend
b6bb6554 95 cd libsa; make cleandir
bd7117cf
KB
96 for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} cleandir); done
97
98depend: ${SRCS}
e613cc84
KB
99 mkdep ${COPTS} ${SRCS}
100 for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} depend); done
30798539 101
bd7117cf 102install:
3abe72b4
KB
103 install -o bin -g bin -m 644 cat copy ls ${DESTDIR}/stand
104 install -o bin -g bin -m 644 boot ${DESTDIR}/
e613cc84
KB
105 for i in ${SUBDIR}; do \
106 (cd $$i; make ${MFLAGS} DESTDIR=${DESTDIR} install) \
107 done
891f5a89 108
bd7117cf 109tags: ${SRCS}
e613cc84
KB
110 ctags ${SRCS}
111 for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} tags); done