-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.am
482 lines (431 loc) · 17.6 KB
/
Makefile.am
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
# -*- OpenSAF -*-
#
# (C) Copyright 2008 The OpenSAF Foundation
# Copyright Ericsson AB 2009, 2017 - All Rights Reserved.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. This file and program are licensed
# under the GNU Lesser General Public License Version 2.1, February 1999.
# The complete license can be accessed from the following location:
# http://opensource.org/licenses/lgpl-license.php
# See the Copying file included with the OpenSAF distribution for full
# licensing terms.
#
# Author(s): Wind River Systems
# Ericsson AB
#
MAINTAINERCLEANFILES = \
Makefile.in \
aclocal.m4 \
compile \
config.guess \
config.sub \
configure \
depcomp \
install-sh \
ltmain.sh \
m4/libtool.m4 \
m4/ltoptions.m4 \
m4/ltsugar.m4 \
m4/ltversion.m4 \
m4/lt~obsolete.m4 \
missing \
py-compile \
src/osaf/config.h.in \
test-driver
CLEANFILES = \
cppcheck.xml \
cppcheck_includes.txt \
lib/$(PACKAGE_NAME)-$(host_cpu).conf \
osafdir.conf \
osafdir.conf-t \
src/osaf/configmake.h \
src/osaf/ssl_libs.cc
CORE_INCLUDES = \
-I$(top_builddir)/src -I$(top_srcdir)/src
AM_CPPFLAGS = \
-pthread \
-D_GNU_SOURCE -DINTERNAL_VERSION_ID='"@INTERNAL_VERSION_ID@"' \
$(CORE_INCLUDES) \
$(all_includes)
AM_CFLAGS = -pipe -std=gnu11 @OSAF_HARDEN_FLAGS@ -Wall -Wformat=2 -Werror
AM_CXXFLAGS = -pipe -std=gnu++11 @OSAF_HARDEN_FLAGS@ -Wall -Wformat=2 -Werror
if ENABLE_GCOV
AM_CFLAGS += --coverage
AM_CXXFLAGS += --coverage
endif
AM_LDFLAGS = @OSAF_HARDEN_FLAGS@ -Wl,--as-needed -ldl -lrt -pthread -rdynamic
ACLOCAL_AMFLAGS = -I m4
OSAF_LIB_FLAGS =
FORMAT = "text"
systemdversion = $(systemdmodversion)
#
# Define some useful directory prefixes/suffixes
#
pkgsysconfdir = $(sysconfdir)/$(PACKAGE_NAME)
pkglocalstatedir = $(localstatedir)/lib/$(PACKAGE_NAME)
pkgpiddir = $(localstatedir)/run/$(PACKAGE_NAME)
pkglogdir = $(localstatedir)/log/$(PACKAGE_NAME)
pkgconfigdir = $(libdir)/pkgconfig
pkgimmxmldir = $(pkgdatadir)/immxml
pkgimmxml_svcdir = $(pkgimmxmldir)/services
pkgclcclidir = $(pkglibdir)/clc-cli
pkgclmscriptsdir = $(pkglibdir)/clm-scripts
docdir = $(datadir)/doc/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
javadir = $(datadir)/java
javadocdir = $(datadir)/javadoc
lsbinitdir = $(initscriptdir)
systemddir = $(systemdsystemunitdir)
lockdir = $(localstatedir)/lock/subsys
pkgpyosafdir = $(pythondir)/pyosaf
pkgpyosafutilsdir = $(pythondir)/pyosaf/utils
pkgpyosafutilsimmomdir = $(pythondir)/pyosaf/utils/immom
pkgpyosafutilsclmdir = $(pythondir)/pyosaf/utils/clm
pkgpyosafutilslogdir = $(pythondir)/pyosaf/utils/log
pkgpyosafutilsimmoidir = $(pythondir)/pyosaf/utils/immoi
pkgpyosafutilsntfdir = $(pythondir)/pyosaf/utils/ntf
osaf_execbindir = $(pkglibdir)
osaf_libdir = $(pkglibdir)
BUILT_SOURCES =
DEFAULT_INCLUDES =
EXTRA_DIST =
SUBDIRS =
TESTS =
bin_PROGRAMS =
dist_bin_SCRIPTS =
dist_doc_DATA =
dist_lsbinit_SCRIPTS =
nodist_lsbinit_SCRIPTS =
dist_osaf_execbin_SCRIPTS =
dist_pkgimmxml_svc_DATA =
dist_pkgsysconf_DATA =
dist_sysconf_DATA =
dist_systemd_DATA =
include_HEADERS =
lib_LTLIBRARIES =
lib_libopensaf_core_la_CPPFLAGS =
lib_libopensaf_core_la_LDFLAGS =
lib_libopensaf_core_la_LIBADD =
lib_libopensaf_core_la_SOURCES =
nodist_java_DATA =
nodist_osaf_execbin_SCRIPTS =
nodist_pkgclccli_SCRIPTS =
dist_pkgclmscripts_SCRIPTS =
nodist_pkgsysconf_DATA =
noinst_HEADERS =
noinst_LTLIBRARIES =
osaf_execbin_PROGRAMS =
osaf_lib_LTLIBRARIES =
pkgconfig_DATA =
pkginclude_HEADERS =
pkglib_LTLIBRARIES =
sbin_PROGRAMS =
nodist_pkgsysconf_DATA += \
$(top_builddir)/osafdir.conf
pkgconfig_DATA += pkgconfig/opensaf.pc
BUILT_SOURCES += src/osaf/configmake.h osafdir.conf src/osaf/ssl_libs.cc
EXTRA_DIST += samples scripts/create_empty_library
dist_doc_DATA += \
$(top_srcdir)/00-README.conf \
$(top_srcdir)/00-README.debug \
$(top_srcdir)/00-README.samples \
$(top_srcdir)/00-README.uml \
$(top_srcdir)/00-README.unittest \
$(top_srcdir)/AUTHORS \
$(top_srcdir)/COPYING.LIB \
$(top_srcdir)/ChangeLog \
$(top_srcdir)/INSTALL \
$(top_srcdir)/NEWS \
$(top_srcdir)/README \
$(top_srcdir)/THANKS
dist_osaf_execbin_SCRIPTS += \
$(top_srcdir)/scripts/opensaf_reboot \
$(top_srcdir)/scripts/opensaf_sc_active \
$(top_srcdir)/scripts/opensaf_scale_out \
$(top_srcdir)/scripts/plm_scale_out \
$(top_srcdir)/scripts/tipc-config
include $(top_srcdir)/src/ais/Makefile.am
include $(top_srcdir)/src/base/Makefile.am
include $(top_srcdir)/src/osaf/Makefile.am
include $(top_srcdir)/src/experimental/Makefile.am
include $(top_srcdir)/src/amf/Makefile.am
include $(top_srcdir)/src/ckpt/Makefile.am
include $(top_srcdir)/src/clm/Makefile.am
include $(top_srcdir)/src/dtm/Makefile.am
include $(top_srcdir)/src/evt/Makefile.am
include $(top_srcdir)/src/fm/Makefile.am
include $(top_srcdir)/src/imm/Makefile.am
include $(top_srcdir)/src/lck/Makefile.am
include $(top_srcdir)/src/libjava/Makefile.am
include $(top_srcdir)/src/log/Makefile.am
include $(top_srcdir)/src/mbc/Makefile.am
include $(top_srcdir)/src/mds/Makefile.am
include $(top_srcdir)/src/msg/Makefile.am
include $(top_srcdir)/src/nid/Makefile.am
include $(top_srcdir)/src/ntf/Makefile.am
include $(top_srcdir)/src/plm/Makefile.am
include $(top_srcdir)/src/rde/Makefile.am
include $(top_srcdir)/src/smf/Makefile.am
include $(top_srcdir)/java/Makefile.am
include $(top_srcdir)/python/Makefile.am
check_PROGRAMS = $(TESTS)
# Retrieve values of the variables through 'configure' followed by
# 'make', not directly through 'configure', so that a user who
# sets some of these variables consistently on the 'make' command
# line gets correct results.
#
# One advantage of this approach, compared to the classical
# approach of adding -DLIBDIR=\"$(libdir)\" etc. to AM_CPPFLAGS,
# is that it protects against the use of undefined variables.
# If, say, $(libdir) is not set in the Makefile, LIBDIR is not
# defined by this module, and code using LIBDIR gives a
# compilation error.
#
# Another advantage is that 'make' output is shorter.
#
# Listed in the same order as the GNU makefile conventions.
# The Automake-defined pkg* macros are appended, in the order
# listed in the Automake 1.10a+ documentation.
src/osaf/configmake.h: Makefile
@rm -f $@-t $@
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
echo '#define PREFIX "$(prefix)"'; \
echo '#define EXEC_PREFIX "$(exec_prefix)"'; \
echo '#define BINDIR "$(bindir)"'; \
echo '#define SBINDIR "$(sbindir)"'; \
echo '#define LIBEXECDIR "$(libexecdir)"'; \
echo '#define DATAROOTDIR "$(datarootdir)"'; \
echo '#define DATADIR "$(datadir)"'; \
echo '#define SYSCONFDIR "$(sysconfdir)"'; \
echo '#define SHAREDSTATEDIR "$(sharedstatedir)"'; \
echo '#define LOCALSTATEDIR "$(localstatedir)"'; \
echo '#define INCLUDEDIR "$(includedir)"'; \
echo '#define OLDINCLUDEDIR "$(oldincludedir)"'; \
echo '#define DOCDIR "$(docdir)"'; \
echo '#define INFODIR "$(infodir)"'; \
echo '#define HTMLDIR "$(htmldir)"'; \
echo '#define DVIDIR "$(dvidir)"'; \
echo '#define PDFDIR "$(pdfdir)"'; \
echo '#define PSDIR "$(psdir)"'; \
echo '#define LIBDIR "$(libdir)"'; \
echo '#define LISPDIR "$(lispdir)"'; \
echo '#define LOCALEDIR "$(localedir)"'; \
echo '#define MANDIR "$(mandir)"'; \
echo '#define MANEXT "$(manext)"'; \
echo '#define PKGDATADIR "$(pkgdatadir)"'; \
echo '#define PKGINCLUDEDIR "$(pkgincludedir)"'; \
echo '#define PKGLIBDIR "$(pkglibdir)"'; \
echo '#define PKGLIBEXECDIR "$(pkglibexecdir)"'; \
echo '#define PKGSYSCONFDIR "$(pkgsysconfdir)"'; \
echo '#define PKGLOCALSTATEDIR "$(pkglocalstatedir)"'; \
echo '#define PKGPIDDIR "$(pkgpiddir)"'; \
echo '#define PKGLOGDIR "$(pkglogdir)"'; \
echo '#define PKGCONFDIR "$(pkgconfigdir)"'; \
echo '#define PKGIMMXMLDIR "$(pkgimmxmldir)"'; \
echo '#define PKGIMMXMLSVCDIR "$(pkgimmxml_svcdir)"'; \
echo '#define PKGCLCCLIDIR "$(pkgclcclidir)"'; \
echo '#define PKGCLMSCRIPTDIR "$(pkgclmscriptsdir)"'; \
echo '#define JAVADIR "$(javadir)"'; \
echo '#define JAVADOCDIR "$(javadocdir)"'; \
echo '#define LSBINITDIR "$(lsbinitdir)"'; \
echo '#define LOCKDIR "$(lockdir)"'; \
} | sed '/""/d' > $@-t
mv $@-t $@
osafdir.conf: src/osaf/configmake.h
@rm -f $@-t $@
@cp src/osaf/configmake.h $@-t
@sed -i 's|\#define ||g' $@-t
@sed -i 's| \"|=\"|g' $@-t
@sed -i -e 's|\/\* |\# |g' -e 's| \*\/||g' $@-t
@sed -i 1i"#!/bin/sh" $@-t
sed -e 's/\(.*\)/\L\1/' $@-t > $@
src/osaf/ssl_libs.cc: Makefile
@rm -f $@-t $@
@{ echo " \"$$(ldd $$(which openssl) | cut -d= -f1 | grep libcrypto.so | tr -d '\t ')\","; \
echo " \"libcrypto.so\","; \
echo " \"libcrypto.so.1.1.0\","; \
echo " \"libcrypto.so.1.0.0\","; \
echo " \"libcrypto.so.0.9.8\","; \
} | sort -Vr | uniq > $@-t
mv $@-t $@
if ENABLE_RPM_TARGET
RPMTOPDIR = `pwd`/rpms
RPMSOURCEDIR = $(RPMTOPDIR)/SOURCES
RPMSPECDIR = $(RPMTOPDIR)/SPECS
SRPMDIR = $(RPMTOPDIR)/SRPMS
RPMDIR = $(RPMTOPDIR)/RPMS
prep-rpm-dir: dist
mkdir -p $(RPMTOPDIR)
mkdir -p $(RPMTOPDIR)/{BUILD,RPMS,SOURCES,SPECS,SRPMS,tmp}
cp $(top_builddir)/$(PACKAGE_NAME).spec $(RPMSPECDIR)
cp $(top_builddir)/$(PACKAGE_NAME)-$(VERSION).tar.gz $(RPMSOURCEDIR)
srpm: prep-rpm-dir
rpmbuild -bs --rmspec --rmsource \
--define "_topdir $(RPMTOPDIR)" --define "_tmppath $(RPMTOPDIR)/tmp" \
$(RPMSPECDIR)/$(PACKAGE_NAME).spec
rpm: prep-rpm-dir
rpmbuild -bb --clean --rmspec --rmsource \
--define "_topdir $(RPMTOPDIR)" --define "_tmppath $(RPMTOPDIR)/tmp" \
$(RPMSPECDIR)/$(PACKAGE_NAME).spec
endif
all-local:
mkdir -p $(top_builddir)/lib
echo "$(pkglibdir)" > $(top_builddir)/lib/$(PACKAGE_NAME)-$(host_cpu).conf
install-data-local:
$(mkinstalldirs) $(DESTDIR)$(pkglogdir)
$(mkinstalldirs) $(DESTDIR)$(pkglogdir)/saflog
$(mkinstalldirs) $(DESTDIR)$(pkgpiddir)
$(mkinstalldirs) $(DESTDIR)$(lockdir)
$(mkinstalldirs) $(DESTDIR)$(pkglocalstatedir)
$(mkinstalldirs) $(DESTDIR)$(pkgdatadir)
cp -R $(top_srcdir)/samples/ $(DESTDIR)$(pkgdatadir)
if ENABLE_JAVA
$(mkinstalldirs) $(DESTDIR)$(javadocdir)/$(PACKAGE_NAME)
@builddir=$$(cd $(top_builddir); pwd; cd - > /dev/null); \
cd java/ais_api/javadoc; \
for file in `find . -name \*`; do \
$(INSTALL) -D -m 644 "$$builddir/java/ais_api/javadoc/$$file" "$(DESTDIR)$(javadocdir)/$(PACKAGE_NAME)/$$file.txt"; \
done; \
cd -
endif
set-default-node-config:
@echo "*** Setting default controller node configuration ***"
echo "2" > $(DESTDIR)$(pkgsysconfdir)/chassis_id
echo "0" > $(DESTDIR)$(pkgsysconfdir)/slot_id
echo "15" > $(DESTDIR)$(pkgsysconfdir)/subslot_id
echo "controller" > $(DESTDIR)$(pkgsysconfdir)/node_type
install-data-hook: set-default-node-config
@for i in $$(grep -lr -e 'xxLIBDIRxx' -e 'xxLOGDIRxx' -e 'xxCLCCLIDIRxx' $(DESTDIR)$(pkgimmxml_svcdir)/*.xml) ; do \
sed -i 's|xxLIBDIRxx|$(pkglibdir)|g' "$$i"; \
sed -i 's|xxCLCCLIDIRxx|$(pkgclcclidir)|g' "$$i"; \
sed -i 's|xxCLMSCRIPTDIRxx|$(pkgclmscriptsdir)|g' "$$i"; \
sed -i 's|xxLOGDIRxx|$(pkglogdir)|g' "$$i"; \
done
@for i in $$(grep -lr -e 'xxBINDIRxx' -e 'xxLIBDIRxx' -e 'xxCLCCLIDIRxx' $(DESTDIR)$(pkgsysconfdir)/*) ; do \
sed --follow-symlinks -i 's|xxBINDIRxx|$(bindir)|g' "$$i"; \
sed --follow-symlinks -i 's|xxLIBDIRxx|$(pkglibdir)|g' "$$i"; \
sed --follow-symlinks -i 's|xxCLCCLIDIRxx|$(pkgclcclidir)|g' "$$i"; \
sed --follow-symlinks -i 's|xxCLMSCRIPTDIRxx|$(pkgclmscriptsdir)|g' "$$i"; \
done
hostname -s > $(DESTDIR)$(pkgsysconfdir)/node_name
if !ENABLE_AIS_PLM
sed -i '/plmd/d' $(DESTDIR)$(pkgsysconfdir)/nodeinit.conf.controller
endif
if ENABLE_SYSTEMD
if [ ${systemdmodversion} -gt 204 ]; then \
sed -i '/ControlGroup/d' $(DESTDIR)$(systemddir)/opensafd.service; \
fi
endif
install-exec-hook:
@libs=""; \
for i in $(lib_LTLIBRARIES); do \
l=$$(basename "$$i" .la); \
test $$(echo "$$l" | cut -c1-5) = "libSa" && \
libs="$$libs $$l"; \
done; \
srcdir=$$(cd $(top_srcdir); pwd; cd - > /dev/null); \
for i in $$libs; do \
sofile=$(DESTDIR)$(libdir)/$$i.so; \
mapfile=$$(bash -c "ls -1 $$srcdir/src/ais/lib/$$i.map"); \
bash $$srcdir/scripts/create_empty_library "$$sofile" "$$mapfile"; \
done
uninstall-hook:
rm -f $(DESTDIR)$(pkgsysconfdir)/node_name
-rm -rf $(DESTDIR)$(pkgsysconfdir)
-rm -rf $(DESTDIR)$(pkgincludedir)
-rm -rf $(DESTDIR)$(pkglibdir)
-rm -rf $(DESTDIR)$(docdir)
-rm -rf $(DESTDIR)$(pkgdatadir)
-rm -rf $(DESTDIR)$(pkglocalstatedir)
-rm -rf $(DESTDIR)$(pkglogdir)
-rm -rf $(DESTDIR)$(pkgpiddir)
if ENABLE_JAVA
-rm -rf $(DESTDIR)$(javadocdir)/$(PACKAGE_NAME)
-rm -rf $(DESTDIR)$(javadir)
if ENABLE_AM4J
-rm -rf $(DESTDIR)$(javadir)
endif
endif
docs:
doxygen
cppcheck_includes.txt:
@builddir=$$(cd $(top_builddir); pwd; cd - > /dev/null); \
srcdir=$$(cd $(top_srcdir); pwd; cd - > /dev/null); \
echo "src" > "$$builddir/cppcheck_includes.txt"; \
cd "$$srcdir"; find "src" -type d -name saf >> "$$builddir/cppcheck_includes.txt"; \
echo "$$builddir/src" >> "$$builddir/cppcheck_includes.txt"
cppcheck.xml: cppcheck_includes.txt
@builddir=$$(cd $(top_builddir); pwd; cd - > /dev/null); \
srcdir=$$(cd $(top_srcdir); pwd; cd - > /dev/null); \
cd "$$srcdir"; cppcheck -DSA_EXTENDED_NAME_SOURCE -D__USE_GNU -DIMMA_OI -DIMMA_OM -DASAPi_DEBUG=1 -DHAVE_CONFIG_H -DNCS_CPD=1 -DNCS_CPND=1 -DNCSL_ENV_INIT_HM=1 -DNCSL_ENV_INIT_TMR=1 -DNCS_MQD=1 -DNCS_MQND=1 -DRLIMIT_RTPRIO -DTIPC_SUB_CANCEL -DENABLE_AIS_PLM -DLIBXML_SAX1_ENABLED -DLIBXML_XPATH_ENABLED --enable=all --includes-file="$$builddir/cppcheck_includes.txt" --inline-suppr --library=gnu.cfg --library=posix.cfg --xml-version=2 src cppcheck_append.cc 2> "$$builddir/cppcheck.xml"
@echo "The result can be found in the file cppcheck.xml"
@echo "Use the follwing command to view it: cppcheck-gui cppcheck.xml"
cppcheck: cppcheck_includes.txt
@builddir=$$(cd $(top_builddir); pwd; cd - > /dev/null); \
srcdir=$$(cd $(top_srcdir); pwd; cd - > /dev/null); \
cd "$$srcdir"; cppcheck -DSA_EXTENDED_NAME_SOURCE -D__USE_GNU -DIMMA_OI -DIMMA_OM -DASAPi_DEBUG=1 -DHAVE_CONFIG_H -DNCS_CPD=1 -DNCS_CPND=1 -DNCSL_ENV_INIT_HM=1 -DNCSL_ENV_INIT_TMR=1 -DNCS_MQD=1 -DNCS_MQND=1 -DRLIMIT_RTPRIO -DTIPC_SUB_CANCEL -DENABLE_AIS_PLM -DLIBXML_SAX1_ENABLED -DLIBXML_XPATH_ENABLED --enable=all --includes-file="$$builddir/cppcheck_includes.txt" --inline-suppr --library=gnu.cfg --library=posix.cfg src cppcheck_append.cc
cpplint:
@test -d $(top_builddir)/bin || mkdir $(top_builddir)/bin
@cpplint=$$(find $(top_builddir)/bin -name cpplint.py -mtime -30); \
test -z "$$cpplint" && wget -O $(top_builddir)/bin/cpplint.py https://raw.githubusercontent.com/google/styleguide/gh-pages/cpplint/cpplint.py 2>&1 && touch $(top_builddir)/bin/cpplint.py; \
builddir=$$(cd $(top_builddir); pwd; cd - > /dev/null); \
srcdir=$$(cd $(top_srcdir); pwd; cd - > /dev/null); \
cd "$$srcdir"; find samples src \( -name '*.[CH]' -o -name '*.hh' -o -name '*.[ch]pp' -o -name '*.[ch]xx' \) -exec echo "Invalid file name: {}" \; 1>&2; \
cd "$$srcdir"; find samples src -name '*.h' | \
grep -v src/ais/include | \
grep -v src/osaf/config > "$$builddir/cpplint_files.txt"; \
cd "$$srcdir"; find samples src -name '*.cc' >> "$$builddir/cpplint_files.txt"; \
python "$$builddir/bin/cpplint.py" --root=src --extensions=cc,h $$(cat "$$builddir/cpplint_files.txt"); \
true
shellcheck:
@builddir=$$(cd $(top_builddir); pwd; cd - > /dev/null); $(MAKE) install DESTDIR="$$builddir/tmpinstall" 2>&1; \
cd "$$builddir/tmpinstall"; files=$$(grep --exclude-dir=cluster_sim_uml --exclude-dir='.[a-zA-Z0-9]*' -E '^#\! */bin/(ba)?sh' -rlI *); \
if test -n "$$files"; then \
shellcheck --shell=sh $$files 1>&2; \
fi; \
true
checkpatch:
@test -d $(top_builddir)/bin || mkdir $(top_builddir)/bin
@checkpatch=$$(find $(top_builddir)/bin -name checkpatch.pl -mtime -30); \
test -z "$$checkpatch" && wget -O $(top_builddir)/bin/checkpatch.pl https://raw.githubusercontent.com/torvalds/linux/master/scripts/checkpatch.pl 2>&1 && touch $(top_builddir)/bin/checkpatch.pl; \
test -z "$$checkpatch" && wget -O $(top_builddir)/bin/spelling.txt https://raw.githubusercontent.com/torvalds/linux/master/scripts/spelling.txt 2>&1 && echo __dummy_struct__ > $(top_builddir)/bin/const_structs.checkpatch; \
builddir=$$(cd $(top_builddir); pwd; cd - > /dev/null); \
cd "$$srcdir"; find samples src -name '*.c' > "$$builddir/checkpatch_files.txt"; \
perl "$$builddir/bin/checkpatch.pl" --no-tree --file --ignore SPLIT_STRING --summary-file $$(cat "$$builddir/checkpatch_files.txt") 1>&2; \
true
pylint:
@srcdir=$$(cd $(top_srcdir); pwd; cd - > /dev/null); \
cd "$$srcdir/python"; find . -name '*.py' | xargs pylint --rcfile=pylintrc --output-format=$(FORMAT) > pylint.res; \
true
@echo "The pylint result can be found in the file python/pylint.res"
.PHONY: cppcheck.xml cppcheck cpplint shellcheck checkpatch pylint
clean-local:
-rm -f $(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.gz
-rm -rf $(top_builddir)/tmpinstall
if ENABLE_RPM_TARGET
-rm -rf $(RPMTOPDIR)/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS,tmp}
endif
if ENABLE_JAVA
$(ANT) -f $(top_srcdir)/java/ais_api/build.xml clean
-rm -rf $(top_builddir)/java/ais_api/javadoc $(top_builddir)/java/ais_api/bin
$(ANT) -f $(top_srcdir)/java/ais_api_impl/build.xml clean
-rm -rf $(top_builddir)/java/ais_api_impl/bin
if ENABLE_AM4J
$(ANT) -f $(top_srcdir)/java/amf_agent/build.xml clean
-rm -rf $(top_builddir)/java/amf_agent/bin
endif
endif
distclean-local:
-rm -f $(top_builddir)/docs $(top_builddir)/rpms $(top_builddir)/bin $(top_builddir)/lib
maintainer-clean-local:
-rm -f $(top_builddir)/autom4te.cache
java/ais_api_impl/bin/opensaf_ais_api.jar:
$(ANT) -f $(top_srcdir)/java/ais_api_impl/build.xml build-jar
$(ANT) -f $(top_srcdir)/java/ais_api/build.xml javadocAPI
java/amf_agent/bin/amf_agent.jar:
$(ANT) -f $(top_srcdir)/java/amf_agent/build.xml build-jar -Dam4j_api.location=$(AM4J_API_JAR)
installlibLTLIBRARIES = install-libLTLIBRARIES
$(installlibLTLIBRARIES): install-osaf_libLTLIBRARIES
installpkglibLTLIBRARIES = install-pkglibLTLIBRARIES
$(installpkglibLTLIBRARIES): install-libLTLIBRARIES