2
# Copyright (c) 2010-2013 Todd C. Miller <Todd.Miller@courtesan.com>
2
# Copyright (c) 2010-2014 Todd C. Miller <Todd.Miller@courtesan.com>
4
4
# Permission to use, copy, modify, and distribute this software for any
5
5
# purpose with or without fee is hereby granted, provided that the above
46
48
sudoers_mode = @SUDOERS_MODE@
47
49
shlib_mode = @SHLIB_MODE@
49
SUBDIRS = compat common @ZLIB_SRC@ plugins/group_file plugins/sudoers \
50
plugins/system_group src include doc
51
SUBDIRS = lib/util @ZLIB_SRC@ plugins/group_file plugins/sudoers \
52
plugins/system_group src include doc examples
52
54
SAMPLES = plugins/sample
61
65
INSTALL = $(SHELL) $(top_srcdir)/install-sh -c
66
INSTALL_OWNER = -o $(install_uid) -g $(install_gid)
66
71
# Message catalog support
68
POTFILES = src/po/sudo.pot plugins/sudoers/po/sudoers.pot
73
POTFILES = po/sudo.pot plugins/sudoers/po/sudoers.pot
69
74
LOCALEDIR_SUFFIX = @LOCALEDIR_SUFFIX@
71
76
MSGMERGE = msgmerge
75
80
--package-name=@PACKAGE_NAME@ --package-version=$(VERSION) \
76
81
--flag warning:1:c-format --flag warningx:1:c-format \
77
82
--flag fatal:1:c-format --flag fatalx:1:c-format \
78
--flag easprintf:3:c-format --flag lbuf_append:2:c-format \
79
--flag lbuf_append_quoted:3:c-format --foreign-user
83
--flag easprintf:3:c-format --flag sudo_lbuf_append:2:c-format \
84
--flag sudo_lbuf_append_quoted:3:c-format --foreign-user
86
# Default cppcheck options when run from the top-level Makefile
87
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
82
for d in $(SUBDIRS); \
83
do (cd $$d && exec $(MAKE) $@) && continue; \
90
for d in $(SUBDIRS); do \
91
(cd $$d && exec $(MAKE) $@) && continue; \
87
95
check pre-install: config.status
88
for d in $(SUBDIRS); \
89
do (cd $$d && exec $(MAKE) $@) && continue; \
96
for d in $(SUBDIRS); do \
97
(cd $$d && exec $(MAKE) $@) && continue; \
101
cppcheck: config.status
103
for d in $(SUBDIRS); do \
105
(cd $$d && exec $(MAKE) CPPCHECK_OPTS="$(CPPCHECK_OPTS)" $@) || rval=`expr $$rval + $$?`; \
93
109
install-dirs install-binaries install-includes install-plugin: config.status pre-install
94
for d in $(SUBDIRS); \
95
do (cd $$d && exec $(MAKE) $@) && continue; \
110
for d in $(SUBDIRS); do \
111
(cd $$d && exec $(MAKE) "INSTALL_OWNER=$(INSTALL_OWNER)" $@) && continue; \
99
115
install-doc: config.status ChangeLog
100
for d in $(SUBDIRS); \
101
do (cd $$d && exec $(MAKE) $@) && continue; \
116
for d in $(SUBDIRS); do \
117
(cd $$d && exec $(MAKE) "INSTALL_OWNER=$(INSTALL_OWNER)" $@) && continue; \
105
121
install: config.status ChangeLog pre-install install-nls
106
for d in $(SUBDIRS); \
107
do (cd $$d && exec $(MAKE) $@) && continue; \
122
for d in $(SUBDIRS); do \
123
(cd $$d && exec $(MAKE) "INSTALL_OWNER=$(INSTALL_OWNER)" $@) && continue; \
111
127
uninstall: uninstall-nls
112
for d in $(SUBDIRS); \
113
do (cd $$d && exec $(MAKE) $@) && continue; \
128
for d in $(SUBDIRS); do \
129
(cd $$d && exec $(MAKE) $@) && continue; \
123
139
siglist.c signame.c:
124
(cd compat && exec $(MAKE) $@)
140
(cd lib/util && exec $(MAKE) $@)
126
142
depend: siglist.c signame.c
127
143
@if test "$(srcdir)" != "."; then \
128
144
echo "make depend only supported in the source directory"; \
131
$(srcdir)/mkdep.pl $(srcdir)/common/Makefile.in \
132
$(srcdir)/compat/Makefile.in $(srcdir)/plugins/sample/Makefile.in \
147
$(srcdir)/mkdep.pl $(srcdir)/lib/util/Makefile.in \
148
$(srcdir)/plugins/sample/Makefile.in \
133
149
$(srcdir)/plugins/group_file/Makefile.in \
134
150
$(srcdir)/plugins/sudoers/Makefile.in \
135
151
$(srcdir)/plugins/system_group/Makefile.in \
136
$(srcdir)/src/Makefile.in $(srcdir)/zlib/Makefile.in; \
137
./config.status --file $(srcdir)/common/Makefile \
138
--file $(srcdir)/compat/Makefile \
152
$(srcdir)/src/Makefile.in $(srcdir)/lib/zlib/Makefile.in; \
153
./config.status --file $(srcdir)/lib/util/Makefile \
139
154
--file $(srcdir)/plugins/sample/Makefile \
140
155
--file $(srcdir)/plugins/group_file/Makefile \
141
156
--file $(srcdir)/plugins/sudoers/Makefile \
142
157
--file $(srcdir)/plugins/system_group/Makefile \
143
--file $(srcdir)/src/Makefile --file $(srcdir)/zlib/Makefile
158
--file $(srcdir)/src/Makefile --file $(srcdir)/lib/zlib/Makefile
146
161
if test -d $(srcdir)/.hg && cd $(srcdir); then \
166
181
sync-po: rsync-po compile-po
169
rsync -Lrtvz translationproject.org::tp/latest/sudo/ src/po/
184
rsync -Lrtvz translationproject.org::tp/latest/sudo/ po/
170
185
rsync -Lrtvz translationproject.org::tp/latest/sudoers/ plugins/sudoers/po/
176
191
echo "Updating $$pot"; \
177
192
domain=`basename $$pot .pot`; \
178
193
case "$$domain" in \
179
sudo) tmpfiles=; cfiles="src/*c common/*c compat/*c";; \
194
sudo) tmpfiles=; cfiles="src/*c lib/*/*c";; \
181
echo "syntax error" > confstr.sh; \
182
sed -n -e 's/^badpass_message="/gettext "/p' \
196
echo "gettext \"syntax error\"" > confstr.sh; \
197
$(SED) -n 's/^.*--with-passprompt=\(.*\)$$/gettext \"\1\"/p' mkpkg | sort -u >> confstr.sh; \
198
$(SED) -n -e 's/^badpass_message="/gettext "/p' \
183
199
-e 's/^passprompt="/gettext "/p' \
184
200
-e 's/^mailsub="/gettext "/p' configure.ac \
193
209
rm -f $$pot.tmp; \
195
211
printf '/^#$$/+1,$$d\nw\nq\n' | ed - $$pot; \
196
sed '1,/^#$$/d' $$pot.tmp >> $$pot; \
212
$(SED) '1,/^#$$/d' $$pot.tmp >> $$pot; \
197
213
rm -f $$pot.tmp; \
223
239
POFILES="$$POFILES $$po"; \
226
echo "all: `echo $$POFILES | sed 's/\.po/.mo/g'`" >> Makefile.$$$$; \
242
echo "all: `echo $$POFILES | $(SED) 's/\.po/.mo/g'`" >> Makefile.$$$$; \
227
243
echo "" >> Makefile.$$$$; \
228
244
for po in $$POFILES; do \
229
mo=`echo $$po | sed 's/po$$/mo/'`; \
245
mo=`echo $$po | $(SED) 's/po$$/mo/'`; \
230
246
echo "$$mo: $$po" >> Makefile.$$$$; \
231
247
echo " $(MSGFMT) --statistics -c -o $$mo $$po" >> Makefile.$$$$; \
233
make -f Makefile.$$$$; \
249
$(MAKE) -f Makefile.$$$$; \
234
250
rm -f Makefile.$$$$; \
238
254
@if test "$(NLS)" = "enabled"; then \
240
255
for pot in $(POTFILES); do \
241
podir=`dirname $$pot`; \
256
podir=`dirname $(top_srcdir)/$$pot`; \
242
257
domain=`basename $$pot .pot`; \
243
SUDO_LINGUAS=$${LINGUAS-"`echo $$podir/*.mo|sed 's:'$$podir'/\([^ ]*\).mo:\1:g'`"}; \
258
SUDO_LINGUAS=$${LINGUAS-"`echo $$podir/*.mo | $(SED) 's:'$$podir'/\([^ ]*\).mo:\1:g'`"}; \
244
259
echo $(ECHO_N) "Installing $$domain message catalogs:$(ECHO_C)"; \
245
260
for lang in $$SUDO_LINGUAS; do \
246
261
test -s $$podir/$$lang.mo || continue; \
271
286
force-dist: ChangeLog $(srcdir)/MANIFEST
272
287
pax -w -x ustar -s '/^/$(PACKAGE_TARNAME)-$(VERSION)\//' \
273
288
-f ../$(PACKAGE_TARNAME)-$(VERSION).tar \
274
`sed 's/[ ].*//' $(srcdir)/MANIFEST`
289
`$(SED) 's/[ ].*//' $(srcdir)/MANIFEST`
275
290
gzip -9f ../$(PACKAGE_TARNAME)-$(VERSION).tar
276
291
ls -l ../$(PACKAGE_TARNAME)-$(VERSION).tar.gz
293
package: $(srcdir)/sudo.pp
279
294
DESTDIR=`cd $(top_builddir) && pwd`/destdir; rm -rf $$DESTDIR; \
280
$(MAKE) install DESTDIR=$$DESTDIR && \
295
$(MAKE) install INSTALL_OWNER= DESTDIR=$$DESTDIR && \
281
296
$(SHELL) $(srcdir)/pp $(PPFLAGS) \
282
297
--destdir=$$DESTDIR \
283
298
$(srcdir)/sudo.pp \
284
300
bindir=$(bindir) \
285
301
sbindir=$(sbindir) \
286
302
libexecdir=$(libexecdir) \
287
303
includedir=$(includedir) \
289
306
mandir=$(mandir) \
290
307
localedir=$(localedir) \
291
308
docdir=$(docdir) \
309
exampledir=$(exampledir) \
292
310
sysconfdir=$(sysconfdir) \
293
311
sudoersdir=$(sudoersdir) \
294
312
sudoers_uid=$(sudoers_uid) \