2017-04-06 17:13:59 -05:00
|
|
|
include ../../Makefile.inc
|
|
|
|
MK= ../../mk
|
|
|
|
include ${MK}/os.mk
|
|
|
|
|
2016-01-14 13:33:05 -06:00
|
|
|
SRCS= checkpath.c do_e.c do_mark_service.c do_service.c \
|
|
|
|
do_value.c fstabinfo.c is_newer_than.c is_older_than.c \
|
|
|
|
mountinfo.c openrc-run.c rc-abort.c rc.c \
|
2018-06-13 13:49:42 -05:00
|
|
|
rc-depend.c rc-logger.c rc-misc.c rc-pipes.c \
|
|
|
|
rc-plugin.c rc-service.c rc-status.c rc-update.c \
|
2016-02-01 12:42:58 -06:00
|
|
|
shell_var.c start-stop-daemon.c supervise-daemon.c swclock.c _usage.c
|
2008-01-05 20:49:48 +00:00
|
|
|
|
2014-07-15 22:27:34 +04:00
|
|
|
ifeq (${MKSELINUX},yes)
|
2014-07-16 14:14:37 -05:00
|
|
|
SRCS+= rc-selinux.c
|
2014-07-15 22:27:34 +04:00
|
|
|
endif
|
|
|
|
|
2017-04-06 17:13:59 -05:00
|
|
|
ifeq (${OS},Linux)
|
2019-07-22 18:29:27 -05:00
|
|
|
SRCS+= kill_all.c openrc-init.c openrc-shutdown.c rc-sysvinit.c broadcast.c \
|
|
|
|
rc-wtmp.c
|
2017-04-06 17:13:59 -05:00
|
|
|
endif
|
|
|
|
|
2014-07-16 14:14:37 -05:00
|
|
|
CLEANFILES= version.h rc-selinux.o
|
2008-01-05 20:49:48 +00:00
|
|
|
|
2008-02-28 11:08:49 +00:00
|
|
|
BINDIR= ${PREFIX}/bin
|
|
|
|
SBINDIR= ${PREFIX}/sbin
|
2009-05-23 20:38:12 +01:00
|
|
|
LINKDIR= ${LIBEXECDIR}
|
2008-01-05 20:49:48 +00:00
|
|
|
|
2015-12-23 14:06:31 -06:00
|
|
|
BINPROGS= rc-status
|
2017-10-02 18:09:03 -05:00
|
|
|
SBINPROGS = openrc openrc-run rc rc-service rc-update runscript \
|
2016-02-01 12:42:58 -06:00
|
|
|
start-stop-daemon supervise-daemon
|
2015-12-23 14:06:31 -06:00
|
|
|
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 \
|
2008-01-07 09:39:44 +00:00
|
|
|
mark_service_stopping mark_service_stopped \
|
|
|
|
mark_service_inactive mark_service_wasinactive \
|
2008-10-30 14:59:14 +00:00
|
|
|
mark_service_hotplugged mark_service_failed \
|
2018-05-22 11:08:35 -05:00
|
|
|
mark_service_crashed \
|
2009-10-13 08:03:45 +01:00
|
|
|
rc-abort swclock
|
2017-04-06 17:13:59 -05:00
|
|
|
|
|
|
|
ifeq (${OS},Linux)
|
2017-05-19 13:37:30 -05:00
|
|
|
RC_BINPROGS+= kill_all
|
2017-04-06 17:13:59 -05:00
|
|
|
SBINPROGS+= openrc-init openrc-shutdown
|
|
|
|
endif
|
|
|
|
|
2015-12-23 14:06:31 -06:00
|
|
|
ALL_PROGS= ${BINPROGS} ${SBINPROGS} ${RC_BINPROGS} ${RC_SBINPROGS}
|
|
|
|
CLEANFILES+= ${ALL_PROGS}
|
2008-01-05 20:49:48 +00:00
|
|
|
|
2015-01-22 09:43:28 -05:00
|
|
|
LOCAL_CPPFLAGS=-I../includes -I../librc -I../libeinfo
|
|
|
|
LOCAL_LDFLAGS=-L../librc -L../libeinfo
|
2013-10-16 12:55:37 -05:00
|
|
|
LDADD+= -lutil -lrc -leinfo
|
2008-02-02 13:00:01 +00:00
|
|
|
|
2008-01-10 16:35:59 +00:00
|
|
|
include ${MK}/prog.mk
|
2014-12-05 11:55:16 -06:00
|
|
|
include ${MK}/gitver.mk
|
2008-03-19 15:22:20 +00:00
|
|
|
include ${MK}/cc.mk
|
2008-01-30 15:00:58 +00:00
|
|
|
|
2011-02-02 18:18:55 -06:00
|
|
|
include ${MK}/termcap.mk
|
2008-01-07 09:39:44 +00:00
|
|
|
LDADD+= ${LIBDL} ${LIBKVM}
|
2011-02-02 18:18:55 -06:00
|
|
|
include ${MK}/pam.mk
|
2008-01-05 20:49:48 +00:00
|
|
|
|
2008-01-09 11:44:43 +00:00
|
|
|
${SRCS}: version.h
|
2009-10-16 08:13:34 +01:00
|
|
|
|
|
|
|
.PHONY: version.h.tmp
|
|
|
|
version.h.tmp:
|
|
|
|
echo "#define VERSION \"${VERSION}${GITVER}\"" >$@
|
2008-01-05 20:49:48 +00:00
|
|
|
if test -n "${BRANDING}"; then \
|
2009-10-16 08:13:34 +01:00
|
|
|
echo "#define BRANDING \"${BRANDING}\"" >> $@; \
|
2008-01-05 20:49:48 +00:00
|
|
|
fi
|
|
|
|
|
2009-10-16 08:13:34 +01:00
|
|
|
version.h: version.h.tmp
|
|
|
|
cmp -s $@.tmp $@ && rm $@.tmp || mv $@.tmp $@
|
|
|
|
|
2008-01-06 19:52:43 +00:00
|
|
|
install: all
|
2008-02-28 11:08:49 +00:00
|
|
|
${INSTALL} -d ${DESTDIR}${SBINDIR}
|
2015-12-23 14:06:31 -06:00
|
|
|
${INSTALL} -m ${BINMODE} ${SBINPROGS} ${DESTDIR}${SBINDIR}
|
2008-01-05 20:49:48 +00:00
|
|
|
${INSTALL} -d ${DESTDIR}${BINDIR}
|
2015-12-23 14:06:31 -06:00
|
|
|
${INSTALL} -m ${BINMODE} ${BINPROGS} ${DESTDIR}${BINDIR}
|
2008-02-28 11:08:49 +00:00
|
|
|
${INSTALL} -d ${DESTDIR}${LINKDIR}/bin
|
2015-12-23 14:06:31 -06:00
|
|
|
${INSTALL} -m ${BINMODE} ${RC_BINPROGS} ${DESTDIR}${LINKDIR}/bin
|
2008-02-28 11:08:49 +00:00
|
|
|
${INSTALL} -d ${DESTDIR}${LINKDIR}/sbin
|
2015-12-23 14:06:31 -06:00
|
|
|
${INSTALL} -m ${BINMODE} ${RC_SBINPROGS} ${DESTDIR}${LINKDIR}/sbin
|
2008-01-13 10:21:22 +00:00
|
|
|
if test "${MKPAM}" = pam; then \
|
2008-01-05 20:54:34 +00:00
|
|
|
${INSTALL} -d ${DESTDIR}${PAMDIR}; \
|
2008-01-09 11:44:43 +00:00
|
|
|
${INSTALL} -m ${PAMMODE} start-stop-daemon.pam ${DESTDIR}${PAMDIR}/start-stop-daemon; \
|
2016-05-13 12:05:23 -05:00
|
|
|
${INSTALL} -m ${PAMMODE} supervise-daemon.pam ${DESTDIR}${PAMDIR}/supervise-daemon; \
|
2008-01-05 20:49:48 +00:00
|
|
|
fi
|
2008-01-14 05:32:39 +00:00
|
|
|
|
2008-03-24 06:10:40 +00:00
|
|
|
check test::
|
|
|
|
|
2015-12-23 14:06:31 -06:00
|
|
|
all: ${ALL_PROGS}
|
|
|
|
|
2016-01-13 20:11:06 -06:00
|
|
|
checkpath: checkpath.o _usage.o rc-misc.o
|
|
|
|
ifeq (${MKSELINUX},yes)
|
|
|
|
checkpath: rc-selinux.o
|
|
|
|
endif
|
2015-12-23 14:06:31 -06:00
|
|
|
${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${LDADD}
|
|
|
|
|
2017-05-19 13:37:30 -05:00
|
|
|
kill_all: kill_all.o _usage.o
|
|
|
|
${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${LDADD}
|
|
|
|
|
2015-12-23 14:06:31 -06:00
|
|
|
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}
|
|
|
|
|
2019-08-19 14:55:54 -05:00
|
|
|
openrc-init: openrc-init.o rc-plugin.o rc-wtmp.o
|
2017-04-06 17:13:59 -05:00
|
|
|
${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${LDADD}
|
|
|
|
|
2015-12-23 14:06:31 -06:00
|
|
|
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 \
|
2018-05-22 11:08:35 -05:00
|
|
|
mark_service_hotplugged mark_service_failed \
|
|
|
|
mark_service_crashed: do_mark_service.o rc-misc.o
|
2015-12-23 14:06:31 -06:00
|
|
|
${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}
|
|
|
|
|
2016-01-13 20:11:06 -06:00
|
|
|
openrc rc: rc.o rc-logger.o rc-misc.o rc-plugin.o _usage.o
|
2015-12-23 14:06:31 -06:00
|
|
|
${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${LDADD}
|
|
|
|
|
2019-07-22 18:29:27 -05:00
|
|
|
openrc-shutdown: openrc-shutdown.o rc-misc.o _usage.o broadcast.o rc-wtmp.o rc-sysvinit.o
|
2017-04-06 17:13:59 -05:00
|
|
|
${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${LDADD}
|
|
|
|
|
2015-12-23 14:06:31 -06:00
|
|
|
openrc-run runscript: openrc-run.o _usage.o rc-misc.o rc-plugin.o
|
2016-01-14 10:53:03 -06:00
|
|
|
ifeq (${MKSELINUX},yes)
|
|
|
|
openrc-run runscript: rc-selinux.o
|
|
|
|
endif
|
2015-12-23 14:06:31 -06:00
|
|
|
${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}
|
|
|
|
|
2017-10-02 18:09:03 -05:00
|
|
|
rc-service: rc-service.o _usage.o rc-misc.o
|
2015-12-23 14:06:31 -06:00
|
|
|
${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}
|
|
|
|
|
2018-06-15 12:23:50 -05:00
|
|
|
start-stop-daemon: start-stop-daemon.o _usage.o rc-misc.o rc-pipes.o rc-schedules.o
|
2015-12-23 14:06:31 -06:00
|
|
|
${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${LDADD}
|
|
|
|
|
2018-10-09 17:49:02 -05:00
|
|
|
supervise-daemon: supervise-daemon.o _usage.o rc-misc.o rc-plugin.o rc-schedules.o
|
2016-02-01 12:42:58 -06:00
|
|
|
${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${LDADD}
|
|
|
|
|
2015-12-23 14:06:31 -06:00
|
|
|
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}
|