Commit | Line | Data |
---|---|---|
b6bb6554 | 1 | # @(#)Makefile 7.20 (Berkeley) %G% |
d3fdcf07 KB |
2 | |
3 | DESTDIR= | |
4 | STAND= ../../stand | |
5 | INCPATH=-I. -I../.. | |
6 | VPATH= ${STAND} | |
7 | ||
8 | CC= cc | |
9 | AS= as | |
16b6eaa3 | 10 | |
e613cc84 KB |
11 | RELOC= 800 |
12 | MTBOOTRELOC= e0000 | |
13 | BOOTRELOC= e0000 | |
14 | LDT1MBSYSOPT= -T ${MTBOOTRELOC} -x | |
15 | LDTSYSOPT= -T ${BOOTRELOC} -x | |
16 | LDTOPT= -T ${RELOC} -e _entry -x | |
17 | ||
d3fdcf07 KB |
18 | DEFS= -DSTANDALONE -DCOMPAT_42 -DTAHOE -DRELOC=0x${RELOC} |
19 | CFLAGS= -O ${INCPATH} ${DEFS} | |
20 | ||
d3fdcf07 | 21 | DRIVERS=cy.c hd.c vd.c |
d3fdcf07 | 22 | SRCS= boot.c cat.c conf.c copy.c cy.c hd.c ls.c prf.c srt0.c \ |
ebe56e3d | 23 | ${DRIVERS} |
b6bb6554 | 24 | LIBS= libsa/libsa.a libdrive.a ${DESTDIR}/usr/lib/libc.a |
ebe56e3d KB |
25 | |
26 | SUBDIR= vdformat | |
27 | ALL= boot cat copy ls | |
30798539 | 28 | |
ebe56e3d | 29 | all: srt0.o ${ALL} # ${SUBDIR} |
30798539 | 30 | |
bd7117cf | 31 | ${SUBDIR}: |
e613cc84 | 32 | cd $@; make ${MFLAGS} |
30798539 | 33 | |
b6bb6554 KB |
34 | libsa/libsa.a:: |
35 | cd libsa; make | |
30798539 | 36 | |
ebe56e3d | 37 | libdrive.a: conf.o machdep.o prf.o ${DRIVERS:.c=.o} |
30798539 SL |
38 | ar crv $@ $? |
39 | ranlib $@ | |
40 | ||
ebe56e3d KB |
41 | machdep.o: machdep.c ../include/mtpr.h ../tahoe/mem.h ../tahoe/SYS.h |
42 | ${CC} -E ${CFLAGS} machdep.c | ${AS} -o machdep.o | |
43 | ||
e613cc84 | 44 | boot: 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 |
51 | boot1mb: 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 |
58 | cat: cat.o srt0.o ${LIBS} |
59 | ld ${LDTOPT} -o $@ -s srt0.o cat.o ${LIBS} | |
30798539 | 60 | |
e613cc84 KB |
61 | copy: copy.o srt0.o ncy.o ${LIBS} |
62 | ld ${LDTOPT} -o $@ srt0.o copy.o ncy.o ${LIBS} | |
30798539 SL |
63 | |
64 | xpformat: xpformat.o srt0.o ${LIBS} | |
e613cc84 | 65 | ld ${LDTOPT} -o $@ srt0.o xpformat.o ${LIBS} |
30798539 | 66 | |
e613cc84 KB |
67 | ls: ls.o srt0.o ${LIBS} |
68 | ld ${LDTOPT} -o $@ -s srt0.o ls.o ${LIBS} | |
30798539 | 69 | |
30798539 | 70 | srt0.o: srt0.c |
f261dcf3 | 71 | ${CC} -E ${CFLAGS} srt0.c | ${AS} -o srt0.o |
30798539 SL |
72 | |
73 | bootsrt0.o: srt0.c | |
f261dcf3 | 74 | ${CC} -E -DBOOTRELOC=0x${BOOTRELOC} -DREL ${CFLAGS} srt0.c | \ |
109688a4 | 75 | ${AS} -o bootsrt0.o |
30798539 SL |
76 | |
77 | boot1mbsrt0.o: srt0.c | |
f261dcf3 | 78 | ${CC} -E -DBOOTRELOC=0x${MTBOOTRELOC} -DREL ${CFLAGS} srt0.c | \ |
109688a4 | 79 | ${AS} -o boot1mbsrt0.o |
30798539 | 80 | |
e613cc84 | 81 | ncy.c: cy.c |
f261dcf3 | 82 | rm -f ncy.c |
30798539 SL |
83 | ln cy.c ncy.c |
84 | ||
e613cc84 | 85 | ncy.o: ncy.c |
30798539 SL |
86 | ${CC} -DNOBLOCK ${CFLAGS} -c ncy.c |
87 | ||
bd7117cf | 88 | clean: |
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 |
93 | cleandir: 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 | ||
98 | depend: ${SRCS} | |
e613cc84 KB |
99 | mkdep ${COPTS} ${SRCS} |
100 | for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} depend); done | |
30798539 | 101 | |
bd7117cf | 102 | install: |
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 | 109 | tags: ${SRCS} |
e613cc84 KB |
110 | ctags ${SRCS} |
111 | for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} tags); done |