xref: /original-bsd/sys/tahoe/stand/Makefile (revision 2301fdfb)
1#
2# Copyright (c) 1987 Regents of the University of California.
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms are permitted
6# provided that the above copyright notice and this paragraph are
7# duplicated in all such forms and that any documentation,
8# advertising materials, and other materials related to such
9# distribution and use acknowledge that the software was developed
10# by the University of California, Berkeley.  The name of the
11# University may not be used to endorse or promote products derived
12# from this software without specific prior written permission.
13# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
16#
17#	@(#)Makefile	7.9 (Berkeley) 07/09/88
18#
19
20RELOC=		800
21MTBOOTRELOC=	e0000
22BOOTRELOC=	e0000
23LDT1MBSYSOPT=	-T ${MTBOOTRELOC} -x
24LDTSYSOPT=	-T ${BOOTRELOC} -x
25LDTOPT=		-T ${RELOC} -e _entry -x
26
27DESTDIR=
28VPATH=	../stand
29LIBS=	libsa.a ${DESTDIR}/lib/libc.a
30COPTS=	-O -I. -I../stand -I../h
31CFLAGS=	-DSTANDALONE -DCOMPAT_42 -DTAHOE -DRELOC=0x${RELOC} ${COPTS}
32SUBDIR=	vdformat
33ALL=	boot cat copy ls
34
35SRCS=	boot.c cat.c conf.c copy.c dev.c getfile.c gets.c ls.c prf.c \
36	srt0.c sys.c vd.c cy.c hdc.c
37DRIVERS=cy.o vd.o hdc.o
38
39#all: srt0.o libsa.a ${ALL} ${SUBDIR}
40all: srt0.o libsa.a ${ALL}
41
42${SUBDIR}: FRC
43	cd $@; make ${MFLAGS}
44
45machdep.o: machdep.c ../tahoe/mtpr.h ../tahoe/mem.h ../tahoe/SYS.h
46	${CC} -E ${CFLAGS} machdep.c | ${AS}  -o machdep.o
47
48libsa.a: conf.o dev.o getfile.o gets.o machdep.o prf.o printn.o sys.o \
49	${DRIVERS}
50	ar crv $@ $?
51	ranlib $@
52
53boot: boot.o bootsrt0.o ${LIBS}
54	ld ${LDTSYSOPT} bootsrt0.o boot.o ${LIBS}
55	nm -u a.out
56	size a.out
57	dd if=a.out of=boot ibs=1024 skip=1
58	-rm -f a.out
59
60boot1mb: boot.o boot1mbsrt0.o ${LIBS}
61	ld ${LDT1MBSYSOPT} boot1mbsrt0.o boot.o ${LIBS}
62	nm -u a.out
63	size a.out
64	dd if=a.out of=boot1mb ibs=1024 skip=1
65	-rm -f a.out
66
67cat: cat.o srt0.o ${LIBS}
68	ld ${LDTOPT} -o $@ -s srt0.o cat.o ${LIBS}
69
70copy: copy.o srt0.o ncy.o ${LIBS}
71	ld ${LDTOPT} -o $@ srt0.o copy.o ncy.o ${LIBS}
72
73xpformat: xpformat.o srt0.o ${LIBS}
74	ld ${LDTOPT} -o $@ srt0.o xpformat.o ${LIBS}
75
76ls: ls.o srt0.o ${LIBS}
77	ld ${LDTOPT} -o $@ -s srt0.o ls.o ${LIBS}
78
79srt0.o: srt0.c
80	${CC} -E ${CFLAGS} srt0.c | ${AS} -o srt0.o
81
82bootsrt0.o: srt0.c
83	${CC} -E -DBOOTRELOC=0x${BOOTRELOC} -DREL ${CFLAGS} srt0.c | \
84	    ${AS} -o bootsrt0.o
85
86boot1mbsrt0.o: srt0.c
87	${CC} -E -DBOOTRELOC=0x${MTBOOTRELOC} -DREL ${CFLAGS} srt0.c | \
88	    ${AS} -o boot1mbsrt0.o
89
90ncy.c: cy.c
91	rm -f ncy.c
92	ln cy.c ncy.c
93
94ncy.o: ncy.c
95	${CC} -DNOBLOCK ${CFLAGS} -c ncy.c
96
97clean: FRC
98	rm -f ${ALL} *.o *.map *.bak a.out ncy.c libsa.a
99	for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} clean); done
100
101depend: ${SRCS} FRC
102	mkdep ${COPTS} ${SRCS}
103	for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} depend); done
104
105install: FRC
106	-mkdir ${DESTDIR}/stand
107	for i in ${ALL}; do \
108		install -o bin -g bin -m 644 $$i ${DESTDIR}/stand/$$i; \
109	done
110	rm -f ${DESTDIR}/boot;
111	cp ${DESTDIR}/stand/boot ${DESTDIR}/boot
112	for i in ${SUBDIR}; do \
113		(cd $$i; make ${MFLAGS} DESTDIR=${DESTDIR} install) \
114	done
115
116tags: ${SRCS} FRC
117	ctags ${SRCS}
118	for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} tags); done
119
120FRC:
121
122# DO NOT DELETE THIS LINE -- mkdep uses it.
123# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
124
125boot.o: boot.c ../machine/mtpr.h ../h/param.h /usr/include/sys/types.h
126boot.o: ../h/signal.h /usr/include/machine/trap.h
127boot.o: /usr/include/machine/machparam.h /usr/include/machine/endian.h
128boot.o: ../h/inode.h ../h/fs.h ../h/vm.h /usr/include/sys/vmparam.h
129boot.o: /usr/include/machine/vmparam.h /usr/include/sys/vmmac.h
130boot.o: /usr/include/sys/vmmeter.h /usr/include/sys/vmsystm.h ../stand/saio.h
131boot.o: ../stand/saioctl.h ../stand/saerrno.h ../h/reboot.h
132boot.o: /usr/include/a.out.h /usr/include/sys/exec.h
133cat.o: ../stand/cat.c
134conf.o: conf.c ../h/param.h /usr/include/sys/types.h ../h/signal.h
135conf.o: /usr/include/machine/trap.h /usr/include/machine/machparam.h
136conf.o: /usr/include/machine/endian.h ../h/inode.h ../h/fs.h ../stand/saio.h
137conf.o: ../stand/saioctl.h ../stand/saerrno.h
138copy.o: ../stand/copy.c
139dev.o: ../stand/dev.c ../h/param.h /usr/include/sys/types.h ../h/signal.h
140dev.o: /usr/include/machine/trap.h /usr/include/machine/machparam.h
141dev.o: /usr/include/machine/endian.h ../h/inode.h ../h/fs.h ../stand/saio.h
142dev.o: ../stand/saioctl.h ../stand/saerrno.h
143getfile.o: ../stand/getfile.c ../h/param.h /usr/include/sys/types.h
144getfile.o: ../h/signal.h /usr/include/machine/trap.h
145getfile.o: /usr/include/machine/machparam.h /usr/include/machine/endian.h
146getfile.o: ../h/inode.h ../h/fs.h ../stand/saio.h ../stand/saioctl.h
147getfile.o: ../stand/saerrno.h
148gets.o: ../stand/gets.c
149ls.o: ../stand/ls.c ../h/param.h /usr/include/sys/types.h ../h/signal.h
150ls.o: /usr/include/machine/trap.h /usr/include/machine/machparam.h
151ls.o: /usr/include/machine/endian.h ../h/inode.h ../h/dir.h ../h/fs.h
152ls.o: ../stand/saio.h ../stand/saioctl.h ../stand/saerrno.h
153prf.o: prf.c ../machine/mtpr.h ../h/param.h /usr/include/sys/types.h
154prf.o: ../h/signal.h /usr/include/machine/trap.h
155prf.o: /usr/include/machine/machparam.h /usr/include/machine/endian.h
156prf.o: ../tahoe/cp.h
157srt0.o: srt0.c ../machine/mtpr.h
158sys.o: ../stand/sys.c ../h/param.h /usr/include/sys/types.h ../h/signal.h
159sys.o: /usr/include/machine/trap.h /usr/include/machine/machparam.h
160sys.o: /usr/include/machine/endian.h ../h/inode.h ../h/fs.h ../h/dir.h
161sys.o: ../h/reboot.h ../stand/saio.h ../stand/saioctl.h ../stand/saerrno.h
162vd.o: vd.c ../machine/mtpr.h ../h/param.h /usr/include/sys/types.h
163vd.o: ../h/signal.h /usr/include/machine/trap.h
164vd.o: /usr/include/machine/machparam.h /usr/include/machine/endian.h
165vd.o: ../h/inode.h ../h/fs.h ../h/buf.h ../h/disklabel.h ../stand/saio.h
166vd.o: ../stand/saioctl.h ../stand/saerrno.h ../tahoevba/vdreg.h
167vd.o: ../tahoevba/vbaparam.h
168cy.o: cy.c ../machine/pte.h ../machine/mtpr.h ../h/param.h
169cy.o: /usr/include/sys/types.h ../h/signal.h /usr/include/machine/trap.h
170cy.o: /usr/include/machine/machparam.h /usr/include/machine/endian.h
171cy.o: ../h/inode.h ../h/fs.h ../stand/saio.h ../stand/saioctl.h
172cy.o: ../stand/saerrno.h ../tahoevba/cyreg.h ../tahoevba/vbaparam.h
173hdc.o: hdc.c /usr/include/machine/mtpr.h ../h/param.h ../h/types.h
174hdc.o: ../h/signal.h /usr/include/machine/trap.h ../h/../machine/machparam.h
175hdc.o: /usr/include/machine/endian.h ../h/inode.h ../h/fs.h ../h/buf.h
176hdc.o: ../h/ioctl.h ../h/ttychars.h ../h/ttydev.h ../h/disklabel.h
177hdc.o: ../stand/saio.h ../stand/saioctl.h ../stand/saerrno.h ../tahoevba/hdc.h
178
179# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
180