ARM divsi3.S: raise(SIGFPE) when called for
[minix.git] / drivers / ramdisk / Makefile
blob450a21b690a775178620e60de7cd4ea7936727dc
1 # Makefile for ramdisk image
3 .include <bsd.own.mk>
5 install:
7 all:
9 # Add a few defines we are going to use during the image
10 # creation to determine what features and binaries to include
11 # in the final image
12 # ACPI do we have/include the acpi binary
13 # RAMDISK_SMALL is the script called with MKSMALL=yes
14 # DYNAMIC does the ramdisk contain dynamic binaries?
15 RAMDISK_INC_ACPI= 0
16 RAMDISK_SMALL= 0
17 RAMDISK_DYNAMIC= 0
19 RAMDISK_DEFINES= \
20 -DRAMDISK_INC_ACPI=${RAMDISK_INC_ACPI} \
21 -DRAMDISK_SMALL=${RAMDISK_SMALL} \
22 -DRAMDISK_DYNAMIC=${RAMDISK_DYNAMIC}
24 # The name of the proto file to use
25 PROTO= proto
27 # Common to all architectures
28 ETC= system.conf master.passwd
29 EXTRA= rc
30 PROTO_FILES= proto.common.etc proto.common.dynamic proto.dev
31 PROG_DRIVERS=
32 PROG_COMMANDS= mount fsck.mfs sh service
33 PROG_SERVERS= mfs
34 PROG_USRSBIN=
35 PROG_BIN=
37 .if ${MACHINE_ARCH} == "i386"
38 ETC+= rs.single
39 EXTRA+=
40 PROG_DRIVERS+= at_wini floppy pci
41 PROG_COMMANDS+= cdprobe loadramdisk sysenv
42 PROG_SERVERS+= procfs
43 PROG_USRSBIN+= pwd_mkdb
45 .if ${MKSMALL} != "yes"
46 RAMDISK_SMALL= 1
47 PROG_DRIVERS+= ahci
48 PROG_DRIVERS+= virtio_blk
49 PROG_SERVERS+= ext2
50 .endif
52 .if ${MKACPI} != "no"
53 RAMDISK_INC_ACPI= 1
54 PROG_DRIVERS+= acpi
55 .endif
56 .endif # ${MACHINE_ARCH} == "i386"
58 .if ${MACHINE_ARCH} == "earm"
59 EXTRA+= rc.arm mylogin.sh ttys
60 PROG_DRIVERS+= mmc tty gpio
61 PROG_COMMANDS+= cp dd getty time sleep stty umount
62 PROG_BIN+= cat ls rm sync
63 PROTO= proto.arm.small
64 .endif # ${MACHINE_ARCH} == "earm"
66 .if ${LDSTATIC} == "-dynamic"
67 RAMDISK_DYNAMIC= 1
68 PROG_LIBEXEC+= ld.elf_so
69 PROG_LIBS+= libc libminlib libcompat_minix libterminfo
70 .endif
72 PROGRAMS=${PROG_DRIVERS} ${PROG_COMMANDS} ${PROG_SERVERS} \
73 ${PROG_USRSBIN} ${PROG_BIN} ${PROG_LIBEXEC}
75 CPPFLAGS+= -I${NETBSDSRCDIR}/servers
77 # LSC We have to take care of not erasing the source file, so never add EXTRA
78 # to CLEANFILES
79 CLEANFILES += ${PROGRAMS} ${SCRIPTS} ${ETC} image image.c t proto.gen
80 CLEANFILES += ${LIBRARIES}
81 CLEANFILES += ${PROG_LIBEXEC}
82 CLEANFILES += ${.OBJDIR}/etc/*
84 #############################################################
85 # LSC Below this point the rules should not be modified
86 #############################################################
88 # Tool to bootstrap the password db
89 TOOL_PWD_MKDB?= ${NETBSDSRCDIR}/usr.sbin/pwd_mkdb/pwd_mkdb
91 # Remove "drivers/ramdisk" component from path
92 PROGROOT:= ${.OBJDIR:S,drivers/ramdisk,,}
94 # Generate dependencies rules for config files
95 .for etc in ${ETC}
96 ${etc}: ${NETBSDSRCDIR}/etc/${etc}
97 ${INSTALL} $> $@
98 .endfor
100 # LSC Force the regeneration of the proto file as it seems sometimes
101 # they are not copied over as needed.
102 # LSC ramdisk rc file != /etc/rc
103 # BJG if ${.CURDIR} == ${.OBJDIR}, we are building in-tree and install
104 # shouldn't try to install the originals over the originals. Otherwise
105 # we are building out-of-tree and the contents should be copied
106 # unconditionally in case the contents have changed after the first copy.
107 .if ${.CURDIR} != ${.OBJDIR}
108 .for file in ${EXTRA} ${PROTO} ${PROTO_FILES}
109 CLEANFILES += ${.OBJDIR}/${file}
110 ${file}: ${NETBSDSRCDIR}/drivers/ramdisk/${file} .PHONY
111 ${INSTALL} $> $@
112 .endfor
113 .endif
115 # Generate dependencies rules for dynamic libraries, if needed
116 .for lib in ${PROG_LIBS}
117 PROGRAMS+= ${lib}.so.0
118 CLEANFILES += ${lib}.so.0
119 ${lib}.so.0:${PROGROOT}/lib/${lib}/${lib}.so.0
120 ${INSTALL} $> $@
122 ${PROGROOT}/lib/${lib}/${lib}.so.0:
123 ${MAKE} -C ${NETBSDSRCDIR}/lib/${lib} all
124 .endfor
126 # Generate dependencies rules for binaries
127 dir.sh:= ash
128 .for srcdir in bin commands drivers libexec servers
129 .for prog in ${PROG_${srcdir:tu}}
130 ${prog}: ${PROGROOT}/${srcdir}/${dir.${prog}:U${prog}}/${prog}
131 ${INSTALL} $> $@
133 ${PROGROOT}/${srcdir}/${dir.${prog}:U${prog}}/${prog}:
134 ${MAKE} -C ${NETBSDSRCDIR}/${srcdir}/${dir.${prog}:U${prog}} all
135 .endfor # prog
136 .endfor # srcdir
138 # We have to do this as a separate loop, because USR.SBIN is not a valid
139 # make variable name.
140 .for prog in ${PROG_USRSBIN}
141 ${prog}: ${PROGROOT}/usr.sbin/${dir.${prog}:U${prog}}/${prog}
142 ${INSTALL} $> $@
144 ${PROGROOT}/usr.sbin/${dir.${prog}:U${prog}}/${prog}:
145 ${MAKE} -C ${NETBSDSRCDIR}/usr.sbin/${dir.${prog}:U${prog}} all
146 .endfor
148 image: proto.gen ${ETC} ${EXTRA} pwd.db spwd.db passwd
149 ${_MKMSG_CREATE} "Generating ramdisk image"
150 ${TOOL_MKFSMFS} image proto.gen || { rm -f image; false; }
151 # if fsck.mfs -s image | grep -q CLEAN; \
152 # then : ; \
153 # else echo "CLEAN sanity check of image failed." ; \
154 # echo "(Perhaps install current mkfs and fsck.)" ; \
155 # rm -f image; false; \
156 # fi
158 etc/master.passwd: ${NETBSDSRCDIR}/etc/master.passwd
159 rm -rf ${.OBJDIR}/etc/
160 mkdir -p ${.OBJDIR}/etc
161 ${INSTALL} $> $@
162 ${TOOL_PWD_MKDB} -V 0 -p -d . etc/master.passwd
164 # LSC We use @F because some version of make still output a full path for @,
165 # even when the target is just a file name
166 pwd.db spwd.db passwd: etc/master.passwd
167 ${INSTALL} etc/${@F} ${@F}
169 proto.gen: ${PROTO} ${PROTO_FILES} ${PROGRAMS}
170 ${STRIP} ${PROGRAMS}
171 # We are using the c preprocessor to generate proto.gen
172 # used in the mkfs tool.
173 ${TOOL_CAT} ${PROTO} | ${CC} \
174 ${RAMDISK_DEFINES} \
175 -E - | grep -v "^$$" | grep -v "#" >${.OBJDIR}/${.TARGET}
177 .include <minix.service.mk>