-
Notifications
You must be signed in to change notification settings - Fork 15
/
Makefile.am
167 lines (140 loc) · 7.41 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
# Definitions for sub-makes
if DEBUG
export OPTIMISATION = -DDEBUG -ggdb -fstack-protector-explicit
else
export OPTIMISATION = -DNDEBUG -Ofast -g
endif
export WARNINGS = -Wall -Wextra -Wconversion -Wsign-compare -Wsign-conversion -Wpedantic
export AM_CFLAGS = -std=c17 $(INCLUDES) $(WARNINGS) $(OPTIMISATION) -D_GNU_SOURCE -D_FORTIFY_SOURCE=2 -Wl,-z,relro,-z,now
export AM_CXXFLAGS = -std=c++17 $(INCLUDES) $(WARNINGS) $(OPTIMISATION) -D_GNU_SOURCE -D_FORTIFY_SOURCE=2 -Wl,-z,relro,-z,now
if ENABLE_EXTRA_VERSION
export AM_CFLAGS += -DEXTRA_VERSION=\"${EXTRA_VERSION}\"
export AM_CXXFLAGS += -DEXTRA_VERSION=\"${EXTRA_VERSION}\"
endif
AM_LDFLAGS = -Wl,-z,relro,-z,now
export CACHEDIR="$(DESTDIR)/var/cache/ffmpegfs"
SUBDIRS = src test
dist_man_MANS = ffmpegfs.1
MAINTAINERCLEANFILES = ffmpegfs.1
EXTRA_DIST = INSTALL.md README.md HISTORY.md PROBLEMS.md FEATURES.md COPYING.CC0 ffmpegfs.1.txt src/makehelp.sh
#CLEANFILES =
ffmpegfs.1: ffmpegfs.1.txt
$(AM_V_GEN)a2x -a revnumber="$(VERSION)" \
-a revdate="$(shell date +'%B %Y')" -f manpage -D . --xsltproc-opts="-param ulink.show 1" $<
# Just for the fun of it
# PDF help - needs FOP
ffmpegfs.1.pdf: ffmpegfs.1.txt
$(AM_V_GEN)a2x -a revnumber="$(VERSION)" \
-a revdate="$(shell date +'%B %Y')" -f pdf --fop --xsltproc-opts="-param ulink.show 1" $<
#--xsltproc-opts="-param ulink.show 0"
help-pdf: ffmpegfs.1.pdf
# HTML help
ffmpegfs.1.htmlhelp: ffmpegfs.1.txt
$(AM_V_GEN)a2x -a revnumber="$(VERSION)" \
-a revdate="$(shell date +'%B %Y')" -D "`pwd`" -f htmlhelp $<
@mv ffmpegfs.1.htmlhelp/index.html ffmpegfs.1.htmlhelp/manpages.html
help-html: ffmpegfs.1.htmlhelp
# Remove absolutely every generated file
.PHONY: squeaky-clean
squeaky-clean: maintainer-clean
rm -rf aclocal.m4 autom4te.cache config config.log configure ffmpegfs.1 ffmpegfs.1.hhc ffmpegfs.1.hhp ffmpegfs.1.htmlhelp ffmpegfs.1.pdf ffmpegfs.1.text ffmpegfs.layout Makefile.in src/config.h.in src/.deps src/ffmpegfshelp.h src/Makefile.in src/vcd/.deps test/.deps test/Makefile.in
dist-hook:
if NOCHANGELOG
@echo 'Not generating ChangeLog'
else
@echo 'Creating ChangeLog file from git log'
@( set -o pipefail && \
echo 'Automatically generated by Makefile' ; echo ; \
git log --pretty="format:%d %h / %aD%n %an <%ae>%n * %s%n" \
| sed -E -e 'N;N;N' \
-e 's|^ \(.*tag: ([0-9\.]+).*\)[^\n]* (.{5,6} [0-9]{4}) .*|Changes for version \1 (\2):\n|' \
-e 's|^ \(.*\)||' ) > ChangeLog.tmp \
&& mv -f ChangeLog.tmp $(top_distdir)/ChangeLog \
|| ( rm -f ChangeLog.tmp ; exit 1 )
endif
SRCS = $(OBJS:.o=.c)
#.PHONY: all distclean doxy cppcheck
# If makefile changes, maybe the list of sources has changed, so update doxygens list
doxyfile.inc: Doxyfile Makefile
@echo "PROJECT_NAME = \"FFmpegfs Fuse Multi Media Filesystem\"" > doxyfile.inc
@echo "OUTPUT_DIRECTORY = doxygen" >> doxyfile.inc
@echo "PREDEFINED = USE_LIBBLURAY" >> doxyfile.inc
@echo "PREDEFINED += USE_LIBDVD" >> doxyfile.inc
@echo "PREDEFINED += USE_LIBVCD" >> doxyfile.inc
@echo "INPUT = $(SUBDIRS)" >> doxyfile.inc
@echo "FILE_PATTERNS = *.h *.cc $(SRCS)" >> doxyfile.inc
@echo "EXCLUDE = src/config.h" >> doxyfile.inc
@echo "EXCLUDE += src/ffmpegfshelp.h" >> doxyfile.inc
@echo "EXCLUDE += doxyfile.inc" >> doxyfile.inc
@echo "HTML_EXTRA_FILES += ffmpegfs.1.htmlhelp/manpages.html" >> doxyfile.inc
@echo "HTML_EXTRA_FILES += ffmpegfs.1.htmlhelp/docbook-xsl.css" >> doxyfile.inc
@echo "INPUT += README.md" >> doxyfile.inc
@echo "INPUT += INSTALL.md" >> doxyfile.inc
@echo "INPUT += HISTORY.md" >> doxyfile.inc
@echo "INPUT += PROBLEMS.md" >> doxyfile.inc
@echo "INPUT += FEATURES.md" >> doxyfile.inc
@echo "EXAMPLE_PATH += NEWS" >> doxyfile.inc
@echo "EXAMPLE_PATH += TODO" >> doxyfile.inc
@echo "EXAMPLE_PATH += COPYING" >> doxyfile.inc
@echo "EXAMPLE_PATH += COPYING.DOC" >> doxyfile.inc
@echo "EXAMPLE_PATH += COPYING.CC0" >> doxyfile.inc
@echo "RECURSIVE = YES" >> doxyfile.inc
@echo "SOURCE_BROWSER = YES" >> doxyfile.inc
@echo "DISTRIBUTE_GROUP_DOC = YES" >> doxyfile.inc
@echo "REFERENCED_BY_RELATION = YES" >> doxyfile.inc
@echo "REFERENCES_RELATION = YES" >> doxyfile.inc
@echo "EXTRACT_STATIC = YES" >> doxyfile.inc
@echo "EXTRACT_PRIVATE = YES" >> doxyfile.inc
@echo "PROJECT_NUMBER = ${VERSION}" >> doxyfile.inc
# Run doxygen, first render Github markdown documents, see https://developer.github.com/v3/markdown/#render-an-arbitrary-markdown-document
doxy: doxyfile.inc ffmpegfs.1.htmlhelp $(SRCS)
@doxygen Doxyfile
# Clean up Doxygen files
doxy-clean:
rm -Rf doxyfile.inc doxygen doxygen.log
# Clean up extra stuff
clean-local: doxy-clean
rm -Rf ffmpegfs.1.htmlhelp ffmpegfs.1 ffmpegfs.1.hhc ffmpegfs.1.hhp ffmpegfs.1.pdf ffmpegfs.1.text src/ffmpegfshelp.h
# Really clean up everything
wipe-all: doxy-clean distclean
rm -Rf autom4te.cache configure config aclocal.m4 Makefile.in test/Makefile.in test/.deps src/Makefile.in src/config.h.in src/.deps src/vcd/.deps src/config.h.in ffmpegfs.layout
# Run cppcheck
cppcheck:
cppcheck --inline-suppr --force --enable=all --inconclusive --library=posix --output-file=cppcheck.log --suppressions-list=cppcheck-suppressions.txt -I src/ -I src/vcd/ -DUSE_LIBBLURAY -DUSE_LIBDVD -DUSE_LIBVCD -DHAVE_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -DUSE_LIBSWRESAMPLE -DLAVU_DEP_OLD_CHANNEL_LAYOUT=1 -D__GNUC_ -DPACKAGE_NAME="FFmpegfs" -DFFMPEFS_VERSION=\"V0.0\" -U__clang_version__ -UPRESCAN_FRAMES -DEXTRA_VERSION="" src/ src/vcd/
# android- Checks related to Android.
# boost- Checks related to Boost library.
# bugprone- Checks that target bugprone code constructs.
CLANGCHECKS = bugprone-*,-bugprone-branch-clone
# cert- Checks related to CERT Secure Coding Guidelines.
CLANGCHECKS += ,cert-*,-cert-err09-cpp,-cert-err61-cpp,-cert-err58-cpp
# cppcoreguidelines- Checks related to C++ Core Guidelines.
# clang-analyzer- Clang Static Analyzer checks.
CLANGCHECKS += ,clang-analyzer-*
# google- Checks related to Google coding conventions.
# hicpp- Checks related to High Integrity C++ Coding Standard.
# llvm- Checks related to the LLVM coding conventions.
# misc- Checks that we didn’t have a better category for.
# modernize- Checks that advocate usage of modern (currently “modern” means “C++11”) language constructs.
CLANGCHECKS += ,modernize-*,-modernize-use-trailing-return-type,-modernize-use-auto
CLANGCHECKS += ,-modernize-use-using
# mpi- Checks related to MPI (Message Passing Interface).
# performance- Checks that target performance-related issues.
CLANGCHECKS += ,performance-*
# readability- Checks that target readability-related issues that don’t relate to any particular coding style.
CLANGTIDY = clang-tidy -extra-arg="--std=c++17" -warnings-as-errors='*' --checks='$(CLANGCHECKS)' --quiet
lint:
$(CLANGTIDY) src/*.c* src/vcd/*.c* -- -Isrc -Isrc/vcd -I/usr/include/chardet -DHAVE_CONFIG_H -D_FILE_OFFSET_BITS=64 -DUSE_LIBDVD -DUSE_LIBBLURAY -DUSE_LIBVCD -D_GNU_SOURCE > lint.log
install-exec-hook:
@if [ -d "$(CACHEDIR)" ]; \
then \
echo "$(CACHEDIR) already exists."; \
else \
echo "Creating cache in $(CACHEDIR)."; \
mkdir -p $(CACHEDIR) || true; \
fi
uninstall-hook:
@if [ -d "$(CACHEDIR)" ]; \
then \
echo "Removing cache directory $(CACHEDIR)."; \
rm -Rf "$(CACHEDIR)" || true; \
fi