Remove building with NOCRYPTO option
[minix3.git] / etc / Makefile
blob9096b9c3148442bdccaad4403b4bc0d7ccbdd47a
1 # $NetBSD: Makefile,v 1.424 2015/08/31 06:08:07 uebayasi Exp $
2 # from: @(#)Makefile 8.7 (Berkeley) 5/25/95
4 # Environment variables without default values:
5 # DESTDIR must be set before anything in this file will work.
6 # RELEASEDIR is where the tarred up stuff for a snapshot or
7 # release will be placed.
9 # Environment variables with default values:
10 # LOCALTIME will set the default local time for the system you
11 # build; it determines what /etc/localtime is symlink'd to.
12 # KERNSRCDIR points to kernel source; it is set by default to ../sys,
13 # but can be overridden.
14 # KERNOBJDIR is the kernel build directory, it defaults to
15 # ${KERNSRCDIR}/arch/${MACHINE}/compile, but can be overridden.
16 # KERNCONFDIR is where the configuration files for kernels are found;
17 # default is ${KERNSRCDIR}/arch/${MACHINE}/conf but can be overridden.
18 # MKCRYPTO; if not `no', install crypto-related configuration
19 # MKPOSTFIX; if not `no', install postfix configuration
20 # MKUNPRIVED; if not `no', allow non-root installs.
21 # MKUPDATE; if not `no', don't do a 'make clean' before kernel compile
23 # Targets:
24 # distribution: makes a full NetBSD distribution in DESTDIR. If
25 # INSTALL_DONE is set, it will not do a `make install.'
26 # if DISTRIBUTION_DONE is set, it will not do anything.
27 # distrib-dirs: creates an empty NetBSD directory tree in DESTDIR.
28 # Called by distribution.
29 # snapshot: calls distribution, above, and then tars up the files
30 # into a release(7) format in RELEASEDIR/${RELEASEMACHINEDIR}.
31 # Any port-dependent stuff for this target is found in
32 # etc.${MACHINE}/Makefile.inc.
33 # release: a synonym for `snapshot'
36 # For MK* vars
37 .include <bsd.own.mk>
39 .include <bsd.sys.mk> # for HOST_SH, TOOL_AWK, ...
40 .include <bsd.kernobj.mk> # For KERNSRCDIR, KERNOBJDIR, ...
41 .include <bsd.endian.mk> # For TARGET_ENDIANNESS
43 .MAKEOVERRIDES+= USETOOLS
45 TZDIR= /usr/share/zoneinfo
46 LOCALTIME?= UTC
47 CKSUM?= ${TOOL_CKSUM}
48 MAKESUMS= MAKE=${MAKE:Q} CKSUM=${CKSUM:Q} ${HOST_SH} ${NETBSDSRCDIR}/distrib/sets/makesums
49 DISTRIBVER!= ${HOST_SH} ${NETBSDSRCDIR}/sys/conf/osrelease.sh
51 GZIP_FLAGS= -9 ${GZIP_N_FLAG}
53 # Flags for creating ISO CDROM image
54 # mkisofs is expected to be in $PATH, install via pkgsrc/sysutils/cdrtools
55 # Note: At least mkisofs 2.0 should be used.
57 .if !defined(__MINIX)
58 # LSC: We do not yet support iso creation anyway, then do not try to find it.
59 .if !defined(MKISOFS)
60 MKISOFS!= (which mkisofs || echo true) 2>/dev/null
61 .endif
62 DISTRIBREV!= ${HOST_SH} ${KERNSRCDIR}/conf/osrelease.sh -s
63 # ISO 9660 volume ID. Note that this can only contain [A-Z0-9_].
64 ISO_VOLID!= echo NETBSD_${DISTRIBREV} | tr a-z A-Z
65 MKISOFS_FLAGS+= -J -l -hide-joliet-trans-tbl -r -T \
66 -V ${ISO_VOLID} \
67 -publisher "The NetBSD Project" \
68 -m "${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/cdrom"
69 .if ${MKISOFS_FLAGS:N-v}
70 MKISOFS_FLAGS+= -quiet
71 .endif
72 .endif # !defined(__MINIX)
75 # MD Makefile.inc may append MD targets to BIN[123]. Make sure all
76 # are empty, to preserve the old semantics of setting them below with "+=".
78 BIN1=
79 BIN2=
80 BIN3=
82 # Directories to build in ${RELEASEDIR}/${RELEASEMACHINEDIR}.
83 # MD Makefile.inc files can add to this.
84 # NOTE: Parent directories must be listed before subdirectories.
86 INSTALLATION_DIRS= binary binary/sets binary/kernel installation
88 .if exists(etc.${RELEASEMACHINE}/Makefile.inc)
89 .include "etc.${RELEASEMACHINE}/Makefile.inc"
90 .endif
92 # -rw-r--r--
93 BINOWN= root
94 BINGRP= wheel
95 UTMPGRP= utmp
96 .if defined(__MINIX)
97 BIN1+= \
99 gettytab \
100 man.conf \
102 passwd.conf \
103 protocols rc rc.cd rc.subr \
104 rc.shutdown services shells \
105 syslog.conf
106 # MINIX-only files:
107 BIN1+= boot.cfg.default rc.minix \
108 rs.lwip rs.single termcap utmp
109 .else
110 BIN1+= bootptab changelist csh.cshrc csh.login \
111 csh.logout daily daily.conf dm.conf envsys.conf floppytab ftpchroot \
112 ftpusers gettytab gpio.conf group hosts hosts.lpd inetd.conf \
113 locate.conf login.conf mailer.conf man.conf monthly monthly.conf \
114 mrouted.conf named.conf netconfig networks newsyslog.conf \
115 nsswitch.conf ntp.conf passwd.conf pkgpath.conf phones printcap \
116 profile protocols rbootd.conf rc rc.conf rc.local rc.subr \
117 rc.shutdown remote rpc security security.conf services shells \
118 shrc sysctl.conf syslog.conf weekly weekly.conf wscons.conf
120 # Use machine-specific disktab if it exists, or the MI one otherwise
121 .if exists(etc.${MACHINE}/disktab)
122 BIN1+= etc.${MACHINE}/disktab
123 .else
124 BIN1+= disktab
125 .endif
127 .if exists(etc.${MACHINE}/ld.so.conf) && empty(MACHINE_ARCH:M*arm*hf*)
128 BIN1+= etc.${MACHINE}/ld.so.conf
129 .endif
131 .if exists(etc.${MACHINE}/ttyaction)
132 BIN1+= etc.${MACHINE}/ttyaction
133 .endif
135 # -rw-rw-r--
136 BIN2+= motd
137 FILESBUILD_motd= YES
139 # -rw-------
140 BIN3+= hosts.equiv
141 .endif # defined(__MINIX)
143 SYSPKG= etc
144 ETC_PKG=-T etc_pkg
145 BASE_PKG=-T base_pkg
146 ETC_INSTALL_FILE=cd ${.CURDIR} && ${INSTALL_FILE} ${ETC_PKG}
147 ETC_INSTALL_OBJ_FILE=cd ${.OBJDIR} && ${INSTALL_FILE} ${ETC_PKG}
149 .if ${TARGET_ENDIANNESS} == "1234"
150 PWD_MKDB_ENDIAN= -L
151 .elif ${TARGET_ENDIANNESS} == "4321"
152 PWD_MKDB_ENDIAN= -B
153 .else
154 PWD_MKDB_ENDIAN=
155 .endif
158 # distribution --
159 # Build a distribution
161 distribution: .PHONY .MAKE check_DESTDIR distrib-dirs
162 .if !defined(DISTRIBUTION_DONE)
163 .if !defined(INSTALL_DONE)
164 ${MAKEDIRTARGET} ${NETBSDSRCDIR} include _DISTRIB=
165 ${MAKEDIRTARGET} ${NETBSDSRCDIR} install _DISTRIB=
166 .endif # !INSTALL_DONE
167 ${MAKEDIRTARGET} . install-etc-files
168 . if ${MKX11} != "no"
169 ${MAKEDIRTARGET} ${NETBSDSRCDIR}/external/mit/xorg distribution
170 . endif
171 . if ${MKEXTSRC} != "no"
172 ${MAKEDIRTARGET} ${NETBSDSRCDIR}/extsrc distribution
173 . endif
174 ${MAKEDIRTARGET} ${NETBSDSRCDIR}/distrib/sets makesetfiles
175 .endif # !DISTRIBUTION_DONE
178 .if !defined(__MINIX)
179 # motd is copied from a different ${MOTD_SOURCE} depending on DISTRIBVER
181 .if !empty(DISTRIBVER:M*.99.*)
182 MOTD_SOURCE= motd.current
183 .elif !empty(DISTRIBVER:M*BETA*)
184 MOTD_SOURCE= motd.beta
185 .elif !empty(DISTRIBVER:M*RC*)
186 MOTD_SOURCE= motd.rc
187 .elif !empty(DISTRIBVER:M*STABLE*)
188 MOTD_SOURCE= motd.stable
189 .else
190 MOTD_SOURCE= motd.default
191 .endif
192 CLEANFILES+= motd
193 motd: ${.CURDIR}/${MOTD_SOURCE} ${_NETBSD_VERSION_DEPENDS}
194 ${_MKTARGET_CREATE}
195 ${HOST_INSTALL_FILE} ${.CURDIR}/${MOTD_SOURCE} ${.TARGET}
196 .endif # !defined(__MINIX)
198 CLEANFILES+= MAKEDEV
199 .if !defined(__MINIX)
200 MAKEDEV_MACHINE=${"${MACHINE_CPU}" == "aarch64":?${MACHINE_CPU}:${MACHINE}}
201 MAKEDEV: ${.CURDIR}/MAKEDEV.awk ${.CURDIR}/MAKEDEV.tmpl \
202 ${.CURDIR}/etc.${MAKEDEV_MACHINE}/MAKEDEV.conf
203 ${_MKTARGET_CREATE}
204 MACHINE=${MAKEDEV_MACHINE:Q} MACHINE_ARCH=${MACHINE_ARCH:Q} \
205 NETBSDSRCDIR=${NETBSDSRCDIR:Q} \
206 ${TOOL_AWK} -f ${.CURDIR}/MAKEDEV.awk ${.CURDIR}/MAKEDEV.tmpl \
207 > ${.TARGET}
208 .else
209 MAKEDEV: .PHONY
210 if [ ${MKUNPRIVED} != "yes" ]; then \
211 cd ${DESTDIR}/dev && sh ${NETBSDSRCDIR}/minix/commands/MAKEDEV/MAKEDEV.sh -s; \
212 else \
213 sh ${NETBSDSRCDIR}/minix/commands/MAKEDEV/MAKEDEV.sh -m -s >> ${DESTDIR}/METALOG; \
215 .endif # !defined(__MINIX)
217 .include "${NETBSDSRCDIR}/etc/Makefile.params"
218 CLEANFILES+= etc-release
219 etc-release: .EXEC .MAKE
220 ${_MKTARGET_CREATE}
221 @( echo "NetBSD ${DISTRIBVER}/${MACHINE}"; \
222 echo ; \
223 cat ${NETBSDSRCDIR}/sys/conf/copyright; \
224 echo ; \
225 echo "Build information:"; \
226 printf "%20s %s\n" "Build date" "$$(date -u)"; \
227 printf "%20s %s\n" "Built by" "$${USER-root}@$$(hostname)"; \
228 if [ -n "${BUILDID}" ]; then \
229 printf "%20s %s\n" "Build ID" "${BUILDID}" ; \
230 fi ; \
231 if [ -n "${BUILDINFO}" ]; then \
232 echo ; \
233 info="$$(printf "%b" ${BUILDINFO:Q})" ; \
234 printf "%s\n" "$${info}" \
235 | ${TOOL_SED} -e 's/^/ /' ; \
236 fi ; \
237 echo ; \
238 echo "Build settings:"; \
239 echo ; \
240 ${PRINT_PARAMS} ; \
241 ) >${.OBJDIR}/${.TARGET}
243 install-etc-release: .PHONY etc-release
244 ${_MKMSG_INSTALL} etc/release
245 ${ETC_INSTALL_OBJ_FILE} -o ${BINOWN} -g ${BINGRP} -m 444 \
246 etc-release ${DESTDIR}/etc/release
249 FILESDIR= /etc
250 CONFIGFILES=
251 CONFIGSYMLINKS=
253 .for file in ${BIN1}
254 CONFIGFILES+= ${file}
255 FILESMODE_${file:T}= 644
256 .endfor
258 .for file in ${BIN2}
259 CONFIGFILES+= ${file}
260 FILESMODE_${file:T}= 664
261 .endfor
263 .for file in ${BIN3}
264 CONFIGFILES+= ${file}
265 FILESMODE_${file:T}= 600
266 .endfor
268 .if (${MKPOSTFIX} != "no")
269 CONFIGFILES+= aliases
270 FILESDIR_aliases= /etc/mail
271 FILESMODE_aliases= 644
272 .endif
274 .if !defined(__MINIX)
275 CONFIGFILES+= MAKEDEV.local
276 FILESDIR_MAKEDEV.local= /dev
277 FILESMODE_MAKEDEV.local=${BINMODE}
279 CONFIGFILES+= crontab
280 FILESDIR_crontab= /var/cron/tabs
281 FILESNAME_crontab= root
282 FILESMODE_crontab= 600
284 CONFIGFILES+= minfree
285 FILESDIR_minfree= /var/crash
286 FILESMODE_minfree= 600
288 CONFIGSYMLINKS+= ${TZDIR}/${LOCALTIME} /etc/localtime \
289 /usr/sbin/rmt /etc/rmt
290 .else
291 CONFIGSYMLINKS+= \
292 /usr/log /var/log \
293 /usr/tmp /var/tmp \
294 /proc/mounts /etc/mtab \
295 /usr/service/asr /service/asr
297 .endif # !defined(__MINIX)
300 # install-etc-files --
301 # Install etc (config) files; not performed by "make build"
303 install-etc-files: .PHONY .MAKE check_DESTDIR MAKEDEV
304 ${_MKMSG_INSTALL} ${DESTDIR}/etc/master.passwd
305 ${ETC_INSTALL_FILE} -o root -g wheel -m 600 \
306 master.passwd ${DESTDIR}/etc
307 ${TOOL_PWD_MKDB} -p ${PWD_MKDB_ENDIAN} -d ${DESTDIR}/ \
308 ${DESTDIR}/etc/master.passwd
309 .if ${MKUNPRIVED} != "no"
311 mode=0600; \
312 for metaent in spwd.db passwd pwd.db; do \
313 echo "./etc/$${metaent} type=file mode=$${mode} uname=root gname=wheel tags=etc_pkg"; \
314 mode=0644; \
315 done; \
316 ) | ${METALOG.add}
317 .endif # MKUNPRIVED != no
318 .if defined(__MINIX)
319 # BJG: Unsafe (i.e. user-editable) files for Minix
320 .for owner group mode sdir tdir files in \
321 ${BINOWN} ${BINGRP} ${BINMODE} ${NETBSDSRCDIR}/etc/ ${DESTDIR}/etc/ group \
322 ${BINOWN} ${BINGRP} ${BINMODE} ${NETBSDSRCDIR}/etc/ ${DESTDIR}/etc/ hostname.file \
323 ${BINOWN} ${BINGRP} ${BINMODE} ${NETBSDSRCDIR}/etc/ ${DESTDIR}/etc/ hosts \
324 ${BINOWN} ${BINGRP} ${BINMODE} ${NETBSDSRCDIR}/etc/ ${DESTDIR}/etc/ inetd.conf \
325 ${BINOWN} ${BINGRP} ${BINMODE} ${NETBSDSRCDIR}/etc/ ${DESTDIR}/etc/ mk.conf \
326 ${BINOWN} ${BINGRP} ${BINMODE} ${NETBSDSRCDIR}/etc/ ${DESTDIR}/etc/ motd \
327 ${BINOWN} ${BINGRP} ${BINMODE} ${NETBSDSRCDIR}/etc/ ${DESTDIR}/etc/ named.conf \
328 ${BINOWN} ${BINGRP} ${BINMODE} ${NETBSDSRCDIR}/etc/ ${DESTDIR}/etc/ nsswitch.conf \
329 ${BINOWN} ${BINGRP} ${BINMODE} ${NETBSDSRCDIR}/etc/ ${DESTDIR}/etc/ rc.conf \
330 ${BINOWN} ${BINGRP} ${BINMODE} ${NETBSDSRCDIR}/etc/ ${DESTDIR}/etc/ shrc \
331 ${BINOWN} ${BINGRP} ${BINMODE} ${NETBSDSRCDIR}/etc/ ${DESTDIR}/etc/ csh.cshrc \
332 ${BINOWN} ${BINGRP} ${BINMODE} ${NETBSDSRCDIR}/etc/ ${DESTDIR}/etc/ csh.login \
333 ${BINOWN} ${BINGRP} ${BINMODE} ${NETBSDSRCDIR}/etc/ ${DESTDIR}/etc/ csh.logout \
334 ${BINOWN} ${BINGRP} ${BINMODE} ${NETBSDSRCDIR}/etc/ ${DESTDIR}/etc/ profile
335 ${_MKMSG_INSTALL} ${DESTDIR}${tdir}${files:T}
336 if [ ! -e ${tdir} ]; then \
337 ${INSTALL_DIR} ${tdir}; \
338 fi; \
339 ${INSTALL_FILE} -o ${owner} -g ${group} -m ${mode} ${sdir}${files} ${tdir};
340 .endfor
341 .if ${MKX11} == "yes"
342 ${INSTALL_DIR} -o ${BINOWN} -g ${BINGRP} -m 755 ${DESTDIR}/etc/X11
343 ${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 ${NETBSDSRCDIR}/etc/xorg.conf \
344 ${DESTDIR}/etc/X11/xorg.conf
345 .endif # ${MKX11} == "yes"
346 # LSC: We need a safe install target for etc files, as this is expected from
347 # our current user base. This safe version only leaves out the master.passwd
348 # file in order not to loose any user account created.
350 # BJG: For Minix, the -safe target *is* performed by "make build"
352 # LSC: To ensure minimal modifications, the logic is a bit contrived, i.e. the
353 # NetBSD build system expect install-etc-files to be unsafe, so what was done
354 # is to separate that step into two steps, with the unsafe version refering
355 # (not by dependency, to ensure correct order of actions) the safe step, and
356 # use the following mapping in the main Makefile:
357 # etcforce -> install-etc-files (default NetBSD target)
358 # etcfiles -> install-etc-files-safe (new -safe- target)
359 ${MAKEDIRTARGET} . install-etc-files-safe
361 install-etc-files-safe: .PHONY .MAKE check_DESTDIR MAKEDEV
362 .endif # defined(__MINIX)
363 ${_MKMSG_INSTALL} ${DESTDIR}/etc/ttys
364 .if !defined(__MINIX)
365 .if exists(${.CURDIR}/etc.${MACHINE}/ttys)
366 ${ETC_INSTALL_OBJ_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 \
367 ${.CURDIR}/etc.${MACHINE}/ttys ${DESTDIR}/etc
368 .else
369 ${ETC_INSTALL_OBJ_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 \
370 ${.CURDIR}/etc.${MACHINE_CPU}/ttys ${DESTDIR}/etc
371 .endif
372 .else
373 ${ETC_INSTALL_OBJ_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 \
374 ${.CURDIR}/ttys ${DESTDIR}/etc
375 .endif # !defined(__MINIX)
376 .if exists(etc.${MACHINE}/boot.cfg)
377 ${_MKMSG_INSTALL} ${DESTDIR}/boot.cfg
378 ${ETC_INSTALL_OBJ_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 \
379 ${.CURDIR}/etc.${MACHINE}/boot.cfg ${DESTDIR}/
380 .endif
381 .if !defined(__MINIX)
382 ${_MKMSG_INSTALL} ${DESTDIR}/dev/MAKEDEV
383 ${ETC_INSTALL_OBJ_FILE} -o ${BINOWN} -g ${BINGRP} -m 555 \
384 MAKEDEV ${DESTDIR}/dev
385 .else
386 # As /var/log is a symlink to /usr/log, we need to use /usr/log for files
387 # in /var/log here. The same applies to the distrib list entries.
388 .for owner group mode file in \
389 ${BINOWN} ${BINGRP} 644 /usr/log/messages \
390 ${BINOWN} ${BINGRP} 644 /usr/log/syslog \
391 games games 664 /var/games/tetris.scores
392 ${_MKMSG_INSTALL} ${DESTDIR}${file}
393 if [ ! -e ${DESTDIR}${file} -o -s ${DESTDIR}${file} ]; then \
394 ${ETC_INSTALL_FILE} -o ${owner} -g ${group} -m ${mode} \
395 /dev/null ${DESTDIR}${file}; \
396 else true; fi
397 .endfor
398 .endif # !defined(__MINIX)
399 # TAC as software is imported, copy the files from the .for block below
400 # TAC to the .for block above.
401 .if !defined(__MINIX)
402 .for owner group mode file in \
403 ${BINOWN} operator 664 /etc/dumpdates \
404 ${BINOWN} operator 600 /etc/skeykeys \
405 root wheel 600 /var/at/at.deny \
406 root wheel 644 /var/db/locate.database \
407 ${BINOWN} ${BINGRP} 600 /var/log/authlog \
408 root wheel 600 /var/log/cron \
409 ${BINOWN} ${UTMPGRP} 664 /var/log/lastlog \
410 ${BINOWN} ${UTMPGRP} 664 /var/log/lastlogx \
411 ${BINOWN} ${BINGRP} 640 /var/log/lpd-errs \
412 ${BINOWN} ${BINGRP} 600 /var/log/maillog \
413 ${BINOWN} ${BINGRP} 644 /var/log/messages \
414 ${BINOWN} ${BINGRP} 600 /var/log/secure \
415 ${BINOWN} ${UTMPGRP} 664 /var/log/wtmp \
416 ${BINOWN} ${UTMPGRP} 664 /var/log/wtmpx \
417 ${BINOWN} ${BINGRP} 600 /var/log/xferlog \
418 daemon staff 664 /var/msgs/bounds \
419 ${BINOWN} ${UTMPGRP} 664 /var/run/utmp \
420 ${BINOWN} ${UTMPGRP} 664 /var/run/utmpx \
421 games games 664 /var/games/atc_score \
422 games games 664 /var/games/battlestar.log \
423 games games 664 /var/games/cfscores \
424 games games 664 /var/games/criblog \
425 games games 660 /var/games/hackdir/perm \
426 games games 660 /var/games/hackdir/record \
427 games games 664 /var/games/larn/llog12.0 \
428 games games 664 /var/games/larn/lscore12.0 \
429 games games 664 /var/games/larn/playerids \
430 games games 664 /var/games/robots_roll \
431 games games 664 /var/games/rogue.scores \
432 games games 664 /var/games/saillog \
433 games games 664 /var/games/snakerawscores \
434 games games 664 /var/games/snake.log \
435 games games 664 /var/games/tetris.scores
436 ${_MKMSG_INSTALL} ${DESTDIR}${file}
437 if [ ! -e ${DESTDIR}${file} -o -s ${DESTDIR}${file} ]; then \
438 ${ETC_INSTALL_FILE} -o ${owner} -g ${group} -m ${mode} \
439 /dev/null ${DESTDIR}${file}; \
440 else true; fi
441 .endfor
442 .for subdir in . defaults bluetooth iscsi mtree namedb pam.d powerd rc.d root skel ssh
443 ${MAKEDIRTARGET} ${subdir} configinstall
444 .endfor
445 ${MAKEDIRTARGET} ${NETBSDSRCDIR}/external/bsd/dhcpcd/sbin/dhcpcd configinstall
446 ${MAKEDIRTARGET} ${NETBSDSRCDIR}/usr.bin/mail configinstall
447 .if (${MKPF} != "no")
448 ${MAKEDIRTARGET} ${NETBSDSRCDIR}/usr.sbin/pf configinstall
449 .endif
450 .if (${MKCRYPTO} != "no")
451 ${MAKEDIRTARGET} ${NETBSDSRCDIR}/crypto/external/bsd/openssh/bin configinstall
452 .endif
453 .if (${MKPOSTFIX} != "no")
454 ${MAKEDIRTARGET} ${NETBSDSRCDIR}/external/ibm-public/postfix configinstall
455 .endif
456 .if (${MKATF} != "no")
457 ${MAKEDIRTARGET} ${NETBSDSRCDIR}/external/bsd/atf/etc/atf configinstall
458 .endif
459 .if (${MKKYUA} != "no")
460 ${MAKEDIRTARGET} ${NETBSDSRCDIR}/external/bsd/kyua-cli/etc/kyua configinstall
461 .endif
462 .else # LSC Minix Specific
463 .for owner group mode sdir tdir files in \
464 ${BINOWN} ${BINGRP} ${BINMODE} ${NETBSDSRCDIR}/etc/usr/ ${DESTDIR}/usr/etc/ daily \
465 ${BINOWN} ${BINGRP} ${BINMODE} ${NETBSDSRCDIR}/etc/usr/ ${DESTDIR}/usr/etc/ rc \
466 ${BINOWN} ${BINGRP} ${BINMODE} ${NETBSDSRCDIR}/etc/ ${DESTDIR}/usr/lib/ crontab \
467 ${BINOWN} ${BINGRP} ${BINMODE} ${NETBSDSRCDIR}/etc/ ${DESTDIR}/etc/ system.conf \
468 ${BINOWN} ${BINGRP} ${NONBINMODE} ${NETBSDSRCDIR}/etc/usr/ ${DESTDIR}/usr/ Makefile \
469 ${BINOWN} ${BINGRP} ${BINMODE} ${NETBSDSRCDIR}/etc/devmand/ ${DESTDIR}/etc/devmand/ usb_hub.cfg \
470 ${BINOWN} ${BINGRP} ${BINMODE} ${NETBSDSRCDIR}/etc/devmand/ ${DESTDIR}/etc/devmand/ usb_storage.cfg \
471 ${BINOWN} ${BINGRP} ${BINMODE} ${NETBSDSRCDIR}/etc/devmand/scripts/ ${DESTDIR}/etc/devmand/scripts/ block \
472 ${BINOWN} ${BINGRP} ${BINMODE} ${NETBSDSRCDIR}/etc/devmand/scripts/ ${DESTDIR}/etc/devmand/scripts/ singlechar \
474 ${_MKMSG_INSTALL} ${DESTDIR}${tdir}${files:T}
475 if [ ! -e ${tdir} ]; then \
476 ${INSTALL_DIR} ${tdir}; \
477 fi; \
478 ${INSTALL_FILE} -o ${owner} -g ${group} -m ${mode} ${sdir}${files} ${tdir};
479 .endfor
480 .if ${MACHINE_ARCH} == "earm"
481 ${_MKMSG_INSTALL} ${DESTDIR}/etc/rc.capes
482 ${INSTALL_DIR} ${DESTDIR}/etc/rc.capes
483 ${INSTALL_FILE} -m ${BINMODE} -o ${BINOWN} -g ${BINGRP} ${NETBSDSRCDIR}/etc/rc.capes/* ${DESTDIR}/etc/rc.capes
484 ${INSTALL_FILE} -m ${BINMODE} -o ${BINOWN} -g ${BINGRP} ${NETBSDSRCDIR}/minix/drivers/usb/usbd/usbd.conf ${DESTDIR}/etc/system.conf.d/usbd
485 .endif # Minix/earm specific
486 .for subdir in . defaults mtree namedb rc.d root skel
487 ${MAKEDIRTARGET} ${subdir} configinstall
488 .endfor
489 ${MAKEDIRTARGET} ${NETBSDSRCDIR}/external/bsd/dhcpcd/sbin/dhcpcd configinstall
490 ${_MKMSG_INSTALL} ${DESTDIR}/usr/lib/fonts
491 ${INSTALL_DIR} ${DESTDIR}/usr/lib/fonts
492 ${INSTALL_FILE} -m ${BINMODE} -o ${BINOWN} -g ${BINGRP} ${NETBSDSRCDIR}/etc/fonts/*.fnt ${DESTDIR}/usr/lib/fonts/
493 .endif # LSC Minix Specific
496 # install-obsolete-lists --
497 # Install var/db/obsolete set lists; this is performed by "make build"
499 OBSOLETE.dir= ${.OBJDIR}/obsolete.dir
500 .if !defined(__MINIX)
501 OBSOLETE.files= base comp etc games man misc text
502 .else
503 OBSOLETE.files= minix-base minix-comp minix-games minix-kernel minix-man
504 .endif # !defined(__MINIX)
505 .if ${MKDEBUG} != "no"
506 OBSOLETE.files+= minix-debug
507 .endif
508 .if ${MKKMOD} != "no"
509 OBSOLETE.files+= modules
510 .endif
511 .if ${MKATF} != "no"
512 OBSOLETE.files+= minix-tests tests
513 .endif
514 .if ${MKX11} != "no"
515 OBSOLETE.files+= xbase xcomp xetc xfont xserver
516 .endif
518 # XXX make "makeobsolete" set wise; then generate files respectively
519 install-obsolete-lists: .PHONY .MAKE
520 mkdir -p ${OBSOLETE.dir}
521 .if ${MKX11} != "no"
522 (cd ${NETBSDSRCDIR}/distrib/sets && \
523 AWK=${TOOL_AWK:Q} MAKE=${MAKE:Q} ${HOST_SH} ./makeobsolete -b -t ${OBSOLETE.dir})
524 .else
525 (cd ${NETBSDSRCDIR}/distrib/sets && \
526 AWK=${TOOL_AWK:Q} MAKE=${MAKE:Q} ${HOST_SH} ./makeobsolete -t ${OBSOLETE.dir})
527 .endif
528 .for file in ${OBSOLETE.files}
529 ${_MKMSG_INSTALL} ${DESTDIR}/var/db/obsolete/${file}
530 if [ ! -e ${DESTDIR}/var/db/obsolete/${file} ] || \
531 ! cmp -s ${OBSOLETE.dir}/${file} ${DESTDIR}/var/db/obsolete/${file}; then \
532 ${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 \
533 ${OBSOLETE.dir}/${file} ${DESTDIR}/var/db/obsolete; \
534 else true; fi
535 .endfor
538 # distrib-dirs --
539 # Populate $DESTDIR with directories needed by NetBSD
541 distrib-dirs: .PHONY check_DESTDIR
542 cd ${NETBSDSRCDIR}/etc/mtree && ${MAKE} distrib-dirs
545 # release, snapshot --
546 # Build a full distribution including kernels & install media.
548 release snapshot: .PHONY .MAKE check_DESTDIR check_RELEASEDIR snap_md_post
549 ${MAKEDIRTARGET} ${NETBSDSRCDIR}/distrib/sets sets
550 ${MAKESUMS} -A -t ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/sets \
551 ${KERNEL_SETS:@.SETS.@kern-${.SETS.}.tgz@}
552 ${MAKESUMS} -t ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/kernel '*.gz'
555 .if !defined(__MINIX)
556 # iso-image --
557 # Standalone target to create a CDROM image after the release
558 # was composed. Should be run after "make release" in src and xsrc.
559 # The do-iso-image is to be called from etc.$MACHINE/Makefile.inc
561 # Note: At least mkisofs 2.0 should be used.
563 CDROM_NAME_ADD?=
564 CDROM_IMAGE?=${RELEASEDIR}/images/NetBSD-${DISTRIBVER}-${MACHINE}.iso
565 CDROM.dir= ${.OBJDIR}/cdrom.dir
566 CDROM.pathlist= ${.OBJDIR}/cdrom.pathlist
568 iso-image:
570 .if ${MKISOFS} != true
571 do-iso-image: .PHONY check_DESTDIR check_RELEASEDIR iso-image-md-post
572 ${MAKESUMS} -t ${RELEASEDIR}/images/ '*.iso'
573 @echo "iso-image created as: ${CDROM_IMAGE}"
574 .else
575 do-iso-image:
576 @echo iso-image: mkisofs not found
577 .endif
579 iso-image-setup: .PHONY check_RELEASEDIR
580 rm -f ${CDROM.pathlist}
581 .for extra in README SOURCE_DATE source
582 .if exists(${RELEASEDIR}/${extra})
583 echo "${extra}=${RELEASEDIR}/${extra}" >> ${CDROM.pathlist}
584 .endif
585 .endfor
586 echo "${MACHINE}/=${RELEASEDIR}/${RELEASEMACHINEDIR}/" >> ${CDROM.pathlist}
587 mkdir -p ${CDROM.dir}
589 check_imagedir:
590 mkdir -p ${RELEASEDIR}/images
592 # iso-image-mi --
593 # Create the image after the MD operations have completed.
595 iso-image-mi: .PHONY check_DESTDIR check_RELEASEDIR iso-image-md-pre check_imagedir
596 @if ! ${MKISOFS} --version; then \
597 echo "install pkgsrc/sysutils/cdrtools and run 'make iso-image'." ; \
598 false; \
600 ${MKISOFS} ${MKISOFS_FLAGS} -graft-points -path-list ${CDROM.pathlist} \
601 -o ${CDROM_IMAGE} ${CDROM.dir}
603 # iso-image-md-pre --
604 # Setup ${CDROM.dir} to produce a bootable CD image.
605 # Overridden by etc.$MACHINE/Makefile.inc
607 iso-image-md-pre: .PHONY check_DESTDIR check_RELEASEDIR iso-image-setup
608 # (empty -- look in the machine-dependent Makefile.inc)
610 # iso-image-md-post --
611 # Fixup the CD-image to be bootable.
612 # Overridden by etc.$MACHINE/Makefile.inc
614 iso-image-md-post: .PHONY check_DESTDIR check_RELEASEDIR iso-image-mi
615 # (empty -- look in the machine-dependent Makefile.inc)
618 # live-image --
619 # Standalone target to create live images after the release was composed.
620 # Should be run after "make release" in src and xsrc.
621 # LIVEIMG_RELEASEDIR specifies where to install live images and
622 # it can be set in MD etc.${MACHINE}/Makefile.inc.
624 LIVEIMG_RELEASEDIR?= ${RELEASEDIR}/images
626 live-image: .PHONY check_DESTDIR check_RELEASEDIR
627 ${MAKEDIRTARGET} ${NETBSDSRCDIR}/distrib live_image \
628 LIVEIMG_RELEASEDIR=${LIVEIMG_RELEASEDIR}
629 ${MAKESUMS} -t ${LIVEIMG_RELEASEDIR} '*.img.gz'
631 # install-image --
632 # Standalone target to create installation images
633 # after the release was composed.
634 # Should be run after "make release" in src and xsrc.
635 # INSTIMG_RELEASEDIR specifies where to install live images and
636 # it can be set in MD etc.${MACHINE}/Makefile.inc.
638 INSTIMG_RELEASEDIR?= ${RELEASEDIR}/images
640 install-image: .PHONY check_DESTDIR check_RELEASEDIR
641 ${MAKEDIRTARGET} ${NETBSDSRCDIR}/distrib install_image \
642 INSTIMG_RELEASEDIR=${INSTIMG_RELEASEDIR}
643 ${MAKESUMS} -t ${INSTIMG_RELEASEDIR} '*.img.gz'
644 .endif # !defined(__MINIX)
646 # snap_pre --
647 # Create ${RELEASEDIR} and necessary subdirectories.
649 snap_pre: .PHONY check_DESTDIR check_RELEASEDIR distribution
650 ${INSTALL} -d -m 755 ${RELEASEDIR}
651 .if ${MKUPDATE} == "no"
652 # Could be a mount point, ignore the errors
653 -/bin/rm -rf ${RELEASEDIR}/${RELEASEMACHINEDIR}
654 .endif
655 ${INSTALL} -d -m 755 ${RELEASEDIR}/${RELEASEMACHINEDIR}
656 .for dir in ${INSTALLATION_DIRS}
657 ${INSTALL} -d -m 755 ${RELEASEDIR}/${RELEASEMACHINEDIR}/${dir}
658 .endfor
660 # snap_post --
661 # Build the install media and notes from distrib
663 snap_post: .PHONY .MAKE build_kernelsets build_releasekernels
664 .if ${MKUPDATE} == "no"
665 cd ${NETBSDSRCDIR}/distrib && ${MAKE} cleandir
666 .endif
667 cd ${NETBSDSRCDIR}/distrib && ${MAKE} depend && ${MAKE} && \
668 ${MAKE} release
670 # build kernels --
671 # This target builds the kernels specified by each port.
672 # A port may specify the following kernels:
674 # KERNEL_SETS The list of kernels that will be
675 # packaged into sets, named
676 # kern-${kernel}.tgz. These kernels
677 # are also placed in the binary/kernel
678 # area of the release package as
679 # netbsd-${kernel}.gz.
681 # EXTRA_KERNELS Additional kernels to place in the
682 # binary/kernel area of the release
683 # package as netbsd-${kernel}.gz, but
684 # which are not placed into sets. This
685 # allows a port to provide e.g. a netbootable
686 # installation kernel containing a ramdisk.
688 # BUILD_KERNELS Additional kernels to build which are
689 # not placed into sets nor into the
690 # binary/kernel area of the release
691 # package. These are typically kernels
692 # that are built for inclusion only in
693 # installation disk/CD-ROM/tape images.
695 # A port may also specify KERNEL_SUFFIXES, which is an optional list
696 # of filename suffixes for kernels to include in the kernel sets and
697 # in the binary/kernel area of the release package (e.g. "netbsd" vs.
698 # "netbsd.ecoff" and "netbsd.srec"). It is not an error if kernels
699 # with these suffixes do not exist in the kernel build directory.
702 # A list of all the kernels to build, which can be overridden from
703 # external sources (such as make(1)'s environment or command line)
705 ALL_KERNELS?= ${KERNEL_SETS} ${EXTRA_KERNELS} ${BUILD_KERNELS}
706 .export ALL_KERNELS
708 GETKERNELAWK= ${TOOL_AWK} '/^config/ {print $$2; found=1} \
709 END{ if (found == 0) print "netbsd"; }'
711 build_kernels: .PHONY
712 # Configure & compile kernels listed in ${ALL_KERNELS}
714 # The 'sync' is so that all writes during the build are pushed back
715 # to the disk. Not having it causes problems on some host systems
716 # (e.g. Linux) when building on NFS.
718 .if !defined(KERNELS_DONE) # {
719 .for configfile in ${ALL_KERNELS:O:u} # {
720 build_kernels: kern-${configfile}
721 kern-${configfile}: .PHONY .MAKE
722 cd ${KERNCONFDIR} && ${TOOL_CONFIG} ${CONFIGOPTS} -s ${KERNSRCDIR} \
723 -U DEBUG -b ${KERNOBJDIR}/${configfile:C/.*\///} ${configfile}
724 .if ${MKUPDATE} == "no"
725 cd ${KERNOBJDIR}/${configfile:C/.*\///} && ${MAKE} distclean
726 .endif
727 cd ${KERNOBJDIR}/${configfile:C/.*\///} && ${MAKE} depend && ${MAKE}
728 sync
729 .endfor # ALL_KERNELS # }
730 .endif # KERNELS_DONE # }
732 build_kernelsets: .PHONY
733 # Create kernel sets from ${KERNEL_SETS} into
734 # ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/sets
736 .for configfile in ${KERNEL_SETS:O:u} # {
737 .for configsel in ${ALL_KERNELS:O:u}
738 .if ${configfile} == ${configsel}
739 build_kernelsets: kernset-${configfile}
740 kernset-${configfile}: .PHONY build_kernels snap_pre
741 @ kernlist=$$(${GETKERNELAWK} ${KERNCONFDIR}/${configfile}); \
742 kerndir=${KERNOBJDIR}/${configfile:C/.*\///}; \
743 kernsuffixes="${KERNEL_SUFFIXES:S/^/./}"; \
744 kern_tgz=${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/sets/kern-${configfile}.tgz; \
745 pax_cmd="GZIP=${GZIP_FLAGS:Q} ${TOOL_PAX} --use-compress-program ${TOOL_GZIP:Q} -O -w -M -N ${NETBSDSRCDIR}/etc -f $${kern_tgz}"; \
746 cd $${kerndir} && { \
747 kernels=; newest=; \
748 for kernel in $${kernlist}; do \
749 for s in "" $${kernsuffixes}; do \
750 ks="$${kernel}$${s}"; \
751 [ -f $${ks} ] || continue; \
752 kernels="$${kernels} $${ks}"; \
753 [ -z "$${newest}" -o $${ks} -nt "$${newest}" ] && \
754 newest=$${ks}; \
755 done; \
756 done; \
757 [ $${kern_tgz} -nt "$${newest}" ] || { \
758 echo "echo $${kernels} | $${pax_cmd}"; \
759 ( echo "/set uname=${BINOWN} gname=${BINGRP}"; \
760 echo ". type=dir optional"; \
761 for kernel in $${kernels}; do \
762 echo "./$${kernel} type=file"; \
763 done ) | eval $${pax_cmd}; \
766 .endif
767 .endfor
768 .endfor # KERNEL_SETS # }
770 build_releasekernels: .PHONY
771 # Build kernel.gz from ${KERNEL_SETS} ${EXTRA_KERNELS} into
772 # ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/kernel
774 .for configfile in ${KERNEL_SETS:O:u} ${EXTRA_KERNELS:O:u} # {
775 .for configsel in ${ALL_KERNELS:O:u}
776 .if ${configfile} == ${configsel}
777 build_releasekernels: releasekern-${configfile}
778 releasekern-${configfile}: .PHONY build_kernels snap_pre
779 @ kernlist=$$(${GETKERNELAWK} ${KERNCONFDIR}/${configfile:C/.*\///}); \
780 kerndir=${KERNOBJDIR}/${configfile:C/.*\///}; \
781 kernsuffixes="${KERNEL_SUFFIXES:S/^/./}"; \
782 cd $${kerndir} && { \
783 for kernel in $${kernlist}; do \
784 for s in "" $${kernsuffixes}; do \
785 ks="$${kernel}$${s}"; \
786 [ ! -f $${ks} ] && continue; \
787 knl_gz="${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/kernel/$${kernel}-${configfile:C/.*\///}$${s}.gz"; \
788 [ $${knl_gz} -nt $${ks} ] && continue; \
789 rm -f $${knl_gz}; \
790 echo "${TOOL_GZIP} ${GZIP_FLAGS} -c < $${kerndir}/$${ks} > $${knl_gz}"; \
791 ${TOOL_GZIP} ${GZIP_FLAGS} -c < $${ks} > $${knl_gz}; \
792 done; \
793 done; \
795 .endif
796 .endfor
797 .endfor # KERNEL_SETS EXTRA_KERNELS # }
799 # snap_md_post --
800 # Machine dependent distribution media operations.
801 # Overridden by etc.$MACHINE/Makefile.inc
803 snap_md_post: .PHONY check_DESTDIR check_RELEASEDIR snap_post
804 # (empty -- look in the machine-dependent Makefile.inc)
807 clean:
808 -rm -rf ${CDROM.dir} ${CDROM.pathlist} ${OBSOLETE.dir}
810 .if !defined(__MINIX)
811 SUBDIR= defaults rc.d mtree
812 .else
813 SUBDIR= devmand defaults mtree
814 .endif # !defined(__MINIX)
816 .include <bsd.prog.mk>
817 .include <bsd.subdir.mk>
819 test:
820 @echo ${OBSOLETE.files}