2011-11-10 13:17:04 -05:00
# Copyright (C) 2011 Colin Walters <walters@verbum.org>
#
2018-01-30 20:26:26 +01:00
# SPDX-License-Identifier: LGPL-2.0+
#
2011-11-10 13:17:04 -05:00
# 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
2021-12-06 20:20:55 -05:00
# License along with this library. If not, see <https://www.gnu.org/licenses/>.
2011-11-10 13:17:04 -05:00
2014-01-03 11:39:27 -05:00
i n c l u d e M a k e f i l e - d e c l s . a m
2015-07-13 18:02:07 -04:00
shortened_sysconfdir = $$ ( echo " $( sysconfdir) " | sed -e 's|^$(prefix)||' -e 's|^/||' )
2017-05-16 21:46:22 -04:00
OSTREE_GITREV = $( shell cd $( srcdir) && if command -v git >/dev/null 2>& 1 && test -d .git; then git describe --abbrev= 42 --tags --always HEAD; fi )
2017-02-17 10:22:43 -05:00
2016-06-26 21:59:12 -04:00
ACLOCAL_AMFLAGS = -I buildutil -I libglnx ${ ACLOCAL_FLAGS }
2014-01-03 11:39:27 -05:00
AM_CPPFLAGS += -DDATADIR= '"$(datadir)"' -DLIBEXECDIR= '"$(libexecdir)"' \
2014-09-08 11:47:58 -04:00
-DLOCALEDIR= \" $( datadir) /locale\" -DSYSCONFDIR= \" $( sysconfdir) \" \
2017-03-27 16:05:46 +02:00
-DTARGET_PREFIX= '"$(prefix)"' -DSHORTENED_SYSCONFDIR= \" $( shortened_sysconfdir) \" \
2013-05-01 19:15:06 -04:00
-DOSTREE_FEATURES= '"$(OSTREE_FEATURES)"' \
2016-05-13 08:08:49 +02:00
-DOSTREE_COMPILATION \
2016-03-26 08:28:20 -07:00
-DG_LOG_DOMAIN= \" OSTree\" \
2017-02-17 10:22:43 -05:00
-DOSTREE_GITREV= '"$(OSTREE_GITREV)"' \
2022-02-17 20:12:18 +01:00
-DGLIB_VERSION_MIN_REQUIRED= GLIB_VERSION_2_66 '-DGLIB_VERSION_MAX_ALLOWED=G_ENCODE_VERSION(2,70)'
2017-12-15 09:20:58 -05:00
# For strict aliasing, see https://bugzilla.gnome.org/show_bug.cgi?id=791622
AM_CFLAGS += -std= gnu99 -fno-strict-aliasing $( WARN_CFLAGS)
2016-09-01 11:26:48 -07:00
AM_DISTCHECK_CONFIGURE_FLAGS += \
--enable-gtk-doc \
--enable-man \
--disable-maintainer-mode \
$( NULL)
2013-08-16 22:54:35 -04:00
2022-02-17 20:12:18 +01:00
i f U S E _ L I B S O U P
AM_CPPFLAGS += -DSOUP_VERSION_MIN_REQUIRED= SOUP_VERSION_2_40 '-DSOUP_VERSION_MAX_ALLOWED=G_ENCODE_VERSION(2,48)'
e n d i f
2016-03-31 15:08:45 -04:00
GITIGNOREFILES = aclocal.m4 build-aux/ buildutil/*.m4 config.h.in gtk-doc.make
2022-05-31 10:58:26 -04:00
# Generated by ci/gh-build.sh
GITIGNOREFILES += ci-build/
2020-05-31 17:57:22 +00:00
# Generated by coreos-assembler build-fast and kola
GITIGNOREFILES += fastbuild-*.qcow2 _kola_temp/
2021-04-15 11:13:31 -04:00
# Rust stuff
GITIGNOREFILES += target/ Cargo.lock
2021-05-20 14:48:16 -06:00
# Jekyll docs
GITIGNOREFILES += \
docs/.bundle/ \
docs/Gemfile.lock \
docs/_site/ \
2021-05-20 16:03:56 -06:00
docs/reference/ \
2021-05-20 14:48:16 -06:00
docs/vendor/ \
$( NULL)
2013-08-16 22:54:35 -04:00
SUBDIRS += .
2013-08-16 23:14:30 -04:00
i f E N A B L E _ G T K _ D O C
2016-01-27 13:29:21 -05:00
SUBDIRS += apidoc
2012-06-07 17:21:55 -04:00
e n d i f
2013-09-11 19:55:24 -04:00
EXTRA_DIST += autogen.sh COPYING README.md
2012-09-25 18:44:08 -04:00
2012-06-07 17:21:55 -04:00
OT_INTERNAL_GIO_UNIX_CFLAGS = $( OT_DEP_GIO_UNIX_CFLAGS)
OT_INTERNAL_GIO_UNIX_LIBS = $( OT_DEP_GIO_UNIX_LIBS)
2022-02-17 20:12:18 +01:00
i f U S E _ L I B S O U P 3
OT_INTERNAL_SOUP_CFLAGS = $( OT_DEP_SOUP3_CFLAGS)
OT_INTERNAL_SOUP_LIBS = $( OT_DEP_SOUP3_LIBS)
e l s e
2012-06-14 16:22:23 -04:00
OT_INTERNAL_SOUP_CFLAGS = $( OT_DEP_SOUP_CFLAGS)
OT_INTERNAL_SOUP_LIBS = $( OT_DEP_SOUP_LIBS)
2022-02-17 20:12:18 +01:00
e n d i f
2012-06-07 17:21:55 -04:00
2015-04-26 18:08:20 -04:00
# This canonicalizes the PKG_CHECK_MODULES or AM_PATH_GPGME results
2019-05-19 16:47:45 +03:00
i f U S E _ G P G M E
2016-02-22 15:04:38 -05:00
OT_INTERNAL_GPGME_CFLAGS = $( OT_DEP_GPGME_CFLAGS) $( GPGME_PTHREAD_CFLAGS)
OT_INTERNAL_GPGME_LIBS = $( OT_DEP_GPGME_LIBS) $( GPGME_PTHREAD_LIBS)
2019-05-19 16:47:45 +03:00
e n d i f
2015-04-26 18:08:20 -04:00
2013-07-26 19:25:07 -04:00
i f B U I L D O P T _ I N T R O S P E C T I O N
i n c l u d e $( INTROSPECTION_MAKEFILE )
GIRS =
TYPELIBS = $( GIRS:.gir= .typelib)
e n d i f
2015-02-17 17:38:36 -05:00
libglnx_srcpath := $( srcdir) /libglnx
libglnx_cflags := $( OT_DEP_GIO_UNIX_CFLAGS) " -I $( libglnx_srcpath) "
libglnx_libs := $( OT_DEP_GIO_UNIX_LIBS)
2017-10-03 21:26:50 +01:00
# See also autogen.sh and https://github.com/ostreedev/ostree/pull/1274/
#
# v2017.12 didn't include test-libglnx-shutil.c, but if you re-run
# autogen.sh (as we do in Debian, to update the Autotools build system)
# it will try to build it.
$(srcdir)/libglnx/Makefile-libglnx.am.inc : $( srcdir ) /libglnx /Makefile -libglnx .am
2017-10-18 16:17:19 +00:00
sed -e 's,$$(libglnx_srcpath),libglnx,g' < $< > $@
2015-02-17 17:38:36 -05:00
i n c l u d e l i b g l n x / M a k e f i l e - l i b g l n x . a m . i n c
2016-05-13 11:01:29 -07:00
EXTRA_DIST += libglnx/Makefile-libglnx.am
2015-02-17 17:38:36 -05:00
noinst_LTLIBRARIES += libglnx.la
2015-02-12 16:24:50 +01:00
libbsdiff_srcpath := $( srcdir) /bsdiff
2017-10-03 21:26:50 +01:00
2015-02-12 16:24:50 +01:00
libbsdiff_cflags := $( OT_DEP_GIO_UNIX_CFLAGS) " -I $( bsdiff_srcpath) "
libbsdiff_libs := $( OT_DEP_GIO_UNIX_LIBS)
2017-10-03 21:26:50 +01:00
# See the comment for the similar libglnx bit above
2017-10-16 16:24:16 +00:00
$(srcdir)/bsdiff/Makefile-bsdiff.am.inc : $( srcdir ) /bsdiff /Makefile -bsdiff .am
2017-10-18 16:17:19 +00:00
sed -e 's,$$(libbsdiff_srcpath),bsdiff,g' < $< > $@
2015-02-12 16:24:50 +01:00
i n c l u d e b s d i f f / M a k e f i l e - b s d i f f . a m . i n c
2016-05-13 11:01:29 -07:00
EXTRA_DIST += bsdiff/Makefile-bsdiff.am
2015-02-12 16:24:50 +01:00
noinst_LTLIBRARIES += libbsdiff.la
2023-05-23 10:31:23 +02:00
LCFS_DEP_CRYPTO_CFLAGS = $( OT_DEP_CRYPTO_CFLAGS)
LCFS_DEP_CRYPTO_LIBS = $( OT_DEP_CRYPTO_LIBS)
2011-11-02 15:45:32 -04:00
i n c l u d e M a k e f i l e - o t u t i l . a m
2023-07-07 16:31:58 -04:00
i n c l u d e M a k e f i l e - o t c o r e . a m
2011-11-02 15:45:32 -04:00
i n c l u d e M a k e f i l e - l i b o s t r e e . a m
i n c l u d e M a k e f i l e - o s t r e e . a m
2012-02-05 16:02:44 -05:00
i n c l u d e M a k e f i l e - s w i t c h r o o t . a m
2016-04-25 13:57:03 +02:00
i f B U I L D O P T _ F U S E
2016-02-10 12:42:54 +01:00
i n c l u d e s r c / r o f i l e s - f u s e / M a k e f i l e - i n c . a m
2016-04-25 13:57:03 +02:00
e n d i f
2013-05-01 15:26:21 -04:00
i n c l u d e M a k e f i l e - t e s t s . a m
2013-10-22 22:04:32 +02:00
i n c l u d e M a k e f i l e - b o o t . a m
2016-01-27 12:51:07 -05:00
i n c l u d e M a k e f i l e - m a n . a m
2017-08-12 01:17:23 +00:00
i n c l u d e M a k e f i l e - b a s h . a m
2013-05-01 15:26:21 -04:00
2012-03-31 12:34:11 -04:00
release-tag :
2017-05-16 21:46:22 -04:00
cd $( srcdir) && git $( srcdir) tag -m " Release $( VERSION) " v$( VERSION)
2012-06-07 17:21:55 -04:00
2023-05-01 13:43:26 -04:00
.PHONY : clang -format
clang-format :
git ls-files '**.c' '**.cxx' '**.h' '**.hpp' | xargs clang-format -i
2012-08-17 20:51:36 -04:00
embed_dependency = tar -C $( srcdir) --append --exclude= '.git/*' --transform= " s,^embedded-dependencies/,ostree-embeddeps- $$ {GITVERSION}/embedded-dependencies/, " --file= $$ { TARFILE_TMP}
2017-05-16 21:46:22 -04:00
git_version_rpm = $$ ( cd $( srcdir) && git describe | sed -e 's,-,\.,g' -e 's,^v,,' )
2012-06-14 16:22:23 -04:00
2012-06-07 17:21:55 -04:00
release-tarball-embedded :
2012-08-17 20:51:36 -04:00
set -x; \
GITVERSION = $( git_version_rpm) ; export GITVERSION; \
TARFILE_TMP = ostree-embeddeps-$$ { GITVERSION} .tar.tmp; \
REV = $$ ( git rev-parse HEAD) ; \
echo " Archiving ostree at $$ {REV} " ; \
( cd $( srcdir) ; git archive --format= tar --prefix= ostree-embeddeps-$$ { GITVERSION} / $$ { REV} ) > $$ { TARFILE_TMP} ; \
( cd $$ ( git rev-parse --show-toplevel) ; git submodule status) | while read line; do \
rev = $$ ( echo $$ line | cut -f 1 -d ' ' ) ; path = $$ ( echo $$ line | cut -f 2 -d ' ' ) ; \
echo " Archiving $$ {path} at $$ {rev} " ; \
( cd $( srcdir) /$$ path; git archive --format= tar --prefix= ostree-embeddeps-$$ { GITVERSION} /$$ path/ $$ { rev} ) > submodule.tar; \
tar -A -f $$ { TARFILE_TMP} submodule.tar; \
rm submodule.tar; \
done ; \
echo "Archiving glib" ; \
$( embed_dependency) embedded-dependencies/glib; \
echo "Archiving libsoup" ; \
$( embed_dependency) embedded-dependencies/libsoup; \
mv ostree-embeddeps-$$ { GITVERSION} .tar{ .tmp,} ; \
gzip -f ostree-embeddeps-$$ { GITVERSION} .tar
2016-03-31 15:08:45 -04:00
2018-10-25 15:15:51 +00:00
# `make dist` + `make`; explicitly not the other
# parts of distcheck like `make uninstall` since
# we don't care about that.
dist-then-build : dist
rm $( distdir) -rf && tar -xf $( distdir) .tar.xz
cd $( distdir) && mkdir _build && cd _build && \
../configure --prefix= /usr --libdir= /usr/lib --sysconfdir= /etc && \
$( MAKE) && make install DESTDIR = $$ ( pwd ) /_install && \
rm -rf $( distdir)
2016-03-31 15:08:45 -04:00
- i n c l u d e $( top_srcdir ) / g i t . m k