Skip to content

Commit

Permalink
Follow GNU conventions for installation: ThemisPP
Browse files Browse the repository at this point in the history
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
ilammy committed Apr 10, 2019
1 parent f4329f3 commit 3754248
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 18 deletions.
19 changes: 1 addition & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ include src/soter/soter.mk
include src/themis/themis.mk
ifndef CARGO
include src/wrappers/themis/jsthemis/jsthemis.mk
include src/wrappers/themis/themispp/themispp.mk
include jni/themis_jni.mk
endif
endif
Expand Down Expand Up @@ -350,11 +351,6 @@ $(OBJ_PATH)/%.fmt_check: %
@echo -n "check $< "
@$(BUILD_CMD_)

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))

#$(AUD_PATH)/%: CMD = $(CC) $(CFLAGS) -E -dI -dD $< -o $@
$(AUD_PATH)/%: CMD = ./scripts/pp.sh $< $@

Expand Down Expand Up @@ -521,19 +517,6 @@ endif
@echo -n "pythemis install "
@$(BUILD_CMD_)


themispp_install: CMD = install $(SRC_PATH)/wrappers/themis/themispp/*.hpp $(PREFIX)/include/themispp

themispp_install:
@mkdir -p $(PREFIX)/include/themispp
@$(BUILD_CMD)

themispp_uninstall: CMD = rm -rf $(PREFIX)/include/themispp

themispp_uninstall:
@echo -n "themispp uninstall "
@$(BUILD_CMD_)

soter_collect_headers:
@mkdir -p $(BIN_PATH)/include/soter
@cd src/soter && find . -name \*.h -exec cp --parents {} ../../$(BIN_PATH)/include/soter/ \; && cd - > /dev/null
Expand Down
31 changes: 31 additions & 0 deletions src/wrappers/themis/themispp/themispp.mk
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_)

0 comments on commit 3754248

Please sign in to comment.