Commit 7fd2f168 authored by Jamie A. Jennings's avatar Jamie A. Jennings

REMOVED librosie.a from installation. Wrote make target "installcheck"....

REMOVED librosie.a from installation. Wrote make target "installcheck". Enhanced the output printed while uninstalling.
parent a45e8952
Pipeline #144405765 passed with stage
in 1 minute and 32 seconds
......@@ -27,9 +27,6 @@
# First, some recommended hygiene for Makefiles, to help catch errors:
SHELL := bash
.SHELLFLAGS := -e -o pipefail -c
#.SHELLFLAGS := -eu -o pipefail -c
# The various makefiles in this project use undefined variables (but check for them)
#MAKEFLAGS += --warn-undefined-variables
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
......@@ -93,7 +90,6 @@ LIBROSIE_DIR = $(BUILD_ROOT)/src/librosie
SUBMOD_DIR = $(BUILD_ROOT)/submodules
# File names for the librosie variants
LIBROSIE_A=librosie.a
LIBROSIE_H=librosie.h
ifeq ($(PLATFORM),macosx)
PLATFORM=macosx
......@@ -204,7 +200,6 @@ $(BUILD)/lib/rosie/extra/%: $(BUILD_ROOT)/extra/%
compile: $(ROSIEBIN)
$(ROSIEBIN): $(LIBROSIE_DIR)/binaries/rosie VERSION
cp $(BUILD_ROOT)/src/librosie/binaries/$(LIBROSIE_A) $(BUILD)/lib/$(LIBROSIE_A)
cp $(BUILD_ROOT)/src/librosie/binaries/$(LIBROSIE_DYLIB) $(BUILD)/lib/$(LIBROSIE_DYLIB)
cp -R $(BUILD_ROOT)/doc $(BUILD)
cp -R $(BUILD_ROOT)/extra $(BUILD)/lib/rosie
......@@ -351,15 +346,13 @@ install:
$(MAKE) installforce; \
fi;
# In case destination is a symlink, we try to rm it first.
installforce: | check
# In case the destination directory (e.g. /usr/local/lib/rosie) is a symlink, we try to rm it first.
-rm -f "$(ROSIED)"
mkdir -p "$(ROSIED)"
cp -R $(BUILD)/lib/rosie/* "$(ROSIED)"
-rm -f "$(LIBROSIED)/$(LIBROSIE_DYLIB)"
cp "$(BUILD)/lib/$(LIBROSIE_DYLIB)" "$(LIBROSIED)/$(LIBROSIE_DYLIB)"
-rm -f "$(LIBROSIED)/$(LIBROSIE_A)"
cp "$(BUILD)/lib/$(LIBROSIE_A)" "$(LIBROSIED)/$(LIBROSIE_A)"
mkdir -p "$(INSTALL_INCLUDE_DIR)"
cp "$(BUILD)/include/$(LIBROSIE_H)" "$(INSTALL_INCLUDE_DIR)/$(LIBROSIE_H)"
mkdir -p "$(INSTALL_DOC_DIR)"
......@@ -370,6 +363,10 @@ installforce: | check
-rm -f "$(INSTALL_MAN_DIR)/rosie.1"
mkdir -p "$(INSTALL_MAN_DIR)"
cp $(BUILD)/doc/man/rosie.1 "$(INSTALL_MAN_DIR)/rosie.1"
if [ "$(platform)" == "linux" ]; then \
echo "$(DESTDIR)" > /etc/ld.so.conf.d/librosie.conf; \
ldconfig; \
fi
# -----------------------------------------------------------------------------
# Uninstall
......@@ -377,17 +374,37 @@ installforce: | check
.PHONY: uninstall
uninstall:
@echo "Removing $(INSTALL_ROSIEBIN)"
@-rm -vf $(INSTALL_ROSIEBIN)
@echo "Removing $(ROSIED)"
@-rm -Rvf $(ROSIED)/
@echo "Removing librosie.a/.so/.dylib from $(LIBROSIED)"
@-rm -vf "$(LIBROSIED)/$(LIBROSIE_DYLIB)"
@-rm -vf "$(LIBROSIED)/$(LIBROSIE_A)"
@echo "Removing librosie.h from $(INSTALL_INCLUDE_DIR)"
@-rm -vf "$(INSTALL_INCLUDE_DIR)/$(LIBROSIE_H)"
@echo "Removing rosie man page $(INSTALL_MAN_DIR)"
@-rm -vf "$(INSTALL_MAN_DIR)/rosie.1"
@if [ -e "$(INSTALL_ROSIEBIN)" ]; then \
echo "Removing $(INSTALL_ROSIEBIN)"; \
rm -f $(INSTALL_ROSIEBIN); \
else echo "$(INSTALL_ROSIEBIN) not found"; \
fi
@if [ -e "$(ROSIED)" ]; then \
echo "Removing $(ROSIED)"; \
rm -Rf $(ROSIED)/; \
else echo "$(ROSIED) not found"; \
fi
@if [ -e "$(LIBROSIED)/$(LIBROSIE_DYLIB)" ]; then \
echo "Removing $(LIBROSIED)/$(LIBROSIE_DYLIB)"; \
rm -f "$(LIBROSIED)/$(LIBROSIE_DYLIB)"; \
else echo "$(LIBROSIED)/$(LIBROSIE_DYLIB) not found"; \
fi
@if [ -e "$(INSTALL_INCLUDE_DIR)/$(LIBROSIE_H)" ]; then \
echo "Removing $(INSTALL_INCLUDE_DIR)/$(LIBROSIE_H)"; \
rm -f "$(INSTALL_INCLUDE_DIR)/$(LIBROSIE_H)"; \
else echo "$(INSTALL_INCLUDE_DIR)/$(LIBROSIE_H) not found"; \
fi
@if [ -e "$(INSTALL_MAN_DIR)/rosie.1" ]; then \
echo "Removing $(INSTALL_MAN_DIR)/rosie.1"; \
rm -f "$(INSTALL_MAN_DIR)/rosie.1"; \
else echo "$(INSTALL_MAN_DIR)/rosie.1 not found"; \
fi
@if [ "$(platform)" == "linux" ]; then \
if [ -e "/etc/ld.so.conf.d/librosie.conf" ]; then \
echo "Removing /etc/ld.so.conf.d/librosie.conf"; \
rm -f "/etc/ld.so.conf.d/librosie.conf"; \
fi; \
fi
.PHONY: check
check:
......@@ -422,6 +439,33 @@ check:
false; \
fi
.PHONY: installcheck
installcheck:
@if [ ! -x $(INSTALL_ROSIEBIN) ]; then \
echo "$(INSTALL_ROSIEBIN) does not exist or is not executable. Run 'make install' to install rosie."; \
false; \
fi
@echo "Executable exists (\"$(INSTALL_ROSIEBIN)\")"
@if [ ! -e "$(LIBROSIED)/$(LIBROSIE_DYLIB)" ]; then \
echo "$(LIBROSIED)/$(LIBROSIE_DYLIB) does not exist. Run 'make install' to install rosie."; \
false; \
fi
@$(INSTALL_ROSIEBIN) config >/dev/null 2>&1; \
if [ $$? -ne 0 ]; then \
echo "Test failed (perhaps a corrupt installation?)"; \
false; \
fi
@home=`$(INSTALL_ROSIEBIN) config | $(INSTALL_ROSIEBIN) match -o subs 're.s* "ROSIE_HOME" "=" word.dq'`; \
if [ $$? -ne 0 ]; then \
echo "Test failed (perhaps an incomplete installation?)"; \
else \
if [ "$$home" == "\"$(ROSIED)\"" ]; then \
echo "Installation test passed (rosie library found at $$home)"; \
else \
echo "Installation test failed (perhaps an incomplete installation?)"; \
fi; \
fi; \
# -----------------------------------------------------------------------------
# Tests need to be done with dumb terminal type because the cli and
# repl tests compare the expected output to the actual output byte by
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment