1 # Makefile for ramdisk image
5 # Remove "drivers/ramdisk" component from path
6 PROGROOT
:= ${.OBJDIR
:S
,drivers
/ramdisk
,,}
8 TOOL_PWD_MKDB?
= ${NETBSDSRCDIR}/usr.sbin
/pwd_mkdb
/pwd_mkdb
13 PROG_DRIVERS
=at_wini floppy pci
14 PROG_COMMANDS
=cdprobe loadramdisk mount fsck.mfs sysenv sh \
16 PROG_SERVERS
=mfs procfs
18 PROGRAMS
=${PROG_DRIVERS} ${PROG_COMMANDS} ${PROG_SERVERS} ${PROG_USRSBIN}
19 EXTRA
=system.conf master.passwd rs.single
20 PROTO_FILES
=proto.common.etc proto.common.dynamic proto.sh proto.dev
22 .if
${MKSMALL} != "yes"
34 CPPFLAGS
+= -I
${NETBSDSRCDIR}/servers
35 CLEANFILES
+= ${PROGRAMS} ${SCRIPTS} ${EXTRA} image image.c t proto.gen
36 CLEANFILES
+= ${LIBRARIES}
37 CLEANFILES
+= ${.OBJDIR
}/etc
/*
39 image
: proto.gen
${EXTRA} mtab rc pwd.db spwd.db passwd
40 ${_MKMSG_CREATE} "Generating ramdisk image"
41 ${TOOL_MKFSMFS} image proto.gen ||
{ rm -f image
; false
; }
42 # if fsck.mfs -s image | grep -q CLEAN; \
44 # else echo "CLEAN sanity check of image failed." ; \
45 # echo "(Perhaps install current mkfs and fsck.)" ; \
46 # rm -f image; false; \
49 # LSC ramdisk rc file != /etc/rc
50 # mtab not empty!, force execution of the rule to ensure installation
51 # Conditionnally execute the command if the target file already exists
52 # I have to place .PHONY for the target to work as expected, but I cannot
53 # execute the command during an in-tree build (= make xxx)
54 .for file in rc mtab
${PROTO} ${PROTO_FILES}
55 ${file}: ${.CURDIR
}/${file} .PHONY
56 [ -e
$@
] ||
${INSTALL} $> $@
59 .for driver in
${PROG_DRIVERS}
60 ${driver}: ${PROGROOT}/drivers
/${driver}/${driver}
63 ${PROGROOT}/drivers
/${driver}/${driver}:
64 ${MAKE} -C
${NETBSDSRCDIR}/drivers
/${driver} ${driver}
67 .for cmd in
${PROG_COMMANDS}
73 ${cmd}: ${PROGROOT}/commands
/${dir.
${cmd}}/${cmd}
76 ${PROGROOT}/commands
/$(dir.
${cmd})/${cmd}:
77 ${MAKE} -C
${NETBSDSRCDIR}/commands
/${dir.
${cmd}} ${cmd}
81 ${etc}: ${NETBSDSRCDIR}/etc
/${etc}
85 .for cmd in
${PROG_USRSBIN}
86 ${cmd}: ${PROGROOT}/usr.sbin
/${cmd}/${cmd}
89 ${PROGROOT}/usr.sbin
/${cmd}/${cmd}:
90 ${MAKE} -C
${NETBSDSRCDIR}/usr.sbin
/${cmd} ${cmd}
93 .for server in
${PROG_SERVERS}
94 ${server}: ${PROGROOT}/servers
/${server}/${server}
97 ${PROGROOT}/servers
/${server}/${server}:
98 ${MAKE} -C
${NETBSDSRCDIR}/servers
/${server} ${server}
101 etc
/master.passwd
: ${NETBSDSRCDIR}/etc
/master.passwd
102 rm -rf
${.OBJDIR
}/etc
/
103 mkdir
-p
${.OBJDIR
}/etc
105 ${TOOL_PWD_MKDB} -V
0 -p
-d . etc
/master.passwd
107 # LSC We use @F because some version of make still output a full path for @,
108 # even when the target is just a file name
109 pwd.db spwd.db passwd
: etc
/master.passwd
110 ${INSTALL} etc
/${@F
} ${@F
}
112 proto.gen
: ${PROTO} ${PROTO_FILES} ${PROGRAMS}
114 ${HOST_SH} -e proto.sh
${PROTO} >${.OBJDIR
}/${.TARGET
}
116 .
include <minix.service.mk
>