VM: abstract datastructures a bit
[minix.git] / releasetools / Makefile
blob5e0b463740b692324a584ccbbca4150dbb80be3d
1 # Makefile for the kernel image.
2 .include <bsd.own.mk>
3 .include "nbsd.config"
5 .include <bsd.own.mk>
6 .include <bsd.sys.mk>
8 u=/usr
9 MDEC= /usr/mdec
10 GEN_FILES= *.bak image kernel *.iso *.iso.gz cdfdimage rootimage src
12 # Specify the programs that are part of the system image.
13 KERNEL= kernel
14 # PROGRAMS are in the order they should be loaded by boot
15 PROGRAMS= \
16 ${NETBSDSRCDIR}/servers/ds/ds \
17 ${NETBSDSRCDIR}/servers/rs/rs \
18 ${NETBSDSRCDIR}/servers/pm/pm \
19 ${NETBSDSRCDIR}/servers/sched/sched \
20 ${NETBSDSRCDIR}/servers/vfs/vfs \
21 ${NETBSDSRCDIR}/drivers/memory/memory \
22 ${NETBSDSRCDIR}/drivers/log/log \
23 ${NETBSDSRCDIR}/drivers/tty/tty \
24 ${NETBSDSRCDIR}/servers/mfs/mfs \
25 ${NETBSDSRCDIR}/servers/vm/vm \
26 ${NETBSDSRCDIR}/servers/pfs/pfs \
27 ${NETBSDSRCDIR}/servers/init/init
29 usage:
30 @echo " " >&2
31 @echo "Master Makefile to create new MINIX configuration." >& 2
32 @echo "Root privileges are required." >&2
33 @echo " " >&2
34 @echo "Usage:" >&2
35 @echo " make includes # Install include files" >&2
36 @echo " make depend # Generate dependency files" >&2
37 @echo " make services # Compile and install all services" >&2
38 @echo " make install # Make image, and install to hard disk" >&2
39 @echo " make hdboot # Make image, and install to hard disk" >&2
40 @echo " make bootable # Make hard disk bootable" >&2
41 @echo " make nbsd_fetch # Download current NetBSD reference sources" >&2
42 @echo " make nbsd_diff # Update minix-port.patch in NetBSD sources" >&2
43 @echo " make clean # Remove all compiler results, except libs" >&2
44 @echo " " >&2
45 @echo "To create a fresh MINIX configuration, try:" >&2
46 @echo " make clean install # new boot image" >&2
47 @echo " make fresh install # new everything" >&2
48 @echo " " >&2
50 all: services
52 # rebuild the program or system libraries
53 includes:
54 $(MAKE) -C .. includes
56 depend: includes .gitignore
57 $(MAKE) -C ../ depend
59 .gitignore: Makefile
60 echo $(GEN_FILES) | tr ' ' '\n' >.gitignore
62 services: includes kernel servers .WAIT drivers
64 kernel: includes
65 $(MAKE) -C ../kernel
67 servers: includes
68 $(MAKE) -C ../servers all install
70 drivers: includes servers
71 $(MAKE) -C ../drivers all install
73 # make bootable and place system images
74 bootable:
75 exec su root mkboot bootable
77 hdboot: services
78 rm -rf ${DESTDIR}/boot/minix/.temp/
79 ${INSTALL_DIR} ${DESTDIR}/boot/minix/.temp
80 # mod_0 is used to make alphabetical order equal to the boot order
81 n=0; \
82 for i in ${PROGRAMS}; \
83 do \
84 n=`expr $$n + 1`; \
85 [ "$$n" -ge 10 ] && prefix="mod" || prefix="mod0"; \
86 newname="${DESTDIR}/boot/minix/.temp/$${prefix}$${n}_`basename $$i`"; \
87 ${INSTALL} $$i $$newname; \
88 done
89 cp ../kernel/kernel ${DESTDIR}/boot/minix/.temp/
90 if [ "${MKINSTALLBOOT}" != "no" ] ; then \
91 ${STRIP} -s ${DESTDIR}/boot/minix/.temp/* ; \
92 gzip ${DESTDIR}/boot/minix/.temp/mod* ; \
93 ${HOST_SH} mkboot $@; \
94 ${HOST_SH} ../commands/update_bootcfg/update_bootcfg.sh;\
95 else \
96 ${INSTALL_DIR} ${DESTDIR}/multiboot; \
97 ${INSTALL} ${DESTDIR}/boot/minix/.temp/* ${DESTDIR}/multiboot; \
100 install:
101 ${MAKE} includes services hdboot
103 # download and update NetBSD reference sources.
104 nbsd_fetch:
105 export CVS_RSH=ssh; \
106 echo "retrieving hierarchies from ${NBSD_CVSROOT}"; \
107 IFS=,; \
108 cat nbsd_ports | grep -v '^#' | while read port ; \
109 do set $$port; \
110 date=$$1; minixpath=$$2; origpath=$$3; \
111 if [ $$# -lt 3 ]; then origpath=$$2; fi; \
112 echo "retrieving $$origpath .."; \
113 cd ${NETBSDSRCDIR} && cvs -q -d ${NBSD_CVSROOT} co -N -D "$$date UTC" -d nbsdsrc "src/$$origpath" ; \
114 done
116 nbsd_diff:
117 find ${NETBSDSRCDIR} -name minix-port.patch | xargs rm
118 cat nbsd_ports | grep -v '^#' | \
119 ( cd ${NETBSDSRCDIR} && awk -F, '{ minixpath=$$2; origpath=$$3; if(NF < 3) { origpath=$$2; } system("sh releasetools/nbsd_diff.sh " \
120 "nbsdsrc/src/"origpath" "minixpath" "minixpath"/minix-port.patch");}' )
121 find ${NETBSDSRCDIR} -name minix-port.patch | xargs wc -l | sort -n
124 # clean up compile results
125 clean:
126 $(MAKE) -C ../kernel $@
127 $(MAKE) -C ../servers $@
128 $(MAKE) -C ../drivers $@
129 rm -rf $(GEN_FILES)
131 cleandepend::
132 $(MAKE) -C ../kernel $@
133 $(MAKE) -C ../servers $@
134 $(MAKE) -C ../drivers $@