ldivmod, uldivmod: fix qdivrem calls
[minix.git] / releasetools / Makefile
blob062e3251a0cf697aea8f7b5cf4d3736cc50c08e7
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+= ${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
29 .endif
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
36 usage:
37 @echo " " >&2
38 @echo "Master Makefile to create new MINIX configuration." >& 2
39 @echo "Root privileges are required." >&2
40 @echo " " >&2
41 @echo "Usage:" >&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
51 @echo " " >&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
55 @echo " " >&2
57 all: services
59 # rebuild the program or system libraries
60 includes:
61 $(MAKE) -C ../ includes
63 depend: includes .gitignore
64 $(MAKE) -C ../ depend
66 .gitignore: Makefile
67 echo $(GEN_FILES) | tr ' ' '\n' >.gitignore
69 services: includes kernel servers .WAIT drivers
71 kernel: includes
72 $(MAKE) -C ../kernel
74 servers: includes
75 $(MAKE) -C ../servers all install
77 drivers: includes servers
78 $(MAKE) -C ../drivers all install
80 # make bootable and place system images
81 bootable:
82 exec su root mkboot bootable ${DESTDIR}
84 hdboot: services .WAIT do-hdboot
86 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
90 @n=0; \
91 for i in ${PROGRAMS}; \
92 do \
93 n=`expr $$n + 1`; \
94 [ "$$n" -ge 10 ] && prefix="mod" || prefix="mod0"; \
95 newname="${DESTDIR}/boot/minix/.temp/$${prefix}$${n}_`basename $$i`"; \
96 ${INSTALL} $$i $$newname; \
97 done
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;\
104 else \
105 ${INSTALL_DIR} ${DESTDIR}/multiboot; \
106 ${INSTALL} ${DESTDIR}/boot/minix/.temp/* ${DESTDIR}/multiboot; \
109 install:
110 ${MAKE} includes services hdboot
112 # download and update NetBSD reference sources.
113 nbsd_fetch:
114 export CVS_RSH=ssh; \
115 export OLDPWD=`pwd`; \
116 echo "retrieving hierarchies from ${NBSD_CVSROOT}"; \
117 IFS=,; \
118 cd ..; \
119 cat releasetools/nbsd_ports | grep -v '^#' | while read port ; \
120 do set $$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" ; \
125 done; \
126 cd $${OLDPWD};
128 nbsd_diff:
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
137 clean:
138 $(MAKE) -C ../kernel $@
139 $(MAKE) -C ../servers $@
140 $(MAKE) -C ../drivers $@
141 rm -rf $(GEN_FILES)
143 cleandepend::
144 $(MAKE) -C ../kernel $@
145 $(MAKE) -C ../servers $@
146 $(MAKE) -C ../drivers $@