summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonas Bernoulli <jonas@sequoia-pgp.org>2021-04-16 15:52:20 +0200
committerJonas Bernoulli <jonas@sequoia-pgp.org>2021-04-22 16:25:36 +0200
commit58025f5a0390c137fe972d2940c4bea1941ab055 (patch)
tree432f8521d351fdc80a3db3ac2073f6e9c8ebcbc4
parent633f4475531a2fe5b1dd42c1ab6560470e4a0943 (diff)
make: Hide Makefile to avoid confusion.
- Those make targets that are useful to users are just wrappers around the respective cargo commands, which means that they are not really necessary. The additional targets are primarily of use to Sequoia developers, which also means that they are not very useful to users. - That did not keep us from prominently advertising the use of make as a recommended installation mechanism, and that in turn contributed to some false expectations and confusion. - For example, a packager used the Makefile because they thought that that is what we would like them to do. Some users found it surprising that "sudo make install" ended up running the target "build-release" even though they had already build using "build". - People who want to keep using make without every time having to specify the name of the hidden Makefile can do so by creating a symbolic link.
-rw-r--r--.Makefile (renamed from Makefile)4
-rw-r--r--.gitignore1
-rw-r--r--.gitlab-ci.yml15
-rw-r--r--README.md24
4 files changed, 12 insertions, 32 deletions
diff --git a/Makefile b/.Makefile
index d8b22848..ecb3b2f8 100644
--- a/Makefile
+++ b/.Makefile
@@ -81,7 +81,7 @@ test check:
else \
$(MAKE) -Copenpgp-ffi test && \
$(MAKE) -Cffi test && \
- $(MAKE) examples; \
+ $(MAKE) --file=.Makefile examples; \
fi
.PHONY: examples
@@ -150,7 +150,7 @@ dist-test dist-check: $(CARGO_TARGET_DIR)/dist/sequoia-$(VERSION).tar.pgp.gz
$(GPG) -o - --verify |\
$(TAR) xf - -C "$(CARGO_TARGET_DIR)/dist-check"
cd "$(CARGO_TARGET_DIR)/dist-check/sequoia-$(VERSION)" && \
- CARGO_HOME=$$(mktemp -d) $(MAKE) test CARGO_FLAGS=--locked
+ CARGO_HOME=$$(mktemp -d) $(MAKE) --file=.Makefile test CARGO_FLAGS=--locked
rm -rf "$(CARGO_TARGET_DIR)/dist-check/sequoia-$(VERSION)"
# Housekeeping.
diff --git a/.gitignore b/.gitignore
index 317f9995..d11a7d36 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,4 @@
*~
.gdb_history
.dir-locals.el
+Makefile
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index d7659c70..d8dbc31d 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -23,7 +23,7 @@ build-bullseye:
dependencies:
- codespell
script:
- - make
+ - $MAKE_TOP
- if ! git diff --quiet Cargo.lock ; then echo "Cargo.lock changed. Please add the change to the corresponding commit." ; false ; fi
- if ! git diff --quiet sq ; then echo "Please commit the changes to sq/src/sq-usage.rs." ; false ; fi
- if ! git diff --quiet sqv ; then echo "Please commit the changes to sqv/src/sqv-usage.rs." ; false ; fi
@@ -42,7 +42,7 @@ build-bullseye:arm64:
dependencies:
- codespell
script:
- - make
+ - $MAKE_TOP
- if ! git diff --quiet Cargo.lock ; then echo "Cargo.lock changed. Please add the change to the corresponding commit." ; false ; fi
- if ! git diff --quiet sq ; then echo "Please commit the changes to sq/src/sq-usage.rs." ; false ; fi
- if ! git diff --quiet sqv ; then echo "Please commit the changes to sqv/src/sqv-usage.rs." ; false ; fi
@@ -61,7 +61,7 @@ bullseye:
dependencies:
- codespell
script:
- - SEQUOIA_CTEST_VALGRIND=/usr/bin/valgrind make test
+ - SEQUOIA_CTEST_VALGRIND=/usr/bin/valgrind $MAKE_TOP test
variables:
CARGO_TARGET_DIR: /target
CARGO_HOME: /cargo
@@ -85,7 +85,7 @@ bullseye:arm64:
- codespell
script:
# valgrind reports a false positive, see !1035. Run the tests without it for now.
- - make test
+ - $MAKE_TOP test
variables:
CARGO_TARGET_DIR: /target
CARGO_HOME: /cargo
@@ -169,7 +169,7 @@ codespell:
before_script:
- codespell --version
script:
- - make codespell CODESPELL_FLAGS=--summary
+ - $MAKE_TOP codespell CODESPELL_FLAGS=--summary
after_script: []
rust-stable:
@@ -185,7 +185,7 @@ rust-stable:
- cargo --version
- clang --version
script:
- - CARGO_PACKAGES="-p buffered-reader -p sequoia-openpgp -p sequoia-sqv" make test
+ - CARGO_PACKAGES="-p buffered-reader -p sequoia-openpgp -p sequoia-sqv" $MAKE_TOP test
variables:
CARGO_TARGET_DIR: /target
CARGO_HOME: /cargo
@@ -204,7 +204,7 @@ rust-stable:arm64:
- cargo --version
- clang --version
script:
- - CARGO_PACKAGES="-p buffered-reader -p sequoia-openpgp -p sequoia-sqv" make test
+ - CARGO_PACKAGES="-p buffered-reader -p sequoia-openpgp -p sequoia-sqv" $MAKE_TOP test
variables:
CARGO_TARGET_DIR: /target
CARGO_HOME: /cargo
@@ -271,4 +271,5 @@ variables:
RUST_BACKTRACE: full
RUSTFLAGS: -D warnings
CFLAGS: -Werror
+ MAKE_TOP: make --file=.Makefile
QUICKCHECK_GENERATOR_SIZE: 500 # https://github.com/BurntSushi/quickcheck/pull/240
diff --git a/README.md b/README.md
index 5064cb5c..d1490d93 100644
--- a/README.md
+++ b/README.md
@@ -167,7 +167,7 @@ feature).
Building Sequoia
================
-Using cargo
+Using Cargo
-----------
To build all Sequoia components, simply execute `cargo build
@@ -175,28 +175,6 @@ To build all Sequoia components, simply execute `cargo build
e.g. to build `sq`, run `cargo build [--release] -p sequoia-sq`, or
build `sequoia-openpgp-ffi` to build a shared object with the C API.
-Using the Makefile
-------------------
-
-We also consider the needs of packagers in times
-where distribution support for packaging Rust projects is not yet
-mature enough to handle a project like Sequoia. Therefore, we provide
-a `Makefile` to simplify building, testing, and installing Sequoia.
-
-To build Sequoia, simply execute `make`. To run the test suites,
-execute `make test` (or use the `check` alias). To install Sequoia,
-use `make install`. The latter target honors `PREFIX` and `DESTDIR`.
-Finally, to return your source tree to its pristine state, run `make
-clean`.
-
-You can specify subdirectories to build individual modules, e.g. use
-`make -Copenpgp-ffi install` to only install the shared object with
-the C API.
-
-**Note:** By default the Python FFI bindings are also built. To skip
-these add `PYTHON=disable` to all `make` invocations. E.g. `make
-PYTHON=disable`.
-
Using Docker
------------