kernel: restore stacktraces
[minix.git] / drivers / ramdisk / Makefile
blobde9fe8784da3e90d831302bf12bf7a30d0123983
1 # Makefile for ramdisk image
3 .include <bsd.own.mk>
5 # Remove "drivers/ramdisk" component from path
6 PROGROOT:= ${.OBJDIR:S,drivers/ramdisk,,}
8 TOOL_PWD_MKDB?= ${NETBSDSRCDIR}/usr.sbin/pwd_mkdb/pwd_mkdb
9 install:
11 all:
13 PROG_DRIVERS=at_wini floppy pci
14 PROG_COMMANDS=cdprobe loadramdisk mount fsck.mfs sysenv sh \
15 service
16 PROG_SERVERS=mfs procfs
17 PROG_USRSBIN=pwd_mkdb
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"
23 PROG_DRIVERS+= ahci
24 PROG_SERVERS+= ext2
25 PROTO= proto
26 .else
27 PROTO= proto.small
28 .endif
30 .if ${MKACPI} != "no"
31 PROG_DRIVERS+= acpi
32 .endif
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; \
43 # then : ; \
44 # else echo "CLEAN sanity check of image failed." ; \
45 # echo "(Perhaps install current mkfs and fsck.)" ; \
46 # rm -f image; false; \
47 # fi
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} $> $@
57 .endfor
59 .for driver in ${PROG_DRIVERS}
60 ${driver}: ${PROGROOT}/drivers/${driver}/${driver}
61 ${INSTALL} $> $@
63 ${PROGROOT}/drivers/${driver}/${driver}:
64 ${MAKE} -C ${NETBSDSRCDIR}/drivers/${driver} ${driver}
65 .endfor
67 .for cmd in ${PROG_COMMANDS}
68 .if ${cmd} == sh
69 dir.${cmd}=ash
70 .else
71 dir.${cmd}=${cmd}
72 .endif
73 ${cmd}: ${PROGROOT}/commands/${dir.${cmd}}/${cmd}
74 ${INSTALL} $> $@
76 ${PROGROOT}/commands/$(dir.${cmd})/${cmd}:
77 ${MAKE} -C ${NETBSDSRCDIR}/commands/${dir.${cmd}} ${cmd}
78 .endfor
80 .for etc in ${EXTRA}
81 ${etc}: ${NETBSDSRCDIR}/etc/${etc}
82 ${INSTALL} $> $@
83 .endfor
85 .for cmd in ${PROG_USRSBIN}
86 ${cmd}: ${PROGROOT}/usr.sbin/${cmd}/${cmd}
87 ${INSTALL} $> $@
89 ${PROGROOT}/usr.sbin/${cmd}/${cmd}:
90 ${MAKE} -C ${NETBSDSRCDIR}/usr.sbin/${cmd} ${cmd}
91 .endfor
93 .for server in ${PROG_SERVERS}
94 ${server}: ${PROGROOT}/servers/${server}/${server}
95 ${INSTALL} $> $@
97 ${PROGROOT}/servers/${server}/${server}:
98 ${MAKE} -C ${NETBSDSRCDIR}/servers/${server} ${server}
99 .endfor
101 etc/master.passwd: ${NETBSDSRCDIR}/etc/master.passwd
102 rm -rf ${.OBJDIR}/etc/
103 mkdir -p ${.OBJDIR}/etc
104 ${INSTALL} $> $@
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}
113 ${STRIP} ${PROGRAMS}
114 ${HOST_SH} -e proto.sh ${PROTO} >${.OBJDIR}/${.TARGET}
116 .include <minix.service.mk>