include: reduce default stack size
[minix.git] / releasetools / Makefile
blob542c9da7409ba6bacac09b77d8586ffc3cde11bd
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= \
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
35 usage:
36 @echo " " >&2
37 @echo "Master Makefile to create new MINIX configuration." >& 2
38 @echo "Root privileges are required." >&2
39 @echo " " >&2
40 @echo "Usage:" >&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
50 @echo " " >&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
54 @echo " " >&2
56 all: services
58 # rebuild the program or system libraries
59 includes:
60 $(MAKE) -C ../ includes
62 depend: includes .gitignore
63 $(MAKE) -C ../ depend
65 .gitignore: Makefile
66 echo $(GEN_FILES) | tr ' ' '\n' >.gitignore
68 services: includes kernel servers .WAIT drivers
70 kernel: includes
71 $(MAKE) -C ../kernel
73 servers: includes
74 $(MAKE) -C ../servers all install
76 drivers: includes servers
77 $(MAKE) -C ../drivers all install
79 # make bootable and place system images
80 bootable:
81 exec su root mkboot bootable ${DESTDIR}
83 hdboot: services .WAIT do-hdboot
85 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
89 @n=0; \
90 for i in ${PROGRAMS}; \
91 do \
92 n=`expr $$n + 1`; \
93 [ "$$n" -ge 10 ] && prefix="mod" || prefix="mod0"; \
94 newname="${DESTDIR}/boot/minix/.temp/$${prefix}$${n}_`basename $$i`"; \
95 ${INSTALL} $$i $$newname; \
96 done
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;\
103 else \
104 ${INSTALL_DIR} ${DESTDIR}/multiboot; \
105 ${INSTALL} ${DESTDIR}/boot/minix/.temp/* ${DESTDIR}/multiboot; \
108 install:
109 ${MAKE} includes services hdboot
111 # download and update NetBSD reference sources.
112 nbsd_fetch:
113 export CVS_RSH=ssh; \
114 export OLDPWD=`pwd`; \
115 echo "retrieving hierarchies from ${NBSD_CVSROOT}"; \
116 IFS=,; \
117 cd ..; \
118 cat releasetools/nbsd_ports | grep -v '^#' | while read port ; \
119 do set $$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" ; \
124 done; \
125 cd $${OLDPWD};
127 nbsd_diff:
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
136 clean:
137 $(MAKE) -C ../kernel $@
138 $(MAKE) -C ../servers $@
139 $(MAKE) -C ../drivers $@
140 rm -rf $(GEN_FILES)
142 cleandepend::
143 $(MAKE) -C ../kernel $@
144 $(MAKE) -C ../servers $@
145 $(MAKE) -C ../drivers $@