2010-05-27 00:49:57 +02:00
|
|
|
# Makefile for ramdisk image
|
|
|
|
|
2011-02-23 14:05:28 +01:00
|
|
|
.include <bsd.own.mk>
|
|
|
|
|
2012-04-10 04:07:51 +02:00
|
|
|
PROG_DRIVERS=at_wini floppy pci
|
|
|
|
PROG_COMMANDS=cdprobe dev2name loadramdisk mount fsck.mfs sysenv sh \
|
|
|
|
service
|
|
|
|
PROG_SERVERS=mfs procfs
|
|
|
|
PROG_USRSBIN=pwd_mkdb
|
|
|
|
PROGRAMS=$(PROG_DRIVERS) $(PROG_COMMANDS) $(PROG_SERVERS) $(PROG_USRSBIN)
|
|
|
|
EXTRA=system.conf master.passwd pwd.db spwd.db rs.single
|
2011-07-30 13:14:00 +02:00
|
|
|
|
2011-08-01 11:05:17 +02:00
|
|
|
.if ${MKSMALL} != "yes"
|
2012-04-10 04:07:51 +02:00
|
|
|
PROG_DRIVERS+= ahci
|
|
|
|
PROG_SERVERS+= ext2
|
2011-07-30 13:14:00 +02:00
|
|
|
PROTO= proto
|
|
|
|
.else
|
2011-08-01 11:05:17 +02:00
|
|
|
PROTO= proto.small
|
2010-09-02 17:44:36 +02:00
|
|
|
.endif
|
|
|
|
|
2012-04-10 04:07:51 +02:00
|
|
|
.if ${MKACPI} != "no"
|
|
|
|
PROG_DRIVERS+= acpi
|
|
|
|
.endif
|
2010-05-27 00:49:57 +02:00
|
|
|
|
2010-07-06 11:19:04 +02:00
|
|
|
CPPFLAGS+= -I${MINIXSRCDIR}/servers -I${MINIXSRCDIR}
|
2012-01-17 16:04:58 +01:00
|
|
|
CLEANFILES += $(PROGRAMS) $(SCRIPTS) $(EXTRA) image image.c t proto.gen
|
2012-04-10 04:07:51 +02:00
|
|
|
CLEANFILES += $(LIBRARIES)
|
2010-05-27 00:49:57 +02:00
|
|
|
|
2010-06-01 17:11:43 +02:00
|
|
|
install: all
|
|
|
|
|
2012-01-17 16:04:58 +01:00
|
|
|
realall: image
|
2010-05-27 00:49:57 +02:00
|
|
|
|
2012-04-10 04:07:51 +02:00
|
|
|
image: proto.gen mtab rc $(EXTRA) passwd
|
2010-08-05 14:35:00 +02:00
|
|
|
mkfs.mfs image proto.gen || { rm -f image; false; }
|
2011-12-22 01:29:27 +01:00
|
|
|
if fsck.mfs -s image | grep -q CLEAN; \
|
|
|
|
then : ; \
|
|
|
|
else echo "CLEAN sanity check of image failed." ; \
|
|
|
|
echo "(Perhaps install current mkfs and fsck.)" ; \
|
2011-12-23 15:02:35 +01:00
|
|
|
rm -f image; false; \
|
2011-12-22 01:29:27 +01:00
|
|
|
fi
|
2010-05-27 00:49:57 +02:00
|
|
|
|
2012-04-10 04:07:51 +02:00
|
|
|
.for driver in $(PROG_DRIVERS)
|
|
|
|
$(driver): ../$(driver)/$(driver)
|
|
|
|
install $> $@
|
2010-05-27 00:49:57 +02:00
|
|
|
|
2012-04-10 04:07:51 +02:00
|
|
|
../$(driver)/$(driver):
|
|
|
|
$(MAKE) -C ../$(driver) $(driver)
|
|
|
|
.endfor
|
2010-05-27 00:49:57 +02:00
|
|
|
|
2012-04-10 04:07:51 +02:00
|
|
|
.for cmd in $(PROG_COMMANDS)
|
|
|
|
.if $(cmd) == sh
|
|
|
|
dir.$(cmd)=ash
|
|
|
|
.else
|
|
|
|
dir.$(cmd)=$(cmd)
|
|
|
|
.endif
|
|
|
|
$(cmd): ../../commands/$(dir.$(cmd))/$(cmd)
|
|
|
|
install $> $@
|
2010-05-27 00:49:57 +02:00
|
|
|
|
2012-04-10 04:07:51 +02:00
|
|
|
../../commands/$(dir.$(cmd))/$(cmd):
|
|
|
|
$(MAKE) -C ../../commands/$(dir.$(cmd)) $(cmd)
|
|
|
|
.endfor
|
2010-05-27 00:49:57 +02:00
|
|
|
|
2012-04-10 04:07:51 +02:00
|
|
|
.for etc in $(EXTRA)
|
|
|
|
$(etc): ../../etc/$(etc)
|
|
|
|
install $> $@
|
|
|
|
.endfor
|
2011-02-23 14:05:28 +01:00
|
|
|
|
2012-04-10 04:07:51 +02:00
|
|
|
.for cmd in $(PROG_USRSBIN)
|
|
|
|
$(cmd): ../../usr.sbin/$(cmd)/$(cmd)
|
|
|
|
install $> $@
|
2011-02-23 14:05:28 +01:00
|
|
|
|
2012-04-10 04:07:51 +02:00
|
|
|
../../usr.sbin/$(cmd)/$(cmd):
|
|
|
|
$(MAKE) -C ../../usr.sbin/$(cmd) $(cmd)
|
|
|
|
.endfor
|
2010-08-04 07:18:03 +02:00
|
|
|
|
2012-04-10 04:07:51 +02:00
|
|
|
.for server in $(PROG_SERVERS)
|
|
|
|
$(server): ../../servers/$(server)/$(server)
|
|
|
|
install $> $@
|
2010-08-04 07:18:03 +02:00
|
|
|
|
2012-04-10 04:07:51 +02:00
|
|
|
../../servers/$(server)/$(server):
|
|
|
|
$(MAKE) -C ../../servers/$(server) $(server)
|
|
|
|
.endfor
|
2010-05-27 00:49:57 +02:00
|
|
|
|
2011-11-22 16:20:05 +01:00
|
|
|
passwd: ../../etc/master.passwd ../../usr.sbin/pwd_mkdb/pwd_mkdb
|
2011-09-30 12:18:10 +02:00
|
|
|
rm -f ../../etc/master.passwd.orig ../../etc/passwd.orig
|
|
|
|
rm -f ../../etc/pwd.db.tmp ../../etc/spwd.db.tmp
|
|
|
|
../../usr.sbin/pwd_mkdb/pwd_mkdb -V 0 -p -d ../../ ../../etc/master.passwd
|
2012-04-10 04:07:51 +02:00
|
|
|
install ../../etc/$@ $@
|
2010-07-01 08:14:06 +02:00
|
|
|
|
2012-04-10 04:07:51 +02:00
|
|
|
proto.gen: $(PROGRAMS) proto.sh ${PROTO} proto.common.etc proto.common.dynamic proto.sh
|
|
|
|
strip $(PROGRAMS)
|
2011-07-30 13:14:00 +02:00
|
|
|
sh -e proto.sh ${PROTO} >proto.gen
|
2010-05-27 00:49:57 +02:00
|
|
|
|
2011-07-09 15:04:42 +02:00
|
|
|
.include <minix.service.mk>
|