forked from coreos/rpm-ostree
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.am
122 lines (104 loc) · 4.03 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
# Copyright (C) 2011,2013 Colin Walters <[email protected]>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library 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. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
include Makefile-decls.am
include Makefile-extra.inc
primaryname = rpm-ostree
SUBDIRS += .
if ENABLE_GTK_DOC
SUBDIRS += api-doc
endif
RPM_OSTREE_GITREV=$(shell if command -v git >/dev/null 2>&1 && test -e $(srcdir)/.git; then git describe --abbrev=42 --tags --always HEAD; fi)
ACLOCAL_AMFLAGS += -I m4 ${ACLOCAL_FLAGS}
AM_CPPFLAGS += -DDATADIR='"$(datadir)"' \
-DLIBEXECDIR='"$(libexecdir)"' \
-DLOCALEDIR=\"$(datadir)/locale\" \
-DSYSCONFDIR='"$(sysconfdir)"' \
-DRPM_OSTREE_GITREV='"$(RPM_OSTREE_GITREV)"' \
-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_56 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_70
# Compiler warnings
warnings_skipped = sign-compare
warnings_error = empty-body format=2 format-security format-nonliteral \
missing-declarations return-type switch overflow undef \
misleading-indentation missing-include-dirs unused-result \
$(NULL)
warning_flags = -Wall \
$(patsubst %,-Wno-%,$(warnings_skipped)) \
$(patsubst %,-Werror=%,$(warnings_error)) \
$(NULL)
if BUILDOPT_WERROR
warning_flags += -Werror -Wno-error=deprecated-declarations
endif
# We make some C warnings always a hard error; these should never happen in our code.
# These flags are not valid for C++.
warnings_error_only_c = strict-prototypes missing-prototypes \
implicit-function-declaration int-conversion incompatible-pointer-types \
$(NULL)
sanitizer_flags =
if BUILDOPT_ASAN
sanitizer_flags += -fsanitize=address -fsanitize=undefined -fsanitize-undefined-trap-on-error
endif
# See the AM_CFLAGS in libostree for more information about -fno-strict-aliasing
AM_CFLAGS += -std=gnu11 -fno-strict-aliasing $(warning_flags) $(patsubst %,-Werror=%,$(warnings_error_only_c))
# Our default CXX flags
AM_CXXFLAGS += -std=c++17 -fno-strict-aliasing $(warning_flags) $(sanitizer_flags)
EXTRA_DIST += autogen.sh COPYING
SED_SUBST = sed \
-e 's,[@]libexecdir[@],$(libexecdir),g' \
-e 's,[@]primaryname[@],$(primaryname),g' \
-e 's,[@]bindir[@],$(bindir),g' \
$(NULL)
libglnx_srcpath := $(srcdir)/libglnx
libglnx_cflags := $(PKGDEP_GIO_UNIX_CFLAGS) -I$(libglnx_srcpath) -fvisibility=hidden
libglnx_ldflags :=
libglnx_libs := $(PKGDEP_GIO_UNIX_LIBS)
include $(INTROSPECTION_MAKEFILE)
GIRS =
TYPELIBS = $(GIRS:.gir=.typelib)
# These bits were originally based on gnome:librsvg/Makefile.am
# but have been adapted to non-recursive Automake, and additionally
# the "cargo vendor" bits for us live in packaging/Makefile.dist-packaging.
.PHONY: check-local-cargo clean-local-cargo use-git-not-dist-hook
if RUST_DEBUG
CARGO_RELEASE_ARGS=
else
CARGO_RELEASE_ARGS=--release
endif
check-local-cargo:
cargo test --workspace
CHECK_LOCAL_HOOKS += check-local-cargo
clean-local-cargo:
cargo clean
CLEAN_LOCAL_HOOKS += clean-local-cargo
.PHONY: clang-format
clang-format:
git ls-files '**.c' '**.cxx' '**.h' '**.hpp' | xargs clang-format -i
use-git-not-dist-hook:
@echo
@echo 'ERROR: rpm-ostree does not use/support "make dist"; see packaging/Makefile.dist-packaging' 1>&2
@echo
@exit 1
DIST_HOOKS += use-git-not-dist-hook
include libglnx/Makefile-libglnx.am.inc
noinst_LTLIBRARIES += libglnx.la
include Makefile-libpriv.am
include Makefile-lib.am
include Makefile-daemon.am
include Makefile-rpm-ostree.am
include Makefile-tests.am
include Makefile-man.am
include Makefile-bash.am
-include $(top_srcdir)/git.mk