2013-12-22 04:41:30 +04:00
# Copyright (C) 2013 Colin Walters <walters@verbum.org>
#
# 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.
2014-01-29 23:37:44 +04:00
bin_PROGRAMS += rpm-ostree
2013-12-22 04:41:30 +04:00
2020-12-08 20:15:13 +03:00
rpm_ostree_SOURCES = src/app/main.cxx \
2015-04-07 03:18:50 +03:00
src/app/rpmostree-builtins.h \
src/app/rpmostree-db-builtins.h \
src/app/rpmostree-compose-builtins.h \
2020-12-21 19:08:51 +03:00
src/app/rpmostree-builtin-upgrade.cxx \
2020-12-21 19:08:51 +03:00
src/app/rpmostree-builtin-rollback.cxx \
2020-12-21 19:08:51 +03:00
src/app/rpmostree-builtin-deploy.cxx \
2020-12-21 19:08:51 +03:00
src/app/rpmostree-builtin-reload.cxx \
2020-12-21 19:08:51 +03:00
src/app/rpmostree-builtin-rebase.cxx \
2020-12-21 19:08:51 +03:00
src/app/rpmostree-builtin-cancel.cxx \
2020-12-21 19:08:51 +03:00
src/app/rpmostree-builtin-cliwrap.cxx \
2020-12-21 19:08:51 +03:00
src/app/rpmostree-builtin-cleanup.cxx \
2017-02-10 20:33:08 +03:00
src/app/rpmostree-builtin-initramfs.c \
2020-07-25 00:35:01 +03:00
src/app/rpmostree-builtin-initramfs-etc.c \
2020-12-21 19:08:51 +03:00
src/app/rpmostree-builtin-livefs.cxx \
2020-12-21 19:08:51 +03:00
src/app/rpmostree-builtin-usroverlay.cxx \
2020-12-21 19:08:51 +03:00
src/app/rpmostree-builtin-override.cxx \
2020-12-21 19:08:51 +03:00
src/app/rpmostree-builtin-refresh-md.cxx \
2020-12-21 19:08:51 +03:00
src/app/rpmostree-builtin-reset.cxx \
2020-12-21 19:08:51 +03:00
src/app/rpmostree-pkg-builtins.cxx \
2015-04-07 03:18:50 +03:00
src/app/rpmostree-builtin-status.c \
2017-03-16 04:05:14 +03:00
src/app/rpmostree-builtin-ex.c \
2019-12-13 20:19:56 +03:00
src/app/rpmostree-builtin-testutils.c \
2020-12-16 00:45:10 +03:00
src/app/rpmostree-builtin-shlib-backend.c \
2015-04-07 03:18:50 +03:00
src/app/rpmostree-builtin-db.c \
2017-02-10 20:33:08 +03:00
src/app/rpmostree-builtin-start-daemon.c \
2019-04-19 00:27:09 +03:00
src/app/rpmostree-builtin-finalize-deployment.c \
2015-04-07 03:18:50 +03:00
src/app/rpmostree-db-builtin-diff.c \
src/app/rpmostree-db-builtin-list.c \
src/app/rpmostree-db-builtin-version.c \
2020-12-06 22:38:13 +03:00
src/app/rpmostree-dbus-helpers.cxx \
2015-06-13 03:19:16 +03:00
src/app/rpmostree-dbus-helpers.h \
2017-06-05 19:37:56 +03:00
src/app/rpmostree-override-builtins.h \
src/app/rpmostree-override-builtins.c \
2020-12-19 21:14:18 +03:00
src/app/rpmostree-libbuiltin.cxx \
2015-04-19 16:36:53 +03:00
src/app/rpmostree-libbuiltin.h \
2017-07-25 19:59:56 +03:00
src/app/rpmostree-polkit-agent.c \
src/app/rpmostree-polkit-agent.h \
2017-09-25 19:05:24 +03:00
src/app/rpmostree-builtin-kargs.c \
2020-11-22 22:55:06 +03:00
src/app/rpmostree-compose-builtin-tree.cxx \
2020-12-19 00:42:28 +03:00
src/app/rpmostree-composeutil.cxx \
2018-09-19 16:48:04 +03:00
src/app/rpmostree-composeutil.h \
2015-04-07 03:18:50 +03:00
src/app/rpmostree-builtin-compose.c \
2020-12-17 01:17:49 +03:00
$(librpmostreed_sources) \
2020-12-17 01:04:40 +03:00
$(librpmostreepriv_sources) \
2014-01-29 23:37:44 +04:00
$(NULL)
2014-09-17 05:45:30 +04:00
2020-10-22 20:33:45 +03:00
if BUILDOPT_ROJIG
rpm_ostree_SOURCES += \
2020-12-19 18:29:13 +03:00
src/app/rpmostree-ex-builtin-commit2rojig.cxx \
2020-12-19 18:48:44 +03:00
src/app/rpmostree-ex-builtin-rojig2commit.cxx \
2020-12-19 19:03:32 +03:00
src/app/rpmostree-compose-builtin-rojig.cxx \
2020-10-22 20:33:45 +03:00
$(NULL)
endif
2020-12-17 01:04:40 +03:00
nodist_rpm_ostree_SOURCES = $(dbus_built_sources) $(nodist_librpmostreepriv_sources)
2020-12-17 01:17:49 +03:00
2020-11-22 22:55:06 +03:00
rpmostree_common_cflags = -I$(srcdir)/src/app -I$(srcdir)/src/daemon \
2016-05-27 21:46:46 +03:00
-I$(srcdir)/src/lib -I$(srcdir)/src/libpriv -I$(libglnx_srcpath) \
2020-12-17 01:17:49 +03:00
-fvisibility=hidden \
-DG_LOG_DOMAIN=\"rpm-ostreed\" \
-DLIBDIR=\"$(libdir)\" -DPKGLIBDIR=\"$(pkglibdir)\" \
$(PKGDEP_RPMOSTREE_CFLAGS)
2020-11-22 22:55:06 +03:00
rpm_ostree_CFLAGS = $(AM_CFLAGS) $(rpmostree_common_cflags)
rpm_ostree_CXXFLAGS = $(AM_CXXFLAGS) $(rpmostree_common_cflags)
2020-12-17 01:04:40 +03:00
rpm_ostree_LDADD = $(PKGDEP_RPMOSTREE_LIBS) $(CAP_LIBS) libglnx.la librpmostree-1.la
2020-12-17 01:17:49 +03:00
EXTRA_rpm_ostree_DEPENDENCIES = libdnf.so.2
2014-01-16 16:26:54 +04:00
2013-12-22 04:41:30 +04:00
privdatadir=$(pkglibdir)
2016-06-15 23:30:11 +03:00
privdata_DATA = src/app/rpm-ostree-0-integration.conf
2016-10-19 21:24:40 +03:00
2018-09-26 17:23:48 +03:00
# Propagate automake verbose mode
cargo_build = $(cargo) build $(if $(subst 0,,$(V)),--verbose,)
2020-12-22 01:27:52 +03:00
if BUILDOPT_ENABLE_SQLITE_RPMDB_DEFAULT
cargo_build += --features sqlite-rpmdb-default
endif
2020-12-04 02:38:30 +03:00
tooling_src = bindgen/Cargo.toml bindgen/src/main.rs
tooling-build:
cd $(top_srcdir)/tooling && $(cargo_build) --release --all-targets
2018-09-22 01:02:18 +03:00
if !HAVE_PREBUILT_CBINDGEN
if !HAVE_EXTERNAL_CBINDGEN
2020-12-04 02:38:30 +03:00
rpmostree-bindgen: tooling-build
ln -sf tooling/target/release/rpmostree-bindgen $(abs_top_builddir)/rpmostree-bindgen
2018-09-22 01:02:18 +03:00
endif
endif
2020-12-04 02:38:30 +03:00
GITIGNOREFILES += tooling/target/ rpmostree-bindgen
2018-09-22 01:02:18 +03:00
2018-07-04 21:50:40 +03:00
librpmostree_rust_path = @abs_top_builddir@/target/@RUST_TARGET_SUBDIR@/librpmostree_rust.a
2018-10-12 20:40:56 +03:00
# If the target directory exists, and isn't owned by our uid, then
# we exit with a fatal error, since someone probably did `make && sudo make install`,
# and in this case cargo will download into ~/.root which we don't want.
2020-12-08 21:29:05 +03:00
LIBRPMOSTREE_RUST_SRCS = $(shell find rust/src/ -name '*.rs') Cargo.toml Cargo.lock cbindgen.toml
2018-07-04 21:50:40 +03:00
$(librpmostree_rust_path): Makefile $(LIBRPMOSTREE_RUST_SRCS)
2020-12-08 21:29:05 +03:00
$(cargo_build) $(CARGO_RELEASE_ARGS)
EXTRA_DIST += $(LIBRPMOSTREE_RUST_SRCS)
2018-05-31 23:31:22 +03:00
2018-09-22 01:02:18 +03:00
# Generate bindings from Rust to C
2020-12-11 18:09:57 +03:00
if BUILDOPT_PREBUILT_BINDINGS
rpmostree-rust.h:
ln -sfr rpmostree-rust-prebuilt.h $@
else
2018-09-22 01:02:18 +03:00
if !HAVE_PREBUILT_CBINDGEN
if HAVE_EXTERNAL_CBINDGEN
2018-11-05 21:04:45 +03:00
rpmostree-rust.h:
2020-12-22 00:55:21 +03:00
$(AM_V_GEN) cbindgen -c cbindgen.toml -o $@ $(top_srcdir)
2018-09-22 01:02:18 +03:00
else
2018-11-05 21:04:45 +03:00
rpmostree-rust.h: rpmostree-bindgen
2020-12-08 21:29:05 +03:00
$(AM_V_GEN) ./rpmostree-bindgen $(top_srcdir)
2018-09-22 01:02:18 +03:00
endif
endif
2020-12-11 18:09:57 +03:00
endif
BUILT_SOURCES += rpmostree-rust.h
2018-08-24 17:42:31 +03:00
rpm_ostree_CFLAGS += $(PKGDEP_RPMOSTREE_RS_CFLAGS)
2020-11-22 22:55:06 +03:00
rpm_ostree_LDADD += $(librpmostree_rust_path) $(PKGDEP_RPMOSTREE_RS_LIBS) -lstdc++
2018-09-26 17:43:18 +03:00
# Wraps `cargo test`. This is always a debug non-release build;
# the main thing here is we still drop the `target` dir in our build
# directory, since we nominally support srcdir != builddir.
rust-test:
cd $(top_srcdir)/rust && CARGO_TARGET_DIR=@abs_top_builddir@/target cargo test
.PHONY: rust-test