Commit | Line | Data |
---|---|---|
96492f3d | 1 | # Makefile 7.5 86/11/16 |
30798539 SL |
2 | # |
3 | DESTDIR= | |
4 | LIBS= libsa.a ${DESTDIR}/lib/libc.a | |
5 | COPTS= -O -I. -I../h | |
6 | CFLAGS= -DSTANDALONE -DTAHOE ${COPTS} | |
109688a4 MK |
7 | RELOC= 800 |
8 | MTBOOTRELOC=e0000 | |
9 | BOOTRELOC=2e0000 | |
30798539 | 10 | SRCS= sys.c conf.c prf.c machdep.c |
109688a4 MK |
11 | DRIVERS=udc.o cy.o vd.o |
12 | LDT1MBSYSOPT=-T ${MTBOOTRELOC} -x | |
30798539 SL |
13 | LDTSYSOPT=-T ${BOOTRELOC} -x |
14 | LDTOPT= -T ${RELOC} -e _entry -x | |
109688a4 MK |
15 | CFILES= boot.c cat.c conf.c ls.c prf.c srt0.c sys.c ls.c \ |
16 | fastcopy.c devcopy.c cat.c vd.c cy.c | |
17 | SUBDIR= vdformat | |
18 | ALL= boot boot1mb cat ls devcopy fastcopy | |
30798539 | 19 | |
109688a4 | 20 | all: srt0.o libsa.a ${ALL} ${SUBDIR} |
30798539 SL |
21 | |
22 | install: all | |
4e66aa7b | 23 | -mkdir ${DESTDIR}/stand |
30798539 | 24 | install -c -m 644 libsa.a ${DESTDIR}/usr/lib/libsa.a |
109688a4 | 25 | for i in ${ALL}; do \ |
4e66aa7b | 26 | install -m 644 $$i ${DESTDIR}/stand/$$i; \ |
109688a4 MK |
27 | done |
28 | for i in ${SUBDIR}; do \ | |
29 | (cd $$i; make ${MFLAGS} DESTDIR=${DESTDIR} install) \ | |
30 | done | |
96492f3d | 31 | rm -f ${DESTDIR}/boot; cp ${DESTDIR}/stand/boot ${DESTDIR}/boot |
30798539 SL |
32 | |
33 | clean: | |
34 | rm -f ${ALL} *.o *.map *.bak a.out ncy.c libsa.a | |
109688a4 MK |
35 | for i in ${SUBDIR}; do \ |
36 | (cd $$i; make ${MFLAGS} clean) \ | |
37 | done | |
30798539 SL |
38 | |
39 | machdep.o: machdep.c ../tahoe/mtpr.h ../tahoe/mem.h ../tahoe/SYS.h | |
40 | ${CC} -E ${CFLAGS} machdep.c | ${AS} -o machdep.o | |
41 | ||
42 | libsa.a: sys.o conf.o ${DRIVERS} prf.o machdep.o | |
43 | ar crv $@ $? | |
44 | ranlib $@ | |
45 | ||
109688a4 MK |
46 | boot: boot.o bootsrt0.o ${LIBS} |
47 | ld ${LDTSYSOPT} bootsrt0.o boot.o ${LIBS} | |
48 | nm -u a.out | |
49 | size a.out | |
50 | dd if=a.out of=boot ibs=1024 skip=1 | |
51 | -rm -f a.out | |
30798539 | 52 | |
109688a4 MK |
53 | boot1mb: boot.o boot1mbsrt0.o ${LIBS} |
54 | ld ${LDT1MBSYSOPT} boot1mbsrt0.o boot.o ${LIBS} | |
55 | nm -u a.out | |
56 | size a.out | |
57 | dd if=a.out of=boot1mb ibs=1024 skip=1 | |
58 | -rm -f a.out | |
30798539 SL |
59 | |
60 | cat: cat.o srt0.o ${LIBS} | |
61 | ld ${LDTOPT} -o cat -s srt0.o cat.o ${LIBS} | |
62 | ||
63 | devcopy: devcopy.o srt0.o ${LIBS} | |
64 | ld ${LDTOPT} -o devcopy -s srt0.o devcopy.o ${LIBS} | |
65 | ||
66 | fastcopy: fastcopy.o srt0.o ncy.o ${LIBS} | |
67 | ld ${LDTOPT} -o fastcopy -s srt0.o fastcopy.o ncy.o ${LIBS} | |
68 | ||
69 | xpformat: xpformat.o srt0.o ${LIBS} | |
70 | ld ${LDTOPT} -o xpformat srt0.o xpformat.o ${LIBS} | |
71 | ||
109688a4 MK |
72 | vdformat: FRC |
73 | cd vdformat; make ${MFLAGS} | |
74 | ||
75 | FRC: | |
30798539 SL |
76 | |
77 | ls: ls.o srt0.o ${LIBS} | |
78 | ld ${LDTOPT} -o ls -s srt0.o ls.o ${LIBS} | |
79 | ||
30798539 SL |
80 | srt0.o: srt0.c |
81 | ${CC} -E -DRELOC=0x${RELOC} ${CFLAGS} srt0.c | ${AS} -o srt0.o | |
82 | ||
83 | bootsrt0.o: srt0.c | |
109688a4 MK |
84 | ${CC} -E -DRELOC=0x${BOOTRELOC} -DREL ${CFLAGS} srt0.c | \ |
85 | ${AS} -o bootsrt0.o | |
30798539 SL |
86 | |
87 | boot1mbsrt0.o: srt0.c | |
109688a4 MK |
88 | ${CC} -E -DRELOC=0x${MTBOOTRELOC} -DREL ${CFLAGS} srt0.c | \ |
89 | ${AS} -o boot1mbsrt0.o | |
30798539 SL |
90 | |
91 | sfrt0.o: sfrt0.c | |
109688a4 MK |
92 | ${CC} -E -DRELOC=0x${RELOC} -DREL ${CFLAGS} sfrt0.c | \ |
93 | ${AS} -o sfrt0.o | |
30798539 SL |
94 | |
95 | ncy.c: cy.c | |
96 | ln cy.c ncy.c | |
97 | ||
98 | ncy.o: ncy.c | |
99 | ${CC} -DNOBLOCK ${CFLAGS} -c ncy.c | |
100 | ||
101 | print: | |
102 | @pr -f makefile | |
103 | @/usr/ucb/ls -l | pr -f | |
104 | @pr -f *.h *.c *.lst | |
105 | ||
106 | depend: | |
107 | ${CC} -M ${COPTS} ${CFILES} | \ | |
108 | sed -e ':loop' \ | |
109 | -e 's/\.\.\/[^ /]*\/\.\./../' \ | |
110 | -e 't loop' | \ | |
111 | awk ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \ | |
112 | else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \ | |
113 | else rec = rec " " $$2 } } \ | |
114 | END { print rec } ' > makedep | |
115 | echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep | |
116 | echo '$$r makedep' >>eddep | |
117 | echo 'w' >>eddep | |
118 | cp Makefile Makefile.bak | |
119 | ex - Makefile < eddep | |
120 | rm eddep makedep | |
121 | ||
122 | # DO NOT DELETE THIS LINE -- make depend uses it | |
123 | ||
124 | boot.o: boot.c ./../machine/mtpr.h ../h/param.h | |
125 | boot.o: /usr/include/machine/machparam.h ../h/signal.h /usr/include/sys/types.h | |
126 | boot.o: ../h/inode.h ../h/fs.h ../h/vm.h /usr/include/sys/vmparam.h | |
127 | boot.o: /usr/include/machine/vmparam.h /usr/include/sys/vmmac.h | |
128 | boot.o: /usr/include/sys/vmmeter.h /usr/include/sys/vmsystm.h ./saio.h | |
129 | boot.o: ../h/reboot.h /usr/include/a.out.h /usr/include/sys/exec.h | |
130 | cat.o: cat.c | |
131 | conf.o: conf.c ./../machine/pte.h ../h/param.h /usr/include/machine/machparam.h | |
132 | conf.o: ../h/signal.h /usr/include/sys/types.h ../h/inode.h ../h/fs.h ./saio.h | |
133 | ls.o: ls.c ../h/param.h /usr/include/machine/machparam.h ../h/signal.h | |
134 | ls.o: /usr/include/sys/types.h ../h/inode.h ../h/dir.h ../h/fs.h ./saio.h | |
135 | prf.o: prf.c ./../machine/mtpr.h ../h/param.h /usr/include/machine/machparam.h | |
136 | prf.o: ../h/signal.h /usr/include/sys/types.h ./../tahoe/cp.h | |
137 | srt0.o: srt0.c ./../machine/mtpr.h | |
138 | sys.o: sys.c ./../machine/mtpr.h ../h/param.h /usr/include/machine/machparam.h | |
139 | sys.o: ../h/signal.h /usr/include/sys/types.h ../h/inode.h ../h/fs.h ../h/dir.h | |
140 | sys.o: ./saio.h | |
30798539 SL |
141 | ls.o: ls.c ../h/param.h /usr/include/machine/machparam.h ../h/signal.h |
142 | ls.o: /usr/include/sys/types.h ../h/inode.h ../h/dir.h ../h/fs.h ./saio.h | |
143 | fastcopy.o: fastcopy.c | |
144 | devcopy.o: devcopy.c | |
145 | cat.o: cat.c | |
109688a4 MK |
146 | vd.o: vd.c ./../machine/mtpr.h ../h/param.h |
147 | vd.o: /usr/include/machine/machparam.h ../h/signal.h /usr/include/sys/types.h | |
148 | vd.o: ../h/inode.h ../h/fs.h ./../tahoevba/vdreg.h ./../tahoevba/vbaparam.h | |
149 | vd.o: ./saio.h | |
30798539 SL |
150 | cy.o: cy.c ./../machine/pte.h ./../machine/mtpr.h ../h/param.h |
151 | cy.o: /usr/include/machine/machparam.h ../h/signal.h /usr/include/sys/types.h | |
1a9cb196 | 152 | cy.o: ../h/inode.h ../h/fs.h ./saio.h ./cyvar.h ./../tahoevba/vbaparam.h |