make vfs & filesystems use failable copying
[minix3.git] / releasetools / Makefile
blobe96e418066d9dd4776dd2bbf2ca7df5d6e60bf9c
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 # LSC detect where were built the objects files
13 PROGROOT:= ..
14 .if "${MAKEOBJDIR:S,${.CURDIR},,}" != ""
15 PROGROOT:= ${MAKEOBJDIR:S,releasetools,,}
16 .endif
18 # Specify the programs that are part of the system image.
19 KERNEL= ${PROGROOT}/kernel/kernel
20 # PROGRAMS are in the order they should be loaded by boot
21 PROGRAMS+= ${PROGROOT}/servers/ds/ds
22 PROGRAMS+= ${PROGROOT}/servers/rs/rs
23 PROGRAMS+= ${PROGROOT}/servers/pm/pm
24 PROGRAMS+= ${PROGROOT}/servers/sched/sched
25 PROGRAMS+= ${PROGROOT}/servers/vfs/vfs
26 PROGRAMS+= ${PROGROOT}/drivers/memory/memory
27 PROGRAMS+= ${PROGROOT}/drivers/tty/tty
28 PROGRAMS+= ${PROGROOT}/servers/mfs/mfs
29 PROGRAMS+= ${PROGROOT}/servers/vm/vm
30 PROGRAMS+= ${PROGROOT}/servers/pfs/pfs
31 PROGRAMS+= ${PROGROOT}/sbin/init/init
33 usage:
34 @echo " " >&2
35 @echo "Master Makefile to create new MINIX configuration." >& 2
36 @echo "Root privileges are required." >&2
37 @echo " " >&2
38 @echo "Usage:" >&2
39 @echo " make includes # Install include files" >&2
40 @echo " make depend # Generate dependency files" >&2
41 @echo " make services # Compile and install all services" >&2
42 @echo " make install # Make image, and install to hard disk" >&2
43 @echo " make hdboot # Make image, and install to hard disk" >&2
44 @echo " make bootable # Make hard disk bootable" >&2
45 @echo " make nbsd_fetch # Download current NetBSD reference sources" >&2
46 @echo " make nbsd_diff # Update minix-port.patch in NetBSD sources" >&2
47 @echo " make clean # Remove all compiler results, except libs" >&2
48 @echo " " >&2
49 @echo "To create a fresh MINIX configuration, try:" >&2
50 @echo " make clean install # new boot image" >&2
51 @echo " " >&2
53 all: services
55 # rebuild the program or system libraries
56 includes:
57 ${MAKE} -C ../ includes
59 libraries: includes
60 ${MAKE} -C ../ do-lib
62 depend: includes .gitignore
63 ${MAKE} -C ../ depend
65 kernel: libraries
66 ${MAKE} -C ../kernel
68 servers: libraries
69 ${MAKE} -C ../servers all install
71 sbin: libraries
72 ${MAKE} -C ../sbin all install
74 drivers: libraries servers
75 ${MAKE} -C ../drivers all install
77 services: kernel servers drivers sbin
79 .gitignore: Makefile
80 echo ${GEN_FILES} | tr ' ' '\n' >.gitignore
82 # make bootable and place system images
83 bootable:
84 exec su root mkboot bootable ${DESTDIR}
86 hdboot install: services .WAIT do-hdboot
88 do-hdboot:
89 @rm -rf ${DESTDIR}/boot/minix/.temp/
90 ${INSTALL_DIR} ${DESTDIR}/boot/minix/.temp
91 # mod_0 is used to make alphabetical order equal to the boot order
92 @n=0; \
93 for i in ${PROGRAMS}; \
94 do \
95 n=`expr $$n + 1`; \
96 [ "$$n" -ge 10 ] && prefix="mod" || prefix="mod0"; \
97 newname="${DESTDIR}/boot/minix/.temp/$${prefix}$${n}_`basename $$i`"; \
98 ${INSTALL_FILE} $$i $$newname; \
99 echo ${INSTALL_FILE} $$i $$newname; \
100 done
101 @cp ${PROGROOT}/kernel/kernel ${DESTDIR}/boot/minix/.temp/
102 @if [ "${MKINSTALLBOOT:Uno}" != "no" ] ; then \
103 ${STRIP} -s ${DESTDIR}/boot/minix/.temp/* ; \
104 gzip ${DESTDIR}/boot/minix/.temp/mod* ; \
105 ${HOST_SH} mkboot hdboot ${DESTDIR}; \
106 ${HOST_SH} ../commands/update_bootcfg/update_bootcfg.sh;\
107 else \
108 ${INSTALL_DIR} ${DESTDIR}/multiboot; \
109 ${INSTALL_FILE} ${DESTDIR}/boot/minix/.temp/* ${DESTDIR}/multiboot; \
112 # download and update NetBSD reference sources.
113 nbsd_fetch:
114 export CVS_RSH=ssh; \
115 export OLDPWD=`pwd`; \
116 echo "retrieving hierarchies from ${NBSD_CVSROOT}"; \
117 IFS=,; \
118 cd ..; \
119 cat releasetools/nbsd_ports | grep -v '^#' | while read port ; \
120 do set $$port; \
121 date=$$1; minixpath=$$2; origpath=$$3; \
122 if [ $$# -lt 3 ]; then origpath=$$2; fi; \
123 echo "retrieving $$origpath .."; \
124 cvs -q -d ${NBSD_CVSROOT} co -N -D "$$date UTC" -d nbsdsrc "src/$$origpath" ; \
125 done; \
126 cd $${OLDPWD};
128 nbsd_diff:
129 find .. -name minix-port.patch | xargs rm
130 cat nbsd_ports | grep -v '^#' | \
131 ( cd .. && awk -F, '{ minixpath=$$2; origpath=$$3; if(NF < 3) { origpath=$$2; } system("sh releasetools/nbsd_diff.sh " \
132 "nbsdsrc/src/"origpath" "minixpath" "minixpath"/minix-port.patch");}' )
133 find .. -name minix-port.patch | xargs wc -l | sort -n
136 # clean up compile results
137 clean:
138 ${MAKE} -C ../lib $@
139 ${MAKE} -C ../kernel $@
140 ${MAKE} -C ../servers $@
141 ${MAKE} -C ../drivers $@
142 rm -rf ${GEN_FILES}
144 cleandir:
145 ${MAKE} -C ../lib $@
146 ${MAKE} -C ../kernel $@
147 ${MAKE} -C ../servers $@
148 ${MAKE} -C ../drivers $@