openrc/src/rc/Makefile

183 lines
6.4 KiB
Makefile
Raw Normal View History

include ../../Makefile.inc
MK= ../../mk
include ${MK}/os.mk
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 \
rc-depend.c rc-logger.c rc-misc.c rc-pipes.c \
rc-plugin.c rc-service.c rc-status.c rc-update.c \
shell_var.c start-stop-daemon.c supervise-daemon.c swclock.c _usage.c
2008-01-05 20:49:48 +00:00
ifeq (${MKSELINUX},yes)
SRCS+= rc-selinux.c
endif
ifeq (${OS},Linux)
SRCS+= kill_all.c openrc-init.c openrc-shutdown.c rc-sysvinit.c broadcast.c \
rc-wtmp.c
endif
CLEANFILES= version.h rc-selinux.o
2008-01-05 20:49:48 +00:00
BINDIR= ${PREFIX}/bin
SBINDIR= ${PREFIX}/sbin
LINKDIR= ${LIBEXECDIR}
2008-01-05 20:49:48 +00:00
BINPROGS= rc-status
SBINPROGS = openrc openrc-run rc rc-service rc-update runscript \
start-stop-daemon supervise-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 \
2008-01-07 09:39:44 +00:00
mark_service_stopping mark_service_stopped \
mark_service_inactive mark_service_wasinactive \
mark_service_hotplugged mark_service_failed \
2018-05-22 11:08:35 -05:00
mark_service_crashed \
rc-abort swclock
ifeq (${OS},Linux)
RC_BINPROGS+= kill_all
SBINPROGS+= openrc-init openrc-shutdown
endif
ALL_PROGS= ${BINPROGS} ${SBINPROGS} ${RC_BINPROGS} ${RC_SBINPROGS}
CLEANFILES+= ${ALL_PROGS}
2008-01-05 20:49:48 +00:00
LOCAL_CPPFLAGS=-I../includes -I../librc -I../libeinfo
LOCAL_LDFLAGS=-L../librc -L../libeinfo
LDADD+= -lutil -lrc -leinfo
2008-02-02 13:00:01 +00:00
include ${MK}/prog.mk
include ${MK}/gitver.mk
include ${MK}/cc.mk
include ${MK}/termcap.mk
2008-01-07 09:39:44 +00:00
LDADD+= ${LIBDL} ${LIBKVM}
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 $@
install: all
${INSTALL} -d ${DESTDIR}${SBINDIR}
${INSTALL} -m ${BINMODE} ${SBINPROGS} ${DESTDIR}${SBINDIR}
2008-01-05 20:49:48 +00:00
${INSTALL} -d ${DESTDIR}${BINDIR}
${INSTALL} -m ${BINMODE} ${BINPROGS} ${DESTDIR}${BINDIR}
${INSTALL} -d ${DESTDIR}${LINKDIR}/bin
${INSTALL} -m ${BINMODE} ${RC_BINPROGS} ${DESTDIR}${LINKDIR}/bin
${INSTALL} -d ${DESTDIR}${LINKDIR}/sbin
${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::
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
${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${LDADD}
kill_all: kill_all.o _usage.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}
2019-08-19 14:55:54 -05:00
openrc-init: openrc-init.o rc-plugin.o rc-wtmp.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 \
2018-05-22 11:08:35 -05:00
mark_service_hotplugged mark_service_failed \
mark_service_crashed: 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}
2016-01-13 20:11:06 -06:00
openrc rc: rc.o rc-logger.o rc-misc.o rc-plugin.o _usage.o
${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${LDADD}
openrc-shutdown: openrc-shutdown.o rc-misc.o _usage.o broadcast.o rc-wtmp.o rc-sysvinit.o
${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${LDADD}
openrc-run runscript: openrc-run.o _usage.o rc-misc.o rc-plugin.o
ifeq (${MKSELINUX},yes)
openrc-run runscript: rc-selinux.o
endif
${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: 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 rc-pipes.o rc-schedules.o
${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${LDADD}
supervise-daemon: supervise-daemon.o _usage.o rc-misc.o rc-plugin.o rc-schedules.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}