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