1 # Makefile for the kernel image.
10 GEN_FILES
= *.bak image kernel
*.iso
*.iso.gz cdfdimage rootimage src
12 # LSC detect where were built the objects files
14 .if
"${MAKEOBJDIR:S,${.CURDIR},,}" != ""
15 PROGROOT
:= ${MAKEOBJDIR
:S
,releasetools
,,}
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
35 @echo
"Master Makefile to create new MINIX configuration." >& 2
36 @echo
"Root privileges are required." >&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
49 @echo
"To create a fresh MINIX configuration, try:" >&2
50 @echo
" make clean install # new boot image" >&2
55 # rebuild the program or system libraries
57 ${MAKE} -C ..
/ includes
62 depend
: includes .gitignore
69 ${MAKE} -C ..
/servers
all install
72 ${MAKE} -C ..
/sbin
all install
74 drivers
: libraries servers
75 ${MAKE} -C ..
/drivers
all install
77 services
: kernel servers drivers sbin
80 echo
${GEN_FILES} | tr
' ' '\n' >.gitignore
82 # make bootable and place system images
84 exec su root mkboot bootable
${DESTDIR}
86 hdboot
install: services .WAIT 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
93 for i in
${PROGRAMS}; \
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; \
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
;\
108 ${INSTALL_DIR} ${DESTDIR}/multiboot
; \
109 ${INSTALL_FILE} ${DESTDIR}/boot
/minix
/.temp
/* ${DESTDIR}/multiboot
; \
112 # download and update NetBSD reference sources.
114 export CVS_RSH
=ssh
; \
115 export OLDPWD
=`pwd`; \
116 echo
"retrieving hierarchies from ${NBSD_CVSROOT}"; \
119 cat releasetools
/nbsd_ports | grep
-v
'^#' | while read 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" ; \
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
139 ${MAKE} -C ..
/kernel
$@
140 ${MAKE} -C ..
/servers
$@
141 ${MAKE} -C ..
/drivers
$@
146 ${MAKE} -C ..
/kernel
$@
147 ${MAKE} -C ..
/servers
$@
148 ${MAKE} -C ..
/drivers
$@