Allow for OS and SUBOS folders so we can introduce NetBSD scripts whilst keeping BSD for all BSD's.

This commit is contained in:
Roy Marples 2008-01-10 16:35:59 +00:00
parent 2643f2e605
commit 4314784520
44 changed files with 257 additions and 307 deletions

View File

@ -1,33 +1,19 @@
# OpenRC Makefile # OpenRC Makefile
# Copyright 2007 Roy Marples # Copyright 2007-2008 Roy Marples
# Distributed under the terms of the GNU General Public License v2 # Distributed under the terms of the GNU General Public License v2
NAME = openrc NAME= openrc
VERSION = 0.1 VERSION= 0.1
PKG = $(NAME)-$(VERSION) PKG= ${NAME}-${VERSION}
SUBDIR = conf.d doc etc init.d man net runlevels sh src SUBDIR= conf.d doc etc init.d man net runlevels sh src
TOPDIR = . MK= mk
include $(TOPDIR)/default.mk include ${MK}/os.mk
include ${MK}/subdir.mk
include ${MK}/dist.mk
install:: INSTALLAFTER= _installafter
$(INSTALL) -d $(DESTDIR)$(RC_LIB)/init.d _installafter:
$(INSTALL) -d $(DESTDIR)$(RC_LIB)/tmp ${INSTALL} -d ${DESTDIR}${RC_LIB}/init.d
${INSTALL} -d ${DESTDIR}${RC_LIB}/tmp
clean::
rm -f *.bz2
dist:
$(INSTALL) -d /tmp/$(PKG)
cp -RPp . /tmp/$(PKG)
(cd /tmp/$(PKG); git clean; $(MAKE) clean)
rm -rf /tmp/$(PKG)/*.bz2 /tmp/$(PKG)/.git /tmp/$(PKG)/test
rm -rf /tmp/$(PKG)/.gitignore /tmp/$(PKG)/src/.gitignore
sed -i.bak -e '/LDFLAGS += -Wl,-rpath ./ s/^/#/' /tmp/$(PKG)/src/Makefile
rm -f /tmp/$(PKG)/src/Makefile.bak
tar cvjpf $(PKG).tar.bz2 -C /tmp $(PKG)
rm -rf /tmp/$(PKG)
ls -l $(PKG).tar.bz2
# vim: set ts=4 :

3
README
View File

@ -4,8 +4,7 @@ OpenRC README
Installation Installation
------------ ------------
make install make install
Yup, that simple. Works with GNU make, FreeBSD make and pmake. Should work Yup, that simple. Works with GNU make and BSD make.
with every other make too.
You may wish to tweak the installation with the below arguments You may wish to tweak the installation with the below arguments
PROGLDFLAGS=-static PROGLDFLAGS=-static

View File

@ -1,5 +1,5 @@
DIR = /etc/conf.d DIR= /etc/conf.d
CONF = $(CONTENTS) CONF= ${CONTENTS}
TOPDIR = .. MK= ../mk
include $(TOPDIR)/default.mk include ${MK}/scripts.mk

View File

@ -1,6 +1,6 @@
DIR = /etc/conf.d DIR= /etc/conf.d
CONF = consolefont keymaps modules CONF= consolefont keymaps modules
CONF_APPEND = clock CONF_APPEND= clock
TOPDIR = .. MK= ../mk
include $(TOPDIR)/default.mk include ${MK}/scripts.mk

View File

@ -1,5 +1,5 @@
DIR = /etc/conf.d DIR= /etc/conf.d
CONF = $(CONTENTS) CONF= ${CONTENTS}
TOPDIR = .. MK= ../mk
include $(TOPDIR)/default.mk include ${MK}/scripts.mk

View File

@ -1,65 +0,0 @@
# Common makefile settings
# We shouldn't use PREFIX as we need to install into /
_LIBNAME_SH= l=`readlink /lib`; case "$$l" in /lib64|lib64) echo "lib64";; *) echo "lib";; esac
_LIBNAME!= ${_LIBNAME_SH}
LIBNAME= ${_LIBNAME}$(shell ${_LIBNAME_SH})
RC_LIB= /${LIBNAME}/rc
INSTALL?= install
_OS_SH= u=`uname -s`; case "$${u}" in *BSD|DragonFly) echo "BSD";; *) echo "$${u}";; esac
_OS!= ${_OS_SH}
OS?= ${_OS}$(shell ${_OS_SH})
# We store the contents of the directory for ease of use in Makefiles
_CONTENTS_SH= ls -1 | grep -v Makefile | xargs
_CONTENTS!= ${_CONTENTS_SH}
CONTENTS= ${_CONTENTS}$(shell ${_CONTENTS_SH})
# Recursive rules
# Adapted from FreeBSDs bsd.subdir.mk
_+_ ?= +
ECHODIR ?= echo
_SUBDIR = @${_+_}for x in ${SUBDIR}; do \
if test -d $$x; then \
${ECHODIR} "===> ${DIRPRFX}$$x ($@)"; \
cd $$x; \
${MAKE} $@ DIRPRFX=${DIRPRFX}$$x/ || exit $$?; \
cd ..; \
fi; \
if test -d $$x.${OS}; then \
${ECHODIR} "===> ${DIRPRFX}$$x.${OS} ($@)"; \
cd $$x.${OS}; \
${MAKE} $@ DIRPRFX=${DIRPRFX}$$x/ || exit $$?; \
cd ..; \
fi; \
done
all:
${_SUBDIR}
clean::
${_SUBDIR}
depend::
${_SUBDIR}
install::
${_SUBDIR}
install:: ${BIN} ${CONF} ${CONF_APPEND}
if test -n "${DIR}"; then ${INSTALL} -d ${DESTDIR}${DIR} || exit $$?; fi
if test -n "${BIN}"; then ${INSTALL} ${BIN} ${DESTDIR}${DIR} || exit $$?; fi
if test -n "${INC}"; then ${INSTALL} -m 0644 ${INC} ${DESTDIR}${DIR} || exit $$?; fi
for x in ${CONF}; do \
if ! test -e ${DESTDIR}${DIR}/$$x; then \
${INSTALL} -m 0644 $$x ${DESTDIR}${DIR} || exit $$?; \
fi; \
done
for x in ${CONF_APPEND}; do \
if test -e ${DESTDIR}${DIR}/$$x; then \
cat $$x >> ${DESTDIR}${DIR}/$$x || exit $$?; \
else \
${INSTALL} -m 0644 $$x ${DESTDIR}${DIR} || exit $$?; \
fi; \
done
# vim: set ts=4 :

View File

@ -1,5 +1,5 @@
DIR = /usr/share/doc/openrc DIR= /usr/share/doc/openrc
INC = $(CONTENTS) INC= ${CONTENTS}
TOPDIR = .. MK= ../mk
include $(TOPDIR)/default.mk include ${MK}/scripts.mk

View File

@ -1,5 +1,5 @@
DIR = /usr/share/doc/openrc DIR= /usr/share/doc/openrc
INC = $(CONTENTS) INC= ${CONTENTS}
TOPDIR = .. MK= ../mk
include $(TOPDIR)/default.mk include ${MK}/scripts.mk

View File

@ -1,6 +1,6 @@
DIR = /etc DIR= /etc
CONF = devd.conf rc rc.shutdown CONF= devd.conf rc rc.shutdown
BIN = rc.devd BIN= rc.devd
TOPDIR = .. MK= ../mk
include $(TOPDIR)/default.mk include ${MK}/scripts.mk

View File

@ -1,5 +1,5 @@
DIR = /etc DIR= /etc
CONF_APPEND = rc.conf CONF_APPEND= rc.conf
TOPDIR = .. MK= ../mk
include $(TOPDIR)/default.mk include ${MK}/scripts.mk

View File

@ -1,5 +1,5 @@
DIR = /etc DIR= /etc
CONF = rc.conf CONF= rc.conf
TOPDIR = .. MK= ../mk
include $(TOPDIR)/default.mk include ${MK}/scripts.mk

View File

@ -1,5 +1,5 @@
DIR = /etc/init.d DIR= /etc/init.d
BIN = $(CONTENTS) BIN= ${CONTENTS}
TOPDIR = .. MK= ../mk
include $(TOPDIR)/default.mk include ${MK}/scripts.mk

View File

@ -1,5 +1,5 @@
DIR = /etc/init.d DIR= /etc/init.d
BIN = $(CONTENTS) BIN= ${CONTENTS}
TOPDIR = .. MK= ../mk
include $(TOPDIR)/default.mk include ${MK}/scripts.mk

View File

@ -1,5 +1,5 @@
DIR = /etc/init.d DIR= /etc/init.d
BIN = $(CONTENTS) BIN= ${CONTENTS}
TOPDIR = .. MK= ../mk
include $(TOPDIR)/default.mk include ${MK}/scripts.mk

View File

@ -1,34 +1,37 @@
DIR = /usr/share/man DIR= /usr/share/man
_MAN3_SH = ls -1 *.3 _MAN3_SH= ls -1 *.3
_MAN3 != $(_MAN3_SH) _MAN3!= ${_MAN3_SH}
MAN3 = $(_MAN3)$(shell $(_MAN3_SH)) MAN3= ${_MAN3}$(shell ${_MAN3_SH})
_MAN8_SH = ls -1 *.8 _MAN8_SH= ls -1 *.8
_MAN8 != $(_MAN8_SH) _MAN8!= ${_MAN8_SH}
MAN8 = $(_MAN8)$(shell $(_MAN8_SH)) MAN8= ${_MAN8}$(shell ${_MAN8_SH})
TOPDIR = ..
include $(TOPDIR)/default.mk
# Handy macro to create symlinks # Handy macro to create symlinks
# This does rely on correctly formatting our manpages! # This does rely on correctly formatting our manpages!
MAKE_LINKS = suffix=$${man\#*.}; \ MAKE_LINKS= suffix=$${man\#*.}; \
prefix=$${man%%.*}; \ prefix=$${man%%.*}; \
for link in `sed -e 's/ ,//g' \ for link in `sed -e 's/ ,//g' \
-n -e '/^\.Sh NAME$$/,/\.Sh/ s/\.Nm //p' $${man}`; do \ -n -e '/^\.Sh NAME$$/,/\.Sh/ s/\.Nm //p' $${man}`; do \
if test "$${link}" != "$${prefix}" ; then \ if test "$${link}" != "$${prefix}" ; then \
ln -sf $${man} \ ln -sf $${man} \
$(DESTDIR)/$(DIR)/man$${suffix}/$${link}.$${suffix} ; \ ${DESTDIR}/${DIR}/man$${suffix}/$${link}.$${suffix} ; \
fi; \ fi; \
done; done;
install:: INSTALL?= install
$(INSTALL) -d $(DESTDIR)/$(DIR)/man3
for man in $(MAN3); do \ all:
$(INSTALL) -m 0644 "$$man" $(DESTDIR)/$(DIR)/man3 || exit $$?; \
$(MAKE_LINKS) \ install:
${INSTALL} -d ${DESTDIR}/${DIR}/man3
for man in ${MAN3}; do \
${INSTALL} -m 0644 "$$man" ${DESTDIR}/${DIR}/man3 || exit $$?; \
${MAKE_LINKS} \
done done
$(INSTALL) -d $(DESTDIR)/$(DIR)/man8 ${INSTALL} -d ${DESTDIR}/${DIR}/man8
for man in $(MAN8); do \ for man in ${MAN8}; do \
$(INSTALL) -m 0644 "$$man" $(DESTDIR)/$(DIR)/man8 || exit $$?; \ ${INSTALL} -m 0644 "$$man" ${DESTDIR}/${DIR}/man8 || exit $$?; \
$(MAKE_LINKS) \ ${MAKE_LINKS} \
done done
clean:

View File

View File

View File

@ -62,4 +62,4 @@ install: all
clean: clean:
rm -f ${OBJS} ${SOBJS} ${_LIBS} ${SHLIB_LINK} ${CLEANFILES} rm -f ${OBJS} ${SOBJS} ${_LIBS} ${SHLIB_LINK} ${CLEANFILES}
include ${TOPDIR}/depend.mk include ${MK}/depend.mk

View File

@ -2,14 +2,21 @@
# Generic definitions # Generic definitions
_OS_SH= u=`uname -s`; case "$${u}" in *BSD|DragonFly) echo "BSD";; *) echo "$${u}";; esac _OS_SH_= uname -s
_OS!= ${_OS_SH} _OS!= ${_OS_SH}
OS?= ${_OS}$(shell ${_OS_SH}) OS?= ${_OS}$(shell ${_OS_SH})
_SUBOS_SH= case `uname -s` in \
*BSD|DragonFly) echo "BSD";; \
*) echo "";; \
esac
_SUBOS!= ${_SUBOS_SH}
SUBOS?= ${_SUBOS}$(shell ${_SUBOS_SH})
_LIBNAME_SH= l=`readlink /lib`; case "$$l" in /lib64|lib64) echo "lib64";; *) echo "lib";; esac _LIBNAME_SH= l=`readlink /lib`; case "$$l" in /lib64|lib64) echo "lib64";; *) echo "lib";; esac
_LIBNAME!= ${_LIBNAME_SH} _LIBNAME!= ${_LIBNAME_SH}
LIBNAME?= ${_LIBNAME}$(shell ${_LIBNAME_SH}) LIBNAME?= ${_LIBNAME}$(shell ${_LIBNAME_SH})
RC_LIB= /$(LIB)/rc RC_LIB= /$(LIBNAME)/rc
_DEF_SH= case `uname -s` in Linux) echo "-D_XOPEN_SOURCE=600 -D_BSD_SOURCE";; *) echo;; esac _DEF_SH= case `uname -s` in Linux) echo "-D_XOPEN_SOURCE=600 -D_BSD_SOURCE";; *) echo;; esac
_DEF!= ${_DEF_SH} _DEF!= ${_DEF_SH}

View File

@ -16,4 +16,4 @@ ${PROG}: ${SCRIPTS} ${OBJS}
clean: clean:
rm -f ${OBJS} ${PROG} ${CLEANFILES} rm -f ${OBJS} ${PROG} ${CLEANFILES}
include ${TOPDIR}/depend.mk include ${MK}/depend.mk

34
mk/scripts.mk Normal file
View File

@ -0,0 +1,34 @@
# Install rules for our scripts
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# We store the contents of the directory for ease of use in Makefiles
_CONTENTS_SH= ls -1 | grep -v Makefile | xargs
_CONTENTS!= ${_CONTENTS_SH}
CONTENTS= ${_CONTENTS}$(shell ${_CONTENTS_SH})
INSTALL?= install
include ${MK}/os.mk
all:
realinstall: ${BIN} ${CONF} ${CONF_APPEND}
if test -n "${DIR}"; then ${INSTALL} -d ${DESTDIR}${DIR} || exit $$?; fi
if test -n "${BIN}"; then ${INSTALL} ${BIN} ${DESTDIR}${DIR} || exit $$?; fi
if test -n "${INC}"; then ${INSTALL} -m 0644 ${INC} ${DESTDIR}${DIR} || exit $$?; fi
for x in ${CONF}; do \
if ! test -e ${DESTDIR}${DIR}/$$x; then \
${INSTALL} -m 0644 $$x ${DESTDIR}${DIR} || exit $$?; \
fi; \
done
for x in ${CONF_APPEND}; do \
if test -e ${DESTDIR}${DIR}/$$x; then \
cat $$x >> ${DESTDIR}${DIR}/$$x || exit $$?; \
else \
${INSTALL} -m 0644 $$x ${DESTDIR}${DIR} || exit $$?; \
fi; \
done
install: realinstall ${INSTALLAFTER}
clean:

39
mk/subdir.mk Normal file
View File

@ -0,0 +1,39 @@
# Recursive rules
# Adapted from FreeBSDs bsd.subdir.mk
# Copyright 2007-2008 Roy Marples <roy@marples.name>
_+_ ?= +
ECHODIR ?= echo
_SUBDIR = @${_+_}for x in ${SUBDIR}; do \
if test -d $$x; then \
${ECHODIR} "===> ${DIRPRFX}$$x (${@:realinstall=install})"; \
cd $$x; \
${MAKE} ${@:realinstall=install} \
DIRPRFX=${DIRPRFX}$$x/ || exit $$?; \
cd ..; \
fi; \
if test -d $$x.${OS}; then \
${ECHODIR} "===> ${DIRPRFX}$$x.${OS} (${@:realinstall=install})"; \
cd $$x.${OS}; \
${MAKE} ${@:realinstall=install} \
DIRPRFX=${DIRPRFX}$$x.${OS}/ || exit $$?; \
cd ..; \
fi; \
if test -d $$x.${SUBOS}; then \
${ECHODIR} "===> ${DIRPRFX}$$x.${SUBOS} (${@:realinstall=install})"; \
cd $$x.${SUBOS}; \
${MAKE} ${@:realinstall=install} \
DIRPRFX=${DIRPRFX}$$x.${SUBOS}/ || exit $$?; \
cd ..; \
fi; \
done
all:
${_SUBDIR}
clean:
${_SUBDIR}
realinstall:
${_SUBDIR}
install: realinstall ${INSTALLAFTER}
depend:
${_SUBDIR}

View File

@ -1,5 +1,5 @@
DIR = $(RC_LIB)/net DIR = ${RC_LIB}/net
INC = $(CONTENTS) INC = ${CONTENTS}
TOPDIR = .. MK= ../mk
include $(TOPDIR)/default.mk include ${MK}/scripts.mk

View File

@ -1,5 +1,5 @@
DIR = $(RC_LIB)/net DIR = ${RC_LIB}/net
INC = $(CONTENTS) INC = ${CONTENTS}
TOPDIR = .. MK= ../mk
include $(TOPDIR)/default.mk include ${MK}/scripts.mk

View File

@ -1,5 +1,5 @@
DIR = $(RC_LIB)/net DIR= ${RC_LIB}/net
INC = $(CONTENTS) INC= ${CONTENTS}
TOPDIR = .. MK= ../mk
include $(TOPDIR)/default.mk include ${MK}/scripts.mk

View File

@ -1,7 +1,5 @@
BOOT = dumpon hostid net.lo0 newsyslog savecore syscons syslogd BOOT= dumpon hostid net.lo0 newsyslog savecore syscons syslogd
DEFAULT = local.rc mixer powerd DEFAULT= local.rc mixer powerd
TOPDIR = .. MK= ../mk
include $(TOPDIR)/runlevels.mk include ${MK}/runlevels.mk
# vim: set ts=4 :

View File

@ -1,7 +1,5 @@
BOOT = consolefont keymaps modules net.lo procfs BOOT= consolefont keymaps modules net.lo procfs
DEFAULT = hdparm DEFAULT= hdparm
TOPDIR = .. MK= ../mk
include $(TOPDIR)/runlevels.mk include ${MK}/runlevels.mk
# vim: set ts=4 :

View File

@ -1,23 +0,0 @@
# Handy runlevel stuff
LEVELDIR = $(DESTDIR)/etc/runlevels
BOOTDIR = $(LEVELDIR)/boot
DEFAULTDIR = $(LEVELDIR)/default
INSTALL ?= install
install:
if ! test -d "$(BOOTDIR)"; then \
$(INSTALL) -d $(BOOTDIR) || exit $$?; \
for x in $(BOOT); do ln -snf /etc/init.d/"$$x" $(BOOTDIR)/"$$x" || exit $$?; done \
fi
if ! test -d "$(DEFAULTDIR)"; then \
$(INSTALL) -d $(DEFAULTDIR) || exit $$?; \
for x in $(DEFAULT); do ln -snf /etc/init.d/"$$x" $(DEFAULTDIR)/"$$x" || exit $$?; done \
fi
all:
clean:
depend:
# vim: set ts=4 :

View File

@ -1,11 +1,10 @@
BOOT = bootmisc checkroot checkfs clock hostname localmount swap sysctl urandom BOOT= bootmisc checkroot checkfs clock hostname localmount \
DEFAULT = local netmount swap sysctl urandom
DEFAULT= local netmount
LEVELDIR = $(DESTDIR)/etc/runlevels LEVELDIR= ${DESTDIR}/etc/runlevels
BOOTDIR = $(LEVELDIR)/boot BOOTDIR= ${LEVELDIR}/boot
DEFAULTDIR = $(LEVELDIR)/default DEFAULTDIR= ${LEVELDIR}/default
TOPDIR = .. MK= ../mk
include $(TOPDIR)/runlevels.mk include ${MK}/runlevels.mk
# vim: set ts=4 :

View File

@ -1,5 +1,5 @@
DIR = $(RC_LIB)/sh DIR= ${RC_LIB}/sh
BIN = $(CONTENTS) BIN= ${CONTENTS}
TOPDIR = .. MK= ../mk
include $(TOPDIR)/default.mk include ${MK}/scripts.mk

View File

@ -1,5 +1,5 @@
DIR = $(RC_LIB)/sh DIR= ${RC_LIB}/sh
BIN = $(CONTENTS) BIN= ${CONTENTS}
TOPDIR = .. MK= ../mk
include $(TOPDIR)/default.mk include ${MK}/scripts.mk

View File

@ -1,23 +1,26 @@
DIR = $(RC_LIB)/sh DIR= ${RC_LIB}/sh
INC = functions.sh init-common-post.sh rc-functions.sh rc-mount.sh INC= functions.sh init-common-post.sh rc-functions.sh rc-mount.sh
BIN = gendepends.sh net.sh runscript.sh BIN= gendepends.sh net.sh runscript.sh
TOPDIR = .. MK= ../mk
include $(TOPDIR)/default.mk
# To get NET_LO # To get NET_LO
include Makefile.$(OS) include ${MK}/os.mk
include Makefile.${SUBOS}
install:: INSTALLAFTER= _installafter
_installafter:
@# Handle lib correctly @# Handle lib correctly
if test $(LIBNAME) != "lib"; then \ if test ${LIBNAME} != "lib"; then \
sed -i'.bak' -e 's,/lib/,/$(LIBNAME)/,g' $(DESTDIR)/$(RC_LIB)/sh/functions.sh || exit $$?; \ sed -i'.bak' -e 's,/lib/,/${LIBNAME}/,g' ${DESTDIR}/${RC_LIB}/sh/functions.sh || exit $$?; \
rm -f $(DESTDIR)/$(RC_LIB)/sh/functions.sh.bak; \ rm -f ${DESTDIR}/${RC_LIB}/sh/functions.sh.bak; \
sed -i'.bak' -e 's,/lib/,/$(LIBNAME)/,g' $(DESTDIR)/$(RC_LIB)/sh/rc-functions.sh || exit $$?; \ sed -i'.bak' -e 's,/lib/,/${LIBNAME}/,g' ${DESTDIR}/${RC_LIB}/sh/rc-functions.sh || exit $$?; \
rm -f $(DESTDIR)/$(RC_LIB)/sh/rc-functions.sh.bak; \ rm -f ${DESTDIR}/${RC_LIB}/sh/rc-functions.sh.bak; \
fi fi
@# Provide an init script for the loopback interface @# Provide an init script for the loopback interface
ln -snf $(RC_LIB)/sh/net.sh $(DESTDIR)/etc/init.d/$(NET_LO) || exit $$? ln -snf ${RC_LIB}/sh/net.sh ${DESTDIR}/etc/init.d/${NET_LO} || exit $$?
@# Put functions.sh into the init.d dir so 3rd part apps don't have to @# Put functions.sh into the init.d dir so 3rd party apps don't have to
@# be multilib aware @# be multilib aware
ln -snf $(RC_LIB)/sh/functions.sh $(DESTDIR)/etc/init.d || exit $$? ln -snf ${RC_LIB}/sh/functions.sh ${DESTDIR}/etc/init.d || exit $$?
include ${MK}/scripts.mk

View File

@ -2,5 +2,5 @@
SUBDIR= libeinfo librc rc SUBDIR= libeinfo librc rc
TOPDIR= .. MK= ../mk
include ${TOPDIR}/subdir.mk include ${MK}/subdir.mk

View File

@ -1,16 +1,16 @@
TOPDIR= .. MK= ../../mk
include ${TOPDIR}/os.mk include ${MK}/os.mk
LIB= einfo LIB= einfo
SHLIB_MAJOR= 1 SHLIB_MAJOR= 1
SRCS= libeinfo.c SRCS= libeinfo.c
INCS= einfo.h INCS= einfo.h
VERSION_MAP= einfo.map VERSION_MAP= einfo.map
SHLIBDIR= /${LIBNAME} SHLIBDIR= /${LIBNAME}
CFLAGS+= -I${TOPDIR} CFLAGS+= -I../includes
include ${TOPDIR}/cc.mk include ${MK}/cc.mk
include ${TOPDIR}/lib.mk include ${MK}/lib.mk
include ${TOPDIR}/${TERMCAP}.mk include ${MK}/${TERMCAP}.mk

View File

@ -1,5 +1,5 @@
TOPDIR= .. MK= ../../mk
include ${TOPDIR}/os.mk include ${MK}/os.mk
LIB= rc LIB= rc
SHLIB_MAJOR= 1 SHLIB_MAJOR= 1
@ -11,9 +11,9 @@ VERSION_MAP= rc.map
CFLAGS+= -DLIB=\"${LIBNAME}\" CFLAGS+= -DLIB=\"${LIBNAME}\"
LDADD+= ${LIBKVM} LDADD+= ${LIBKVM}
CFLAGS+= -I${TOPDIR} CFLAGS+= -I../includes
SHLIBDIR= /${LIBNAME} SHLIBDIR= /${LIBNAME}
include ${TOPDIR}/cc.mk include ${MK}/cc.mk
include ${TOPDIR}/lib.mk include ${MK}/lib.mk

View File

@ -5,11 +5,9 @@ SRCS= checkpath.c fstabinfo.c mountinfo.c rc.c rc-depend.c \
CLEANFILES= version.h CLEANFILES= version.h
TOPDIR= .. LDFLAGS+= -L../librc -L../libeinfo
LDFLAGS+= -L${TOPDIR}/librc -L${TOPDIR}/libeinfo
LDADD+= -lutil -lrc -leinfo LDADD+= -lutil -lrc -leinfo
CFLAGS+= -I${TOPDIR} -I${TOPDIR}/librc -I${TOPDIR}/libeinfo CFLAGS+= -I../includes -I../librc -I../libeinfo
BINDIR?= /sbin BINDIR?= /sbin
@ -32,18 +30,19 @@ RC_SBINLINKS= mark_service_starting mark_service_started \
mark_service_coldplugged mark_service_failed \ mark_service_coldplugged mark_service_failed \
rc-abort rc-abort
include ${TOPDIR}/os.mk MK= ../../mk
include ${MK}/os.mk
CFLAGS+= -DLIB=\"${LIBNAME}\" CFLAGS+= -DLIB=\"${LIBNAME}\"
include ${TOPDIR}/cc.mk include ${MK}/cc.mk
include ${TOPDIR}/prog.mk include ${MK}/prog.mk
include ${TOPDIR}/${TERMCAP}.mk include ${MK}/${TERMCAP}.mk
LDADD+= ${LIBDL} ${LIBKVM} LDADD+= ${LIBDL} ${LIBKVM}
include ${TOPDIR}/${PAM}.mk include ${MK}/${PAM}.mk
${SRCS}: version.h ${SRCS}: version.h
version.h: version.h:
sed -n -e 's/^VERSION =[[:space:]]*\([^[:space:]]*\).*/#define VERSION "\1\"/p' ../../Makefile > version.h sed -n -e 's/^VERSION=[[:space:]]*\([^[:space:]]*\).*/#define VERSION "\1\"/p' ../../Makefile > version.h
if test -n "${BRANDING}"; then \ if test -n "${BRANDING}"; then \
echo "#define BRANDING \"${BRANDING}\"" >> version.h; \ echo "#define BRANDING \"${BRANDING}\"" >> version.h; \
fi fi
@ -54,7 +53,7 @@ install: all
${INSTALL} -d ${DESTDIR}/bin ${INSTALL} -d ${DESTDIR}/bin
for x in ${BINLINKS}; do ln -fs ${BINDIR}/${PROG} ${DESTDIR}/bin/$$x; done for x in ${BINLINKS}; do ln -fs ${BINDIR}/${PROG} ${DESTDIR}/bin/$$x; done
${INSTALL} -d ${DESTDIR}/bin ${INSTALL} -d ${DESTDIR}/bin
for x in ${SBINLINKS}; do ln -fs ${BINDIR}/${PROG} ${DESTDIR}${BINDIR}/$$x; done for x in ${SBINLINKS}; do ln -fs ${PROG} ${DESTDIR}${BINDIR}/$$x; done
${INSTALL} -d ${DESTDIR}/${LIBNAME}/${PROG}/bin ${INSTALL} -d ${DESTDIR}/${LIBNAME}/${PROG}/bin
for x in $(RC_BINLINKS); do ln -fs ${BINDIR}/${PROG} $(DESTDIR)/${LIBNAME}/${PROG}/bin/$$x; done for x in $(RC_BINLINKS); do ln -fs ${BINDIR}/${PROG} $(DESTDIR)/${LIBNAME}/${PROG}/bin/$$x; done
${INSTALL} -d ${DESTDIR}/${LIBNAME}/${PROG}/sbin ${INSTALL} -d ${DESTDIR}/${LIBNAME}/${PROG}/sbin

View File

@ -1,27 +0,0 @@
# Recursive rules
# Adapted from FreeBSDs bsd.subdir.mk
_+_ ?= +
ECHODIR ?= echo
_SUBDIR = @${_+_}for x in ${SUBDIR}; do \
if test -d $$x; then \
${ECHODIR} "===> ${DIRPRFX}$$x ($@)"; \
cd $$x; \
${MAKE} $@ DIRPRFX=${DIRPRFX}$$x/ || exit $$?; \
cd ..; \
fi; \
if test -d $$x.${OS}; then \
${ECHODIR} "===> ${DIRPRFX}$$x.${OS} ($@)"; \
cd $$x.${OS}; \
${MAKE} $@ DIRPRFX=${DIRPRFX}$$x/ || exit $$?; \
cd ..; \
fi; \
done
all:
${_SUBDIR}
clean:
${_SUBDIR}
install:
${_SUBDIR}
depend:
${_SUBDIR}