]> granicus.if.org Git - sudo/blob - plugins/sample/Makefile.in
34a66b136080fe7f0ed99e0a2b61e8aa426278da
[sudo] / plugins / sample / Makefile.in
1 #
2 # Copyright (c) 2011-2018 Todd C. Miller <Todd.Miller@sudo.ws>
3 #
4 # Permission to use, copy, modify, and distribute this software for any
5 # purpose with or without fee is hereby granted, provided that the above
6 # copyright notice and this permission notice appear in all copies.
7 #
8 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 #
16 # @configure_input@
17 #
18
19 #### Start of system configuration section. ####
20
21 srcdir = @srcdir@
22 devdir = @devdir@
23 top_builddir = @top_builddir@
24 top_srcdir = @top_srcdir@
25 incdir = $(top_srcdir)/include
26 cross_compiling = @CROSS_COMPILING@
27
28 # Compiler & tools to use
29 CC = @CC@
30 LIBTOOL = @LIBTOOL@
31 SED = @SED@
32 AWK = @AWK@
33
34 # Our install program supports extra flags...
35 INSTALL = $(SHELL) $(top_srcdir)/install-sh -c
36 INSTALL_OWNER = -o $(install_uid) -g $(install_gid)
37 INSTALL_BACKUP = @INSTALL_BACKUP@
38
39 # Libraries
40 LIBS = $(top_builddir)/lib/util/libsudo_util.la
41
42 # C preprocessor flags
43 CPPFLAGS = -I$(incdir) -I$(top_builddir) -I$(top_srcdir) @CPPFLAGS@
44
45 # Usually -O and/or -g
46 CFLAGS = @CFLAGS@
47
48 # Flags to pass to the link stage
49 LDFLAGS = @LDFLAGS@
50 LT_LDFLAGS = @LT_LDFLAGS@ @LT_LDEXPORTS@
51
52 # Flags to pass to libtool
53 LTFLAGS = --tag=disable-static
54
55 # Address sanitizer flags
56 ASAN_CFLAGS = @ASAN_CFLAGS@
57 ASAN_LDFLAGS = @ASAN_LDFLAGS@
58
59 # PIE flags
60 PIE_CFLAGS = @PIE_CFLAGS@
61 PIE_LDFLAGS = @PIE_LDFLAGS@
62
63 # Stack smashing protection flags
64 SSP_CFLAGS = @SSP_CFLAGS@
65 SSP_LDFLAGS = @SSP_LDFLAGS@
66
67 # cppcheck options, usually set in the top-level Makefile
68 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
69
70 # splint options, usually set in the top-level Makefile
71 SPLINT_OPTS = -D__restrict= -checks
72
73 # PVS-studio options
74 PVS_CFG = $(top_srcdir)/PVS-Studio.cfg
75 PVS_IGNORE = 'V707,V011,V002,V536'
76 PVS_LOG_OPTS = -a 'GA:1,2' -e -t errorfile -d $(PVS_IGNORE)
77
78 # Where to install things...
79 prefix = @prefix@
80 exec_prefix = @exec_prefix@
81 bindir = @bindir@
82 sbindir = @sbindir@
83 sysconfdir = @sysconfdir@
84 libexecdir = @libexecdir@
85 datarootdir = @datarootdir@
86 localstatedir = @localstatedir@
87 plugindir = @PLUGINDIR@
88
89 # File mode and map file to use for shared libraries/objects
90 shlib_enable = @SHLIB_ENABLE@
91 shlib_mode = @SHLIB_MODE@
92 shlib_exp = $(srcdir)/sample_plugin.exp
93 shlib_map = sample_plugin.map
94 shlib_opt = sample_plugin.opt
95
96 # User and group ids the installed files should be "owned" by
97 install_uid = 0
98 install_gid = 0
99
100 #### End of system configuration section. ####
101
102 SHELL = @SHELL@
103
104 OBJS =  sample_plugin.lo
105
106 LIBOBJDIR = $(top_builddir)/@ac_config_libobj_dir@/
107
108 VERSION = @PACKAGE_VERSION@
109
110 all: sample_plugin.la
111
112 Makefile: $(srcdir)/Makefile.in
113         cd $(top_builddir) && ./config.status --file plugins/sample/Makefile
114
115 .SUFFIXES: .c .h .i .lo .plog
116
117 .c.lo:
118         $(LIBTOOL) $(LTFLAGS) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(ASAN_CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $<
119
120 .c.i:
121         $(CC) -E -o $@ $(CPPFLAGS) $<
122
123 .i.plog:
124         ifile=$<; rm -f $@; pvs-studio --cfg $(PVS_CFG) --sourcetree-root $(top_srcdir) --skip-cl-exe yes --source-file $${ifile%i}c --i-file $< --output-file $@
125
126 $(shlib_map): $(shlib_exp)
127         @$(AWK) 'BEGIN { print "{\n\tglobal:" } { print "\t\t"$$0";" } END { print "\tlocal:\n\t\t*;\n};" }' $(shlib_exp) > $@
128
129 $(shlib_opt): $(shlib_exp)
130         @$(SED) 's/^/+e /' $(shlib_exp) > $@
131
132 sample_plugin.la: $(OBJS) @LT_LDDEP@
133         $(LIBTOOL) $(LTFLAGS) --mode=link $(CC) $(LDFLAGS) $(ASAN_LDFLAGS) $(SSP_LDFLAGS) $(LT_LDFLAGS) -o $@ $(OBJS) $(LIBS) -module -avoid-version -rpath $(plugindir) -shrext .so
134
135 pre-install:
136
137 install: install-plugin
138
139 install-dirs:
140         $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(plugindir)
141
142 install-binaries:
143
144 install-includes:
145
146 install-doc:
147
148 install-plugin: install-dirs sample_plugin.la
149         if [ X"$(shlib_enable)" = X"yes" ]; then \
150             INSTALL_BACKUP='$(INSTALL_BACKUP)' $(LIBTOOL) $(LTFLAGS) --mode=install $(INSTALL) $(INSTALL_OWNER) -m $(shlib_mode) sample_plugin.la $(DESTDIR)$(plugindir); \
151         fi
152
153 uninstall:
154         -$(LIBTOOL) $(LTFLAGS) --mode=uninstall rm -f $(DESTDIR)$(plugindir)/sample_plugin.la
155         -test -z "$(INSTALL_BACKUP)" || \
156             rm -f $(DESTDIR)$(plugindir)/sample_plugin.so$(INSTALL_BACKUP)
157
158 splint:
159         splint $(SPLINT_OPTS) -I$(incdir) -I$(top_builddir) -I$(top_srcdir) $(srcdir)/*.c
160
161 cppcheck:
162         cppcheck $(CPPCHECK_OPTS) -I$(incdir) -I$(top_builddir) -I$(top_srcdir) $(srcdir)/*.c
163
164 pvs-log-files: $(POBJS)
165
166 pvs-studio: $(POBJS)
167         plog-converter $(PVS_LOG_OPTS) $(POBJS)
168
169 check:
170
171 clean:
172         -$(LIBTOOL) $(LTFLAGS) --mode=clean rm -f *.lo *.o *.la *.a *.i *.plog \
173             stamp-* core *.core core.*
174
175 mostlyclean: clean
176
177 distclean: clean
178         -rm -rf Makefile .libs $(shlib_map) $(shlib_opt)
179
180 clobber: distclean
181
182 realclean: distclean
183         rm -f TAGS tags
184
185 cleandir: realclean
186
187 # Autogenerated dependencies, do not modify
188 sample_plugin.lo: $(srcdir)/sample_plugin.c $(incdir)/compat/stdbool.h \
189                   $(incdir)/sudo_compat.h $(incdir)/sudo_plugin.h \
190                   $(incdir)/sudo_util.h $(top_builddir)/config.h \
191                   $(top_builddir)/pathnames.h
192         $(LIBTOOL) $(LTFLAGS) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(ASAN_CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(srcdir)/sample_plugin.c
193 sample_plugin.i: $(srcdir)/sample_plugin.c $(incdir)/compat/stdbool.h \
194                   $(incdir)/sudo_compat.h $(incdir)/sudo_plugin.h \
195                   $(incdir)/sudo_util.h $(top_builddir)/config.h \
196                   $(top_builddir)/pathnames.h
197         $(CC) -E -o $@ $(CPPFLAGS) $<
198 sample_plugin.plog: sample_plugin.i
199         rm -f $@; pvs-studio --cfg $(PVS_CFG) --sourcetree-root $(top_srcdir) --skip-cl-exe yes --source-file $(srcdir)/sample_plugin.c --i-file $< --output-file $@