route: ensure RTM_IFINFO is sent first when bring interface down/up
[dragonfly.git] / initrd / Makefile
CommitLineData
4e60e668
AL
1INITRD_MAKE= LC_ALL=C \
2 make -m ${.CURDIR}/../share/mk
bc897c50
AL
3INITRD_SUBDIRS= etc
4RESCUE_SUBDIRS= oinit rescue rescue.libcrypto
57179abe 5
bc897c50
AL
6# Temporary directory to stage the files for creating the initrd image.
7#
8# NOTE: Do not place this directory in the object tree, so that the entire
9# object tree can be exported read-only for upgrading other machines.
10#
11TMPDIR?= /tmp
12STAGEDIR:= ${TMPDIR}/initrd_staged.${.MAKE.PID}
e79a303f 13
e79a303f 14
bc897c50
AL
15all:
16 @echo "--------------------------------------------------------------"
17 @echo ">>> building rescue tools and initrd contents ..."
18 @echo "--------------------------------------------------------------"
19.for _dir in ${RESCUE_SUBDIRS} ${INITRD_SUBDIRS}
20 (cd ${.CURDIR}/${_dir}; \
21 ${INITRD_MAKE} obj; \
4cdf70c7
AL
22 ${INITRD_MAKE} depend all)
23.endfor
9560d18c
AL
24 @echo "--------------------------------------------------------------"
25 @echo ">>> complete building rescue and initrd"
26 @echo "--------------------------------------------------------------"
4cdf70c7 27
e79a303f 28
bc897c50
AL
29install:
30 # If called by 'installworld' (i.e., 'WORLDINSTALL' defined),
31 # do not overwrite the existing ones.
32.if !(defined(WORLDINSTALL) && exists(${DESTDIR}/rescue/rescue))
33 @echo "--------------------------------------------------------------"
34 @echo ">>> installing rescue tools to ${DESTDIR}/rescue ..."
35 @echo "--------------------------------------------------------------"
36.for _dir in ${RESCUE_SUBDIRS}
37 (cd ${.CURDIR}/${_dir}; \
38 ${INITRD_MAKE} BINDIR=/rescue install)
39.endfor
40.endif
4cdf70c7 41
bc897c50
AL
42.if !(defined(WORLDINSTALL) && exists(${DESTDIR}/boot/kernel/initrd.img.gz))
43 @echo "--------------------------------------------------------------"
44 @echo ">>> setting up ${DESTDIR}/boot/kernel/initrd.img.gz ..."
45 @echo "--------------------------------------------------------------"
46 rm -rf ${STAGEDIR}
47.for _dir in ${INITRD_SUBDIRS}
48 (cd ${.CURDIR}/${_dir}; \
49 mkdir -p ${STAGEDIR}/${_dir}; \
50 ${INITRD_MAKE} BINDIR=${STAGEDIR}/${_dir} DESTDIR="" install)
51.endfor
e79a303f
AL
52 sh ${.CURDIR}/mkinitrd.sh \
53 -b ${DESTDIR}/boot \
bc897c50
AL
54 -r ${DESTDIR}/rescue \
55 -c ${STAGEDIR}
56 rm -rf ${STAGEDIR}
57.endif
a5df2615 58
bc897c50
AL
59
60clean:
61.for _dir in ${RESCUE_SUBDIRS} ${INITRD_SUBDIRS}
4cdf70c7 62 (cd ${.CURDIR}/${_dir} && ${INITRD_MAKE} clean cleandepend)
a5df2615 63.endfor
4cdf70c7 64
4cdf70c7 65
bc897c50
AL
66.ORDER: all install
67.MAIN: all