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
22 ${PROGROOT}/servers
/ds
/ds \
23 ${PROGROOT}/servers
/rs
/rs \
24 ${PROGROOT}/servers
/pm
/pm \
25 ${PROGROOT}/servers
/sched
/sched \
26 ${PROGROOT}/servers
/vfs
/vfs \
27 ${PROGROOT}/drivers
/memory
/memory \
28 ${PROGROOT}/drivers
/log
/log \
29 ${PROGROOT}/drivers
/tty
/tty \
30 ${PROGROOT}/servers
/mfs
/mfs \
31 ${PROGROOT}/servers
/vm
/vm \
32 ${PROGROOT}/servers
/pfs
/pfs \
33 ${PROGROOT}/servers
/init
/init
37 @echo
"Master Makefile to create new MINIX configuration." >& 2
38 @echo
"Root privileges are required." >&2
41 @echo
" make includes # Install include files" >&2
42 @echo
" make depend # Generate dependency files" >&2
43 @echo
" make services # Compile and install all services" >&2
44 @echo
" make install # Make image, and install to hard disk" >&2
45 @echo
" make hdboot # Make image, and install to hard disk" >&2
46 @echo
" make bootable # Make hard disk bootable" >&2
47 @echo
" make nbsd_fetch # Download current NetBSD reference sources" >&2
48 @echo
" make nbsd_diff # Update minix-port.patch in NetBSD sources" >&2
49 @echo
" make clean # Remove all compiler results, except libs" >&2
51 @echo
"To create a fresh MINIX configuration, try:" >&2
52 @echo
" make clean install # new boot image" >&2
53 @echo
" make fresh install # new everything" >&2
58 # rebuild the program or system libraries
60 $(MAKE
) -C ..
/ includes
62 depend
: includes .gitignore
66 echo
$(GEN_FILES
) | tr
' ' '\n' >.gitignore
68 services
: includes kernel servers .WAIT drivers
74 $(MAKE
) -C ..
/servers
all install
76 drivers
: includes servers
77 $(MAKE
) -C ..
/drivers
all install
79 # make bootable and place system images
81 exec su root mkboot bootable
${DESTDIR}
83 hdboot
: services .WAIT do-hdboot
86 @
rm -rf
${DESTDIR}/boot
/minix
/.temp
/
87 ${INSTALL_DIR} ${DESTDIR}/boot
/minix
/.temp
88 # mod_0 is used to make alphabetical order equal to the boot order
90 for i in
${PROGRAMS}; \
93 [ "$$n" -ge
10 ] && prefix="mod" ||
prefix="mod0"; \
94 newname
="${DESTDIR}/boot/minix/.temp/$${prefix}$${n}_`basename $$i`"; \
95 ${INSTALL} $$i $$newname; \
97 @cp
${PROGROOT}/kernel
/kernel
${DESTDIR}/boot
/minix
/.temp
/
98 @if
[ "${MKINSTALLBOOT:Uno}" != "no" ] ; then \
99 ${STRIP} -s
${DESTDIR}/boot
/minix
/.temp
/* ; \
100 gzip
${DESTDIR}/boot
/minix
/.temp
/mod
* ; \
101 ${HOST_SH} mkboot hdboot
${DESTDIR}; \
102 ${HOST_SH} ..
/commands
/update_bootcfg
/update_bootcfg.sh
;\
104 ${INSTALL_DIR} ${DESTDIR}/multiboot
; \
105 ${INSTALL} ${DESTDIR}/boot
/minix
/.temp
/* ${DESTDIR}/multiboot
; \
109 ${MAKE} includes services hdboot
111 # download and update NetBSD reference sources.
113 export CVS_RSH
=ssh
; \
114 export OLDPWD
=`pwd`; \
115 echo
"retrieving hierarchies from ${NBSD_CVSROOT}"; \
118 cat releasetools
/nbsd_ports | grep
-v
'^#' | while read port
; \
120 date
=$$1; minixpath
=$$2; origpath
=$$3; \
121 if
[ $$# -lt 3 ]; then origpath=$$2; fi; \
122 echo
"retrieving $$origpath .."; \
123 cvs
-q
-d
${NBSD_CVSROOT} co -N
-D
"$$date UTC" -d nbsdsrc
"src/$$origpath" ; \
128 find ..
-name minix-port.patch | xargs
rm
129 cat nbsd_ports | grep
-v
'^#' | \
130 ( cd ..
&& awk
-F
, '{ minixpath=$$2; origpath=$$3; if(NF < 3) { origpath=$$2; } system("sh releasetools/nbsd_diff.sh " \
131 "nbsdsrc/src/"origpath" "minixpath" "minixpath"/minix-port.patch");}' )
132 find ..
-name minix-port.patch | xargs wc
-l |
sort -n
135 # clean up compile results
137 $(MAKE
) -C ..
/kernel
$@
138 $(MAKE
) -C ..
/servers
$@
139 $(MAKE
) -C ..
/drivers
$@
143 $(MAKE
) -C ..
/kernel
$@
144 $(MAKE
) -C ..
/servers
$@
145 $(MAKE
) -C ..
/drivers
$@