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