2010-02-20 09:41:49 -05:00
|
|
|
#
|
2019-04-29 07:21:51 -06:00
|
|
|
# SPDX-License-Identifier: ISC
|
|
|
|
#
|
2019-12-13 19:28:53 -07:00
|
|
|
# Copyright (c) 2010-2015, 2017-2019 Todd C. Miller <Todd.Miller@sudo.ws>
|
2010-02-20 09:41:49 -05:00
|
|
|
#
|
|
|
|
# Permission to use, copy, modify, and distribute this software for any
|
|
|
|
# purpose with or without fee is hereby granted, provided that the above
|
|
|
|
# copyright notice and this permission notice appear in all copies.
|
|
|
|
#
|
|
|
|
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
|
|
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
|
|
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
|
|
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
|
|
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
|
|
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
|
|
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
#
|
|
|
|
|
2010-04-23 23:15:31 -04:00
|
|
|
srcdir = @srcdir@
|
|
|
|
devdir = @devdir@
|
|
|
|
top_builddir = @top_builddir@
|
|
|
|
top_srcdir = @top_srcdir@
|
|
|
|
|
2010-07-13 08:33:46 -04:00
|
|
|
# Installation paths for package building
|
|
|
|
prefix = @prefix@
|
|
|
|
exec_prefix = @exec_prefix@
|
|
|
|
bindir = @bindir@
|
|
|
|
sbindir = @sbindir@
|
|
|
|
sysconfdir = @sysconfdir@
|
|
|
|
libexecdir = @libexecdir@
|
|
|
|
includedir = @includedir@
|
|
|
|
datarootdir = @datarootdir@
|
2011-05-27 10:17:34 -04:00
|
|
|
localedir = @localedir@
|
2011-02-19 08:29:21 -05:00
|
|
|
localstatedir = @localstatedir@
|
2015-04-06 15:10:26 -06:00
|
|
|
exampledir = @exampledir@
|
2010-07-13 08:33:46 -04:00
|
|
|
docdir = @docdir@
|
|
|
|
mandir = @mandir@
|
2014-02-01 05:57:34 -07:00
|
|
|
rundir = @rundir@
|
|
|
|
vardir = @vardir@
|
2010-07-13 08:33:46 -04:00
|
|
|
|
2011-06-04 18:27:13 -04:00
|
|
|
# User and group ids the installed files should be "owned" by
|
|
|
|
install_uid = 0
|
|
|
|
install_gid = 0
|
|
|
|
|
2010-07-13 08:33:46 -04:00
|
|
|
# sudoers owner and mode for package building
|
|
|
|
sudoersdir = $(sysconfdir)
|
|
|
|
sudoers_uid = @SUDOERS_UID@
|
|
|
|
sudoers_gid = @SUDOERS_GID@
|
|
|
|
sudoers_mode = @SUDOERS_MODE@
|
2012-06-11 10:45:34 -04:00
|
|
|
shlib_mode = @SHLIB_MODE@
|
2010-07-13 08:33:46 -04:00
|
|
|
|
2019-11-15 13:35:58 -07:00
|
|
|
SUBDIRS = lib/util @ZLIB_SRC@ lib/iolog lib/logsrv logsrvd \
|
|
|
|
plugins/group_file plugins/sudoers plugins/system_group \
|
2019-10-22 13:16:22 +02:00
|
|
|
@PYTHON_PLUGIN_SRC@ src include doc examples
|
2010-02-20 09:41:49 -05:00
|
|
|
|
2013-02-28 09:49:09 -05:00
|
|
|
SAMPLES = plugins/sample
|
|
|
|
|
2010-04-23 23:15:31 -04:00
|
|
|
VERSION = @PACKAGE_VERSION@
|
2010-07-13 08:33:46 -04:00
|
|
|
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
2010-04-23 23:15:31 -04:00
|
|
|
|
2010-05-21 17:59:47 -04:00
|
|
|
LIBTOOL_DEPS = @LIBTOOL_DEPS@
|
|
|
|
|
2010-05-21 21:29:44 -04:00
|
|
|
SHELL = @SHELL@
|
2010-05-21 17:59:47 -04:00
|
|
|
|
2014-06-26 15:51:15 -06:00
|
|
|
SED = @SED@
|
|
|
|
|
2011-06-04 18:27:13 -04:00
|
|
|
INSTALL = $(SHELL) $(top_srcdir)/install-sh -c
|
2014-06-26 15:51:15 -06:00
|
|
|
INSTALL_OWNER = -o $(install_uid) -g $(install_gid)
|
2011-06-04 18:27:13 -04:00
|
|
|
|
|
|
|
ECHO_N = @ECHO_N@
|
|
|
|
ECHO_C = @ECHO_C@
|
|
|
|
|
|
|
|
# Message catalog support
|
2011-06-18 13:11:27 -04:00
|
|
|
NLS = @SUDO_NLS@
|
2014-06-26 15:51:02 -06:00
|
|
|
POTFILES = po/sudo.pot plugins/sudoers/po/sudoers.pot
|
2012-11-08 14:45:22 -05:00
|
|
|
LOCALEDIR_SUFFIX = @LOCALEDIR_SUFFIX@
|
2011-06-04 18:27:13 -04:00
|
|
|
MSGFMT = msgfmt
|
|
|
|
MSGMERGE = msgmerge
|
|
|
|
XGETTEXT = xgettext
|
2013-11-18 08:59:57 -07:00
|
|
|
XGETTEXT_OPTS = -F -k_ -kN_ -kU_ --copyright-holder="Todd C. Miller" \
|
2015-11-20 10:51:11 -07:00
|
|
|
"--msgid-bugs-address=https://bugzilla.sudo.ws" \
|
2011-06-04 18:27:13 -04:00
|
|
|
--package-name=@PACKAGE_NAME@ --package-version=$(VERSION) \
|
|
|
|
--flag warning:1:c-format --flag warningx:1:c-format \
|
2013-04-29 14:00:50 -04:00
|
|
|
--flag fatal:1:c-format --flag fatalx:1:c-format \
|
2014-06-26 15:51:15 -06:00
|
|
|
--flag easprintf:3:c-format --flag sudo_lbuf_append:2:c-format \
|
|
|
|
--flag sudo_lbuf_append_quoted:3:c-format --foreign-user
|
2011-06-04 18:27:13 -04:00
|
|
|
|
2014-01-13 09:50:39 -07:00
|
|
|
# Default cppcheck options when run from the top-level Makefile
|
2014-11-15 06:32:39 -07:00
|
|
|
CPPCHECK_OPTS = -q --force --enable=warning,performance,portability --suppress=constStatement --error-exitcode=1 --inline-suppr -Dva_copy=va_copy -U__cplusplus -UQUAD_MAX -UQUAD_MIN -UUQUAD_MAX -U_POSIX_HOST_NAME_MAX -U_POSIX_PATH_MAX -U__NBBY -DNSIG=64
|
2014-01-13 09:50:39 -07:00
|
|
|
|
2015-05-21 11:07:13 -06:00
|
|
|
# Default splint options when run from the top-level Makefile
|
|
|
|
SPLINT_OPTS = -D__restrict= -checks
|
|
|
|
|
2018-10-21 08:46:05 -06:00
|
|
|
# Default PVS-studio options when run from the top-level Makefile
|
2019-10-05 14:34:11 -06:00
|
|
|
PVS_CFG = $(top_builddir)/PVS-Studio.cfg
|
2018-10-21 08:46:05 -06:00
|
|
|
PVS_IGNORE = 'V707,V011,V002,V536'
|
|
|
|
PVS_LOG_OPTS = -a 'GA:1,2' -e -t errorfile -d $(PVS_IGNORE)
|
|
|
|
|
2013-04-02 12:40:53 -04:00
|
|
|
all: config.status
|
2014-01-13 09:50:39 -07:00
|
|
|
for d in $(SUBDIRS); do \
|
|
|
|
(cd $$d && exec $(MAKE) $@) && continue; \
|
2013-04-02 12:40:53 -04:00
|
|
|
exit $$?; \
|
|
|
|
done
|
|
|
|
|
|
|
|
check pre-install: config.status
|
2014-01-13 09:50:39 -07:00
|
|
|
for d in $(SUBDIRS); do \
|
|
|
|
(cd $$d && exec $(MAKE) $@) && continue; \
|
2011-04-06 15:32:04 -04:00
|
|
|
exit $$?; \
|
|
|
|
done
|
2010-07-14 14:23:43 -04:00
|
|
|
|
2019-12-13 19:28:53 -07:00
|
|
|
uncrustify.files: Makefile
|
|
|
|
grep '\.[ch]$$' $(top_srcdir)/MANIFEST | egrep -v '(/zlib/|/(arc4random|arc4random_uniform|chacha_private|charclass|fnmatch|getaddrinfo|getcwd|getdate|getentropy|getopt|getopt_long|glob|gram|inet_ntop|inet_pton|log_server.pb-c|mktemp|pw_dup|reallocarray|mktemp_test|protobuf-c|snprintf|stdbool|strlcat|strlcpy|sudo_queue|toke)\.[ch]$$)' > uncrustify.files
|
|
|
|
|
|
|
|
reformat: uncrustify.files
|
|
|
|
( cd $(top_srcdir) && uncrustify -c etc/uncrustify.cfg --replace --no-backup -F $(top_builddir)/uncrustify.files )
|
|
|
|
|
|
|
|
check-format: uncrustify.files
|
|
|
|
( cd $(top_srcdir) && uncrustify -c etc/uncrustify.cfg --check -F $(top_builddir)/uncrustify.files )
|
|
|
|
|
2014-01-13 09:50:39 -07:00
|
|
|
cppcheck: config.status
|
|
|
|
rval=0; \
|
|
|
|
for d in $(SUBDIRS); do \
|
|
|
|
echo checking $$d; \
|
|
|
|
(cd $$d && exec $(MAKE) CPPCHECK_OPTS="$(CPPCHECK_OPTS)" $@) || rval=`expr $$rval + $$?`; \
|
|
|
|
done; \
|
|
|
|
exit $$rval
|
|
|
|
|
2015-05-21 11:07:13 -06:00
|
|
|
splint: config.status
|
|
|
|
rval=0; \
|
|
|
|
for d in $(SUBDIRS); do \
|
|
|
|
echo splinting $$d; \
|
|
|
|
(cd $$d && exec $(MAKE) SPLINT_OPTS="$(SPLINT_OPTS)" $@) || rval=`expr $$rval + $$?`; \
|
|
|
|
done; \
|
|
|
|
exit $$rval
|
|
|
|
|
2017-05-12 10:02:18 -06:00
|
|
|
cov-build:
|
|
|
|
make clean
|
|
|
|
cov-build --dir cov-int make ${MFLAGS} all
|
|
|
|
|
|
|
|
cov-upload:
|
|
|
|
tar zcf cov-int.tgz cov-int
|
|
|
|
curl --form token=$$COVERITY_SUDO_TOKEN \
|
2017-12-11 06:02:52 -07:00
|
|
|
--form email=todd.miller@sudo.ws \
|
2017-05-12 10:02:18 -06:00
|
|
|
--form file=@cov-int.tgz \
|
|
|
|
--form version="$(VERSION)" \
|
|
|
|
https://scan.coverity.com/builds?project=sudo
|
|
|
|
|
|
|
|
cov-analyze: cov-upload
|
|
|
|
|
2018-10-21 08:46:05 -06:00
|
|
|
pvs-studio: config.status
|
|
|
|
files=; \
|
|
|
|
rval=0; \
|
|
|
|
for d in $(SUBDIRS); do \
|
|
|
|
(cd $$d && exec $(MAKE) PVS_IGNORE="$(PVS_IGNORE)" pvs-log-files) || rval=`expr $$rval + $$?`; \
|
|
|
|
for f in $$d/*.plog; do \
|
|
|
|
if test "$$f" != "$$d/*.plog"; then \
|
|
|
|
files="$$files $$f"; \
|
|
|
|
fi; \
|
|
|
|
done; \
|
|
|
|
done; \
|
|
|
|
if test $$rval -ne 0; then \
|
|
|
|
exit $$rval; \
|
|
|
|
fi; \
|
|
|
|
plog-converter $(PVS_LOG_OPTS) $$files
|
|
|
|
|
2011-06-06 14:40:42 -04:00
|
|
|
install-dirs install-binaries install-includes install-plugin: config.status pre-install
|
2014-01-13 09:50:39 -07:00
|
|
|
for d in $(SUBDIRS); do \
|
2014-06-26 15:51:15 -06:00
|
|
|
(cd $$d && exec $(MAKE) "INSTALL_OWNER=$(INSTALL_OWNER)" $@) && continue; \
|
2011-04-06 15:32:04 -04:00
|
|
|
exit $$?; \
|
|
|
|
done
|
2011-03-29 15:20:32 -04:00
|
|
|
|
2011-06-18 13:11:27 -04:00
|
|
|
install-doc: config.status ChangeLog
|
2014-01-13 09:50:39 -07:00
|
|
|
for d in $(SUBDIRS); do \
|
2014-06-26 15:51:15 -06:00
|
|
|
(cd $$d && exec $(MAKE) "INSTALL_OWNER=$(INSTALL_OWNER)" $@) && continue; \
|
2011-04-06 15:32:04 -04:00
|
|
|
exit $$?; \
|
|
|
|
done
|
2010-02-21 16:12:01 -05:00
|
|
|
|
2011-09-16 14:20:15 -04:00
|
|
|
install: config.status ChangeLog pre-install install-nls
|
2014-01-13 09:50:39 -07:00
|
|
|
for d in $(SUBDIRS); do \
|
2014-06-26 15:51:15 -06:00
|
|
|
(cd $$d && exec $(MAKE) "INSTALL_OWNER=$(INSTALL_OWNER)" $@) && continue; \
|
2011-06-06 14:40:42 -04:00
|
|
|
exit $$?; \
|
|
|
|
done
|
2011-06-18 13:11:27 -04:00
|
|
|
|
|
|
|
uninstall: uninstall-nls
|
2014-01-13 09:50:39 -07:00
|
|
|
for d in $(SUBDIRS); do \
|
|
|
|
(cd $$d && exec $(MAKE) $@) && continue; \
|
2011-06-18 13:11:27 -04:00
|
|
|
exit $$?; \
|
|
|
|
done
|
|
|
|
|
|
|
|
uninstall-nls:
|
|
|
|
for pot in $(POTFILES); do \
|
|
|
|
domain=`basename $$pot .pot`; \
|
2011-11-16 11:18:25 -05:00
|
|
|
rm -f $(DESTDIR)$(localedir)/*/LC_MESSAGES/$$domain.mo; \
|
2011-06-18 13:11:27 -04:00
|
|
|
done
|
2011-06-06 14:40:42 -04:00
|
|
|
|
2012-08-29 16:08:02 -04:00
|
|
|
siglist.c signame.c:
|
2017-07-12 05:45:46 -06:00
|
|
|
cd lib/util && exec $(MAKE) $@
|
2011-05-26 12:12:43 -04:00
|
|
|
|
2012-08-29 16:08:02 -04:00
|
|
|
depend: siglist.c signame.c
|
2017-04-26 10:43:42 -06:00
|
|
|
$(top_srcdir)/mkdep.pl --builddir=`pwd` --srcdir=$(top_srcdir) \
|
2019-10-24 20:04:31 -06:00
|
|
|
lib/util/Makefile.in lib/zlib/Makefile.in lib/iolog/Makefile.in \
|
2019-11-15 13:35:58 -07:00
|
|
|
lib/logsrv/Makefile.in logsrvd/Makefile.in \
|
|
|
|
plugins/group_file/Makefile.in plugins/sample/Makefile.in \
|
|
|
|
plugins/sudoers/Makefile.in plugins/system_group/Makefile.in \
|
2019-10-22 13:16:22 +02:00
|
|
|
plugins/python/Makefile.in \
|
2019-11-15 13:35:58 -07:00
|
|
|
src/Makefile.in && \
|
2017-04-26 10:43:42 -06:00
|
|
|
$(top_builddir)/config.status --file $(top_builddir)/lib/util/Makefile \
|
2019-10-24 20:04:29 -06:00
|
|
|
--file $(top_builddir)/lib/zlib/Makefile \
|
2019-10-24 20:04:31 -06:00
|
|
|
--file $(top_builddir)/lib/iolog/Makefile \
|
2019-11-15 13:35:58 -07:00
|
|
|
--file $(top_builddir)/lib/logsrv/Makefile \
|
2019-10-24 20:04:29 -06:00
|
|
|
--file $(top_builddir)/logsrvd/Makefile \
|
2017-04-26 10:43:42 -06:00
|
|
|
--file $(top_builddir)/plugins/sample/Makefile \
|
|
|
|
--file $(top_builddir)/plugins/group_file/Makefile \
|
|
|
|
--file $(top_builddir)/plugins/sudoers/Makefile \
|
|
|
|
--file $(top_builddir)/plugins/system_group/Makefile \
|
2019-10-22 13:16:22 +02:00
|
|
|
--file $(top_builddir)/plugins/python/Makefile \
|
2019-10-24 20:04:29 -06:00
|
|
|
--file $(top_builddir)/src/Makefile
|
2011-05-25 09:02:25 -04:00
|
|
|
|
2010-02-27 12:37:49 -05:00
|
|
|
ChangeLog:
|
2010-10-12 09:36:01 -04:00
|
|
|
if test -d $(srcdir)/.hg && cd $(srcdir); then \
|
2019-10-28 07:52:56 -06:00
|
|
|
if hg log --style=changelog -r "sort(branch(.) or follow(), -date)" > $@.tmp; then \
|
2011-01-04 13:48:50 -05:00
|
|
|
mv -f $@.tmp $@; \
|
2010-10-12 09:36:01 -04:00
|
|
|
else \
|
|
|
|
rm -f $@.tmp; \
|
|
|
|
fi; \
|
2017-12-09 20:40:28 -07:00
|
|
|
elif test -d $(srcdir)/.git && cd $(srcdir); then \
|
2019-11-21 10:17:34 +01:00
|
|
|
./log2cl.pl -b master > $@; \
|
2017-12-09 20:40:28 -07:00
|
|
|
else \
|
|
|
|
echo "ChangeLog data not available" > $@; \
|
2010-10-12 09:36:01 -04:00
|
|
|
fi
|
2010-02-27 12:37:49 -05:00
|
|
|
|
2010-02-21 16:12:01 -05:00
|
|
|
config.status:
|
2010-02-20 09:41:49 -05:00
|
|
|
@if [ ! -s config.status ]; then \
|
|
|
|
echo "Please run configure first"; \
|
|
|
|
exit 1; \
|
|
|
|
fi
|
2010-02-21 16:12:01 -05:00
|
|
|
|
2010-05-21 17:59:47 -04:00
|
|
|
libtool: $(LIBTOOL_DEPS)
|
2010-05-21 18:41:18 -04:00
|
|
|
$(SHELL) ./config.status --recheck
|
2010-05-21 17:59:47 -04:00
|
|
|
|
2011-01-06 10:44:28 -05:00
|
|
|
Makefile: $(srcdir)/Makefile.in
|
|
|
|
./config.status --file Makefile
|
|
|
|
|
2011-10-25 14:54:38 -04:00
|
|
|
sync-po: rsync-po compile-po
|
|
|
|
|
|
|
|
rsync-po:
|
2014-06-26 15:51:02 -06:00
|
|
|
rsync -Lrtvz translationproject.org::tp/latest/sudo/ po/
|
2011-05-27 12:52:47 -04:00
|
|
|
rsync -Lrtvz translationproject.org::tp/latest/sudoers/ plugins/sudoers/po/
|
|
|
|
|
2011-06-06 08:46:50 -04:00
|
|
|
update-pot:
|
2011-08-05 12:33:40 -04:00
|
|
|
@if $(XGETTEXT) --help >/dev/null 2>&1; then \
|
|
|
|
cd $(top_srcdir); \
|
|
|
|
for pot in $(POTFILES); do \
|
|
|
|
echo "Updating $$pot"; \
|
|
|
|
domain=`basename $$pot .pot`; \
|
|
|
|
case "$$domain" in \
|
2019-10-24 20:04:32 -06:00
|
|
|
sudo) tmpfiles=; cfiles="src/*c lib/util/*c";; \
|
2012-11-09 15:31:04 -05:00
|
|
|
sudoers) \
|
2014-09-27 10:24:19 -06:00
|
|
|
echo "gettext \"syntax error\"" > confstr.sh; \
|
2014-09-27 10:39:07 -06:00
|
|
|
$(SED) -n 's/^.*--with-passprompt=\(.*\)$$/gettext \"\1\"/p' mkpkg | sort -u >> confstr.sh; \
|
2014-06-26 15:51:15 -06:00
|
|
|
$(SED) -n -e 's/^badpass_message="/gettext "/p' \
|
2012-11-09 15:31:04 -05:00
|
|
|
-e 's/^passprompt="/gettext "/p' \
|
2013-11-13 15:00:28 -07:00
|
|
|
-e 's/^mailsub="/gettext "/p' configure.ac \
|
2012-11-25 09:33:58 -05:00
|
|
|
>> confstr.sh; \
|
2012-11-09 15:31:04 -05:00
|
|
|
tmpfiles=confstr.sh; \
|
2019-10-24 20:04:32 -06:00
|
|
|
cfiles="lib/iolog/*.c logsrvd/*.c plugins/sudoers/*.c plugins/sudoers/auth/*.c";; \
|
2011-08-05 12:33:40 -04:00
|
|
|
*) echo unknown domain $$domain; continue;; \
|
|
|
|
esac; \
|
2012-11-09 15:31:04 -05:00
|
|
|
$(XGETTEXT) $(XGETTEXT_OPTS) -d$$domain $$cfiles $$tmpfiles -o $$pot.tmp; \
|
|
|
|
test -n "$$tmpfiles" && rm -f $$tmpfiles; \
|
2012-03-28 14:05:49 -04:00
|
|
|
if diff -I'^.POT-Creation-Date' -I'^.Project-Id-Version' -I'^#' $$pot.tmp $$pot >/dev/null; then \
|
2011-08-05 12:33:40 -04:00
|
|
|
rm -f $$pot.tmp; \
|
2011-08-17 11:38:53 -04:00
|
|
|
else \
|
2013-01-11 17:08:49 -05:00
|
|
|
printf '/^#$$/+1,$$d\nw\nq\n' | ed - $$pot; \
|
2014-06-26 15:51:15 -06:00
|
|
|
$(SED) '1,/^#$$/d' $$pot.tmp >> $$pot; \
|
2013-01-11 17:08:49 -05:00
|
|
|
rm -f $$pot.tmp; \
|
2011-08-05 12:33:40 -04:00
|
|
|
fi; \
|
|
|
|
done; \
|
2018-08-07 06:10:21 -06:00
|
|
|
else \
|
|
|
|
echo "Unable to update .pot files: $(XGETTEXT) not found" 1>&2; \
|
2011-08-05 12:33:40 -04:00
|
|
|
fi
|
2011-06-06 08:46:50 -04:00
|
|
|
|
|
|
|
update-po: update-pot
|
2011-08-05 12:33:40 -04:00
|
|
|
@if $(MSGFMT) --help >/dev/null 2>&1; then \
|
|
|
|
cd $(top_srcdir); \
|
|
|
|
for pot in $(POTFILES); do \
|
|
|
|
podir=`dirname $$pot`; \
|
|
|
|
for po in $$podir/*.po; do \
|
|
|
|
echo $(ECHO_N) "Updating $$po$(ECHO_C)"; \
|
|
|
|
$(MSGMERGE) --update $$po $$pot; \
|
|
|
|
$(MSGFMT) --output /dev/null --check-format $$po || exit 1; \
|
|
|
|
done; \
|
2011-06-04 18:27:13 -04:00
|
|
|
done; \
|
2018-08-07 06:10:21 -06:00
|
|
|
else \
|
|
|
|
echo "Unable to update .po files: $(MSGFMT) not found" 1>&2; \
|
2011-08-05 12:33:40 -04:00
|
|
|
fi
|
2011-06-04 18:27:13 -04:00
|
|
|
|
|
|
|
compile-po:
|
2011-08-05 12:33:40 -04:00
|
|
|
@if $(MSGFMT) --help >/dev/null 2>&1; then \
|
|
|
|
cd $(top_srcdir); \
|
|
|
|
rm -f Makefile.$$$$; \
|
|
|
|
POFILES=""; \
|
|
|
|
for pot in $(POTFILES); do \
|
|
|
|
podir=`dirname $$pot`; \
|
|
|
|
for po in $$podir/*.po; do \
|
|
|
|
POFILES="$$POFILES $$po"; \
|
|
|
|
done; \
|
|
|
|
done; \
|
2014-06-26 15:51:15 -06:00
|
|
|
echo "all: `echo $$POFILES | $(SED) 's/\.po/.mo/g'`" >> Makefile.$$$$; \
|
2011-08-05 12:33:40 -04:00
|
|
|
echo "" >> Makefile.$$$$; \
|
|
|
|
for po in $$POFILES; do \
|
2014-06-26 15:51:15 -06:00
|
|
|
mo=`echo $$po | $(SED) 's/po$$/mo/'`; \
|
2011-08-05 12:33:40 -04:00
|
|
|
echo "$$mo: $$po" >> Makefile.$$$$; \
|
|
|
|
echo " $(MSGFMT) --statistics -c -o $$mo $$po" >> Makefile.$$$$; \
|
2011-06-04 18:27:13 -04:00
|
|
|
done; \
|
2014-06-26 15:51:15 -06:00
|
|
|
$(MAKE) -f Makefile.$$$$; \
|
2011-08-05 12:33:40 -04:00
|
|
|
rm -f Makefile.$$$$; \
|
2018-08-07 06:10:21 -06:00
|
|
|
else \
|
|
|
|
echo "Unable to compile message catalogs: $(MSGFMT) not found" 1>&2; \
|
2011-08-05 12:33:40 -04:00
|
|
|
fi
|
2011-06-04 18:27:13 -04:00
|
|
|
|
|
|
|
install-nls:
|
2011-06-18 13:11:27 -04:00
|
|
|
@if test "$(NLS)" = "enabled"; then \
|
2011-06-04 18:27:13 -04:00
|
|
|
for pot in $(POTFILES); do \
|
2014-10-28 14:45:39 -06:00
|
|
|
podir=`dirname $(top_srcdir)/$$pot`; \
|
2011-06-04 18:27:13 -04:00
|
|
|
domain=`basename $$pot .pot`; \
|
2014-06-26 15:51:15 -06:00
|
|
|
SUDO_LINGUAS=$${LINGUAS-"`echo $$podir/*.mo | $(SED) 's:'$$podir'/\([^ ]*\).mo:\1:g'`"}; \
|
2011-06-04 18:27:13 -04:00
|
|
|
echo $(ECHO_N) "Installing $$domain message catalogs:$(ECHO_C)"; \
|
2011-11-16 11:18:25 -05:00
|
|
|
for lang in $$SUDO_LINGUAS; do \
|
|
|
|
test -s $$podir/$$lang.mo || continue; \
|
2011-06-18 13:11:27 -04:00
|
|
|
echo $(ECHO_N) " $$lang$(ECHO_C)"; \
|
|
|
|
$(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES; \
|
2012-11-08 14:45:22 -05:00
|
|
|
if test -n "$(LOCALEDIR_SUFFIX)"; then \
|
|
|
|
if test ! -d $(DESTDIR)$(localedir)/$$lang$(LOCALEDIR_SUFFIX); then \
|
|
|
|
ln -s $$lang $(DESTDIR)$(localedir)/$$lang$(LOCALEDIR_SUFFIX); \
|
|
|
|
fi; \
|
|
|
|
fi; \
|
2014-10-06 14:23:41 -06:00
|
|
|
$(INSTALL) $(INSTALL_OWNER) -m 0644 $$podir/$$lang.mo $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$$domain.mo; \
|
2011-06-04 18:27:13 -04:00
|
|
|
done; \
|
|
|
|
echo ""; \
|
|
|
|
done; \
|
|
|
|
fi
|
|
|
|
|
2019-12-26 18:57:26 -07:00
|
|
|
mkdefaults:
|
|
|
|
cd plugins/sudoers && exec $(MAKE) DEVEL=1 ./def_data.c ./def_data.h
|
|
|
|
|
|
|
|
check-dist: update-pot compile-po mkdefaults
|
2017-04-26 10:43:42 -06:00
|
|
|
@if test -d $(srcdir)/.hg && cd $(srcdir); then \
|
2013-04-18 09:40:38 -04:00
|
|
|
if test `hg stat -am | wc -l` -ne 0; then \
|
|
|
|
echo "Uncommitted changes" 1>&2; \
|
|
|
|
hg stat -am 1>&2; \
|
|
|
|
exit 1; \
|
2011-08-05 12:33:40 -04:00
|
|
|
fi; \
|
|
|
|
fi
|
|
|
|
|
2013-04-18 09:40:38 -04:00
|
|
|
dist: check-dist force-dist
|
|
|
|
|
|
|
|
force-dist: ChangeLog $(srcdir)/MANIFEST
|
2017-04-26 10:43:42 -06:00
|
|
|
cd $(top_srcdir) && \
|
2010-07-13 08:33:46 -04:00
|
|
|
pax -w -x ustar -s '/^/$(PACKAGE_TARNAME)-$(VERSION)\//' \
|
|
|
|
-f ../$(PACKAGE_TARNAME)-$(VERSION).tar \
|
2017-04-26 10:43:42 -06:00
|
|
|
`$(SED) 's/[ ].*//' $(srcdir)/MANIFEST` && \
|
|
|
|
gzip -9f ../$(PACKAGE_TARNAME)-$(VERSION).tar && \
|
2010-07-13 08:33:46 -04:00
|
|
|
ls -l ../$(PACKAGE_TARNAME)-$(VERSION).tar.gz
|
|
|
|
|
2019-12-23 14:29:27 -07:00
|
|
|
package: $(srcdir)/etc/sudo.pp
|
2010-07-13 08:33:46 -04:00
|
|
|
DESTDIR=`cd $(top_builddir) && pwd`/destdir; rm -rf $$DESTDIR; \
|
2014-06-26 15:51:15 -06:00
|
|
|
$(MAKE) install INSTALL_OWNER= DESTDIR=$$DESTDIR && \
|
2010-07-26 11:15:50 -04:00
|
|
|
$(SHELL) $(srcdir)/pp $(PPFLAGS) \
|
2010-07-13 08:33:46 -04:00
|
|
|
--destdir=$$DESTDIR \
|
2019-12-23 14:29:27 -07:00
|
|
|
$(srcdir)/etc/sudo.pp \
|
2014-07-11 15:32:17 -06:00
|
|
|
prefix=$(prefix) \
|
2010-07-13 08:33:46 -04:00
|
|
|
bindir=$(bindir) \
|
|
|
|
sbindir=$(sbindir) \
|
|
|
|
libexecdir=$(libexecdir) \
|
|
|
|
includedir=$(includedir) \
|
2014-02-01 05:57:34 -07:00
|
|
|
vardir=$(vardir) \
|
|
|
|
rundir=$(rundir) \
|
2010-07-13 08:33:46 -04:00
|
|
|
mandir=$(mandir) \
|
2011-05-27 10:17:34 -04:00
|
|
|
localedir=$(localedir) \
|
2010-07-13 08:33:46 -04:00
|
|
|
docdir=$(docdir) \
|
2015-04-06 15:10:26 -06:00
|
|
|
exampledir=$(exampledir) \
|
2010-07-13 08:33:46 -04:00
|
|
|
sysconfdir=$(sysconfdir) \
|
|
|
|
sudoersdir=$(sudoersdir) \
|
|
|
|
sudoers_uid=$(sudoers_uid) \
|
|
|
|
sudoers_gid=$(sudoers_gid) \
|
|
|
|
sudoers_mode=$(sudoers_mode) \
|
2012-06-11 10:45:34 -04:00
|
|
|
shlib_mode=$(shlib_mode) \
|
2010-07-26 11:15:50 -04:00
|
|
|
version=$(VERSION) $(PPVARS)
|
2010-04-23 23:15:31 -04:00
|
|
|
|
2010-02-21 16:12:01 -05:00
|
|
|
clean: config.status
|
2013-02-28 09:49:09 -05:00
|
|
|
for d in $(SUBDIRS) $(SAMPLES); do \
|
2011-04-06 15:32:04 -04:00
|
|
|
(cd $$d && exec $(MAKE) $@); \
|
|
|
|
done
|
2019-12-14 06:30:32 -07:00
|
|
|
-rm -rf cov-int cov-int.tgz uncrustify.files
|
2010-02-20 09:53:05 -05:00
|
|
|
|
2010-02-21 16:12:01 -05:00
|
|
|
mostlyclean: clean
|
|
|
|
|
|
|
|
distclean: config.status
|
2013-02-28 09:49:09 -05:00
|
|
|
for d in $(SUBDIRS) $(SAMPLES); do \
|
2011-04-06 15:32:04 -04:00
|
|
|
(cd $$d && exec $(MAKE) $@); \
|
|
|
|
done
|
2019-11-25 13:28:58 -07:00
|
|
|
-rm -rf autom4te.cache ChangeLog config.cache config.h config.log \
|
2019-12-23 14:29:27 -07:00
|
|
|
config.status etc/init.d/*.sh etc/init.d/sudo.conf libtool \
|
|
|
|
Makefile pathnames.h stamp-*
|
2010-02-20 09:53:05 -05:00
|
|
|
|
|
|
|
cleandir: distclean
|
|
|
|
|
|
|
|
clobber: distclean
|
|
|
|
|
|
|
|
realclean: distclean
|
2010-10-12 09:36:01 -04:00
|
|
|
|
2012-08-18 19:58:07 -04:00
|
|
|
me:
|
|
|
|
|
|
|
|
a:
|
|
|
|
|
|
|
|
sandwich:
|
|
|
|
@if test -n "$$SUDO_USER"; then \
|
|
|
|
echo "Okay."; \
|
|
|
|
else \
|
|
|
|
echo "What? Make it yourself!"; \
|
|
|
|
fi
|
|
|
|
|
2019-12-13 19:28:53 -07:00
|
|
|
.PHONY: ChangeLog me a sandwhich check-format reformat
|