aboutsummaryrefslogtreecommitdiff
path: root/src/rc/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'src/rc/Makefile')
-rw-r--r--src/rc/Makefile133
1 files changed, 88 insertions, 45 deletions
diff --git a/src/rc/Makefile b/src/rc/Makefile
index 65b58113..1df26d86 100644
--- a/src/rc/Makefile
+++ b/src/rc/Makefile
@@ -1,8 +1,4 @@
-PROG= openrc
-SRCS= checkpath.c fstabinfo.c mountinfo.c openrc-run.c \
- rc-applets.c rc-depend.c rc-logger.c \
- rc-misc.c rc-plugin.c rc-service.c rc-status.c rc-update.c \
- rc.c start-stop-daemon.c swclock.c
+SRCS= rc.c rc-logger.c rc-misc.c rc-plugin.c
ifeq (${MKSELINUX},yes)
SRCS+= rc-selinux.c
@@ -14,26 +10,26 @@ BINDIR= ${PREFIX}/bin
SBINDIR= ${PREFIX}/sbin
LINKDIR= ${LIBEXECDIR}
-BINLINKS= rc-status
-SBINLINKS= rc rc-service rc-update openrc-run runscript service \
- start-stop-daemon
-RC_BINLINKS= einfon einfo ewarnn ewarn eerrorn eerror ebegin eend ewend \
- eindent eoutdent esyslog eval_ecolors ewaitfile \
- veinfo vewarn vebegin veend vewend veindent veoutdent \
- service_starting service_started \
- service_stopping service_stopped \
- service_inactive service_wasinactive \
- service_hotplugged service_started_daemon service_crashed \
- checkpath fstabinfo mountinfo rc-depend \
- service_get_value service_set_value get_options save_options \
- shell_var is_newer_than is_older_than
-RC_SBINLINKS= mark_service_starting mark_service_started \
+BINPROGS= rc-status
+SBINPROGS = openrc openrc-run rc rc-service rc-update runscript service start-stop-daemon
+RC_BINPROGS= einfon einfo ewarnn ewarn eerrorn eerror ebegin eend ewend \
+ eindent eoutdent esyslog eval_ecolors ewaitfile \
+ veinfo vewarn vebegin veend vewend veindent veoutdent \
+ checkpath fstabinfo mountinfo rc-depend \
+ is_newer_than is_older_than \
+ service_get_value service_set_value get_options save_options \
+ service_starting service_started \
+ service_stopping service_stopped \
+ service_inactive service_wasinactive \
+ service_hotplugged service_started_daemon service_crashed \
+ shell_var
+RC_SBINPROGS= mark_service_starting mark_service_started \
mark_service_stopping mark_service_stopped \
mark_service_inactive mark_service_wasinactive \
mark_service_hotplugged mark_service_failed \
rc-abort swclock
-ALL_LINKS= ${BINLINKS} ${SBINLINKS} ${RC_BINLINKS} ${RC_SBINLINKS}
-CLEANFILES+= ${ALL_LINKS}
+ALL_PROGS= ${BINPROGS} ${SBINPROGS} ${RC_BINPROGS} ${RC_SBINPROGS}
+CLEANFILES+= ${ALL_PROGS}
LOCAL_CPPFLAGS=-I../includes -I../librc -I../libeinfo
LOCAL_LDFLAGS=-L../librc -L../libeinfo
@@ -49,22 +45,6 @@ include ${MK}/termcap.mk
LDADD+= ${LIBDL} ${LIBKVM}
include ${MK}/pam.mk
-# create symlinks to rc if not an SELINUX system, otherwise create a wrapper
-# script to call rc with the proper name of the applet to execute.
-# $1 is a list of the links
-# $2 is the path+name of the target to link to (usually 'rc' or '/sbin/rc')
-# $3 is the path where the links are created
-define make-links
- for x in $(1); do \
- if [ "${MKSELINUX}" = yes ]; then \
- printf '#!/bin/sh\nexec ${2} --applet %s "$$@"\n' $$x >${3}/$$x; \
- chmod ${BINMODE} ${3}/$$x; \
- else \
- ln -sf ${2} ${3}/$$x; \
- fi; \
- done;
-endef
-
${SRCS}: version.h
.PHONY: version.h.tmp
@@ -79,15 +59,13 @@ version.h: version.h.tmp
install: all
${INSTALL} -d ${DESTDIR}${SBINDIR}
- ${INSTALL} -m ${BINMODE} ${PROG} ${DESTDIR}${SBINDIR}
+ ${INSTALL} -m ${BINMODE} ${SBINPROGS} ${DESTDIR}${SBINDIR}
${INSTALL} -d ${DESTDIR}${BINDIR}
- $(call make-links,${BINLINKS},${SBINDIR}/${PROG},${DESTDIR}${BINDIR})
- ${INSTALL} -d ${DESTDIR}${SBINDIR}
- $(call make-links,${SBINLINKS},${SBINDIR}/${PROG},${DESTDIR}${SBINDIR})
+ ${INSTALL} -m ${BINMODE} ${BINPROGS} ${DESTDIR}${BINDIR}
${INSTALL} -d ${DESTDIR}${LINKDIR}/bin
- $(call make-links,${RC_BINLINKS},${SBINDIR}/${PROG},${DESTDIR}${LINKDIR}/bin)
+ ${INSTALL} -m ${BINMODE} ${RC_BINPROGS} ${DESTDIR}${LINKDIR}/bin
${INSTALL} -d ${DESTDIR}${LINKDIR}/sbin
- $(call make-links, ${RC_SBINLINKS},${SBINDIR}/${PROG},${DESTDIR}${LINKDIR}/sbin)
+ ${INSTALL} -m ${BINMODE} ${RC_SBINPROGS} ${DESTDIR}${LINKDIR}/sbin
if test "${MKPAM}" = pam; then \
${INSTALL} -d ${DESTDIR}${PAMDIR}; \
${INSTALL} -m ${PAMMODE} start-stop-daemon.pam ${DESTDIR}${PAMDIR}/start-stop-daemon; \
@@ -95,5 +73,70 @@ install: all
check test::
-links: ${PROG}
- $(call make-links,${ALL_LINKS},${PROG},.)
+all: ${ALL_PROGS}
+
+checkpath: checkpath.o _usage.o rc-misc.o rc-selinux.o
+ ${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${LDADD}
+
+einfon einfo ewarnn ewarn eerrorn eerror ebegin eend ewend \
+eindent eoutdent esyslog eval_ecolors ewaitfile \
+veinfo vewarn vebegin veend vewend veindent veoutdent: do_e.o rc-misc.o
+ ${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${LDADD}
+
+fstabinfo: fstabinfo.o _usage.o rc-misc.o
+ ${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${LDADD}
+
+is_newer_than: is_newer_than.o rc-misc.o
+ ${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${LDADD}
+
+is_older_than: is_older_than.o rc-misc.o
+ ${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${LDADD}
+
+mark_service_starting mark_service_started \
+mark_service_stopping mark_service_stopped \
+mark_service_inactive mark_service_wasinactive \
+mark_service_hotplugged mark_service_failed: do_mark_service.o rc-misc.o
+ ${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${LDADD}
+
+mountinfo: mountinfo.o _usage.o rc-misc.o
+ ${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${LDADD}
+
+openrc rc: rc.o rc-logger.o rc-misc.o rc-plugin.o rc-selinux.o _usage.o
+ ${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${LDADD}
+
+openrc-run runscript: openrc-run.o _usage.o rc-misc.o rc-plugin.o
+ ${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${LDADD}
+
+rc-abort: rc-abort.o
+ ${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ -leinfo
+
+rc-depend: rc-depend.o _usage.o rc-misc.o
+ ${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${LDADD}
+
+rc-status: rc-status.o _usage.o rc-misc.o
+ ${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${LDADD}
+
+rc-service service: rc-service.o _usage.o rc-misc.o
+ ${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${LDADD}
+
+rc-update: rc-update.o _usage.o rc-misc.o
+ ${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${LDADD}
+
+start-stop-daemon: start-stop-daemon.o _usage.o rc-misc.o
+ ${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${LDADD}
+
+service_get_value service_set_value get_options save_options: do_value.o rc-misc.o
+ ${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${LDADD}
+
+service_starting service_started \
+service_stopping service_stopped \
+service_inactive service_wasinactive \
+service_hotplugged service_started_daemon \
+service_crashed: do_service.o rc-misc.o
+ ${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${LDADD}
+
+shell_var: shell_var.o
+ ${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^
+
+swclock: swclock.o _usage.o rc-misc.o
+ ${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${LDADD}