-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Follow GNU conventions for installation (#453)
* Follow GNU conventions for installation: Soter, Themis First of all, move Soter and Themis installation rules out from Makefile to their individual makefiles. This makes them a bit easier to maintain. After that, reduce installation targets to just "install", "install_themis" and "install_soter" (plus "uninstall" counterparts). No one should really be using individual targets to instally only some parts of the library. And these targets are not really documented, and are not standard. Finally, adhere to GNU Makefile conventions [1] when installing files. This encompasses multiple aspects: - $(INSTALL), $(INSTALL_DATA), $(INSTALL_PROGRAM) variables It's not strictly necessary, but nice to have. This allows to override the tool for installing files, and makes sure that data files are not marked executable. - $(DESTDIR) prefix This is an important variable for packaging as it allows staged installation. It gets prefixed to each installation destination so that it could be made into a temporary directory which will get packaged later. Note that this variable is never set explicitly in the Makefile and is empty by default. It's also used only during installation, the library is built as if it's going to be installed to the usual location with DESTDIR preprended to it. - $(prefix), $(includedir), $(libdir), etc. variables These variables allow fine tuning of installation paths when packaging for distributions that have varying conventions. Most prominently, they affect the destination for libraries which may be /lib, /usr/lib, /usr/lib64, /usr/lib/x86_64-linux-gnu, or something else. Note that it's lowercase "prefix", not uppercase "PREFIX". That's how it should be by the book, but all our documentation uses the capitalized version, so we keep it for compatibility. This teaches our Makefile to play nicely with other tools that expect GNU conventions to hold. Primarily, these are various package-building tools that rely on the variables to interpose their helper tools and override installation paths to distribution-specific places. (We could have gotten all of that automatically by using Autotools, but no one really knows Autotools nowadays. Even these GNU conventions are arcane knowledge in the days of "curl | sudo sh" and every language having their own package manager.) [1]: https://www.gnu.org/prep/standards/html_node/Makefile-Conventions.html * Follow GNU conventions for installation: ThemisPP First of all, there are quite a few ThemisPP-specific rules in the main Makefile. Move them all into a separate one, just for ThemisPP. After that, update ThemisPP installation targets to follow the same conventions as for Soter and Themis.
- Loading branch information
Showing
4 changed files
with
88 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# | ||
# Copyright (c) 2019 Cossack Labs Limited | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
THEMISPP_HEADERS = $(wildcard $(SRC_PATH)/wrappers/themis/themispp/*.hpp) | ||
|
||
FMT_FIXUP += $(patsubst %,$(OBJ_PATH)/%.fmt_fixup, $(THEMISPP_HEADERS)) | ||
FMT_CHECK += $(patsubst %,$(OBJ_PATH)/%.fmt_check, $(THEMISPP_HEADERS)) | ||
|
||
themispp_install: | ||
@echo -n "install ThemisPP " | ||
@mkdir -p $(DESTDIR)/$(includedir)/themispp | ||
@$(INSTALL_DATA) $(SRC_PATH)/wrappers/themis/themispp/*.hpp $(DESTDIR)/$(includedir)/themispp | ||
@$(PRINT_OK_) | ||
|
||
themispp_uninstall: | ||
@echo -n "uninstall ThemisPP " | ||
@rm -rf $(DESTDIR)/$(includedir)/themispp | ||
@$(PRINT_OK_) |