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 .if
${MACHINE_ARCH} == "i386"
28 PROGRAMS
+= ${PROGROOT}/drivers
/log
/log
30 PROGRAMS
+= ${PROGROOT}/drivers
/tty
/tty
31 PROGRAMS
+= ${PROGROOT}/servers
/mfs
/mfs
32 PROGRAMS
+= ${PROGROOT}/servers
/vm
/vm
33 PROGRAMS
+= ${PROGROOT}/servers
/pfs
/pfs
34 PROGRAMS
+= ${PROGROOT}/servers
/init
/init
38 @echo
"Master Makefile to create new MINIX configuration." >& 2
39 @echo
"Root privileges are required." >&2
42 @echo
" make includes # Install include files" >&2
43 @echo
" make depend # Generate dependency files" >&2
44 @echo
" make services # Compile and install all services" >&2
45 @echo
" make install # Make image, and install to hard disk" >&2
46 @echo
" make hdboot # Make image, and install to hard disk" >&2
47 @echo
" make bootable # Make hard disk bootable" >&2
48 @echo
" make nbsd_fetch # Download current NetBSD reference sources" >&2
49 @echo
" make nbsd_diff # Update minix-port.patch in NetBSD sources" >&2
50 @echo
" make clean # Remove all compiler results, except libs" >&2
52 @echo
"To create a fresh MINIX configuration, try:" >&2
53 @echo
" make clean install # new boot image" >&2
54 @echo
" make fresh install # new everything" >&2
59 # rebuild the program or system libraries
61 $(MAKE
) -C ..
/ includes
63 depend
: includes .gitignore
67 echo
$(GEN_FILES
) | tr
' ' '\n' >.gitignore
69 services
: includes kernel servers .WAIT drivers
75 $(MAKE
) -C ..
/servers
all install
77 drivers
: includes servers
78 $(MAKE
) -C ..
/drivers
all install
80 # make bootable and place system images
82 exec su root mkboot bootable
${DESTDIR}
84 hdboot
: services .WAIT do-hdboot
87 @
rm -rf
${DESTDIR}/boot
/minix
/.temp
/
88 ${INSTALL_DIR} ${DESTDIR}/boot
/minix
/.temp
89 # mod_0 is used to make alphabetical order equal to the boot order
91 for i in
${PROGRAMS}; \
94 [ "$$n" -ge
10 ] && prefix="mod" ||
prefix="mod0"; \
95 newname
="${DESTDIR}/boot/minix/.temp/$${prefix}$${n}_`basename $$i`"; \
96 ${INSTALL} $$i $$newname; \
98 @cp
${PROGROOT}/kernel
/kernel
${DESTDIR}/boot
/minix
/.temp
/
99 @if
[ "${MKINSTALLBOOT:Uno}" != "no" ] ; then \
100 ${STRIP} -s
${DESTDIR}/boot
/minix
/.temp
/* ; \
101 gzip
${DESTDIR}/boot
/minix
/.temp
/mod
* ; \
102 ${HOST_SH} mkboot hdboot
${DESTDIR}; \
103 ${HOST_SH} ..
/commands
/update_bootcfg
/update_bootcfg.sh
;\
105 ${INSTALL_DIR} ${DESTDIR}/multiboot
; \
106 ${INSTALL} ${DESTDIR}/boot
/minix
/.temp
/* ${DESTDIR}/multiboot
; \
110 ${MAKE} includes services hdboot
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
138 $(MAKE
) -C ..
/kernel
$@
139 $(MAKE
) -C ..
/servers
$@
140 $(MAKE
) -C ..
/drivers
$@
144 $(MAKE
) -C ..
/kernel
$@
145 $(MAKE
) -C ..
/servers
$@
146 $(MAKE
) -C ..
/drivers
$@