1 # Makefile for the kernel image.
10 GEN_FILES
= *.bak image kernel
*.iso
*.iso.gz cdfdimage rootimage src
12 # Specify the programs that are part of the system image.
14 # PROGRAMS are in the order they should be loaded by boot
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
31 @echo
"Master Makefile to create new MINIX configuration." >& 2
32 @echo
"Root privileges are required." >&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
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
52 # rebuild the program or system libraries
54 $(MAKE
) -C .. includes
56 depend
: includes .gitignore
60 echo
$(GEN_FILES
) | tr
' ' '\n' >.gitignore
62 services
: includes kernel servers .WAIT drivers
68 $(MAKE
) -C ..
/servers
all install
70 drivers
: includes servers
71 $(MAKE
) -C ..
/drivers
all install
73 # make bootable and place system images
75 exec su root mkboot bootable
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
82 for i in
${PROGRAMS}; \
85 [ "$$n" -ge
10 ] && prefix="mod" ||
prefix="mod0"; \
86 newname
="${DESTDIR}/boot/minix/.temp/$${prefix}$${n}_`basename $$i`"; \
87 ${INSTALL} $$i $$newname; \
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
;\
96 ${INSTALL_DIR} ${DESTDIR}/multiboot
; \
97 ${INSTALL} ${DESTDIR}/boot
/minix
/.temp
/* ${DESTDIR}/multiboot
; \
101 ${MAKE} includes services hdboot
103 # download and update NetBSD reference sources.
105 export CVS_RSH
=ssh
; \
106 echo
"retrieving hierarchies from ${NBSD_CVSROOT}"; \
108 cat nbsd_ports | grep
-v
'^#' | while read 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" ; \
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
126 $(MAKE
) -C ..
/kernel
$@
127 $(MAKE
) -C ..
/servers
$@
128 $(MAKE
) -C ..
/drivers
$@
132 $(MAKE
) -C ..
/kernel
$@
133 $(MAKE
) -C ..
/servers
$@
134 $(MAKE
) -C ..
/drivers
$@