PKGBUILDS/check-link/0001-Fix-paths.patch
2022-01-17 19:34:36 -06:00

52 lines
1.8 KiB
Diff

From dc39ec552aa12efa3294c0fcb7deb468ef676a8e Mon Sep 17 00:00:00 2001
From: Nathan <ndowens@artixlinux.org>
Date: Mon, 17 Jan 2022 19:25:17 -0600
Subject: [PATCH] Fix paths
Add DESTDIR and PREFIX variables to make
it more flexable where things get installed
---
makefile => Makefile | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
rename makefile => Makefile (91%)
diff --git a/makefile b/Makefile
similarity index 91%
rename from makefile
rename to Makefile
index 23cff6d..1368218 100644
--- a/makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
APP_NAME := check-link-consistency
DISTRO := Arch
-CC := c++ -march=x86-64 -O2 -flto=$(if $(NPROC),$(NPROC),1) -std=c++20 -fno-rtti -Wall -Wextra -Wpedantic -Werror=return-type -DDISTRO=$(DISTRO)
+CC := c++ -march=x86-64 -O2 -flto=$(if $(NPROC),$(NPROC),1) -std=c++20 -fno-rtti -Wall -Wextra -Wpedantic -Werror=return-type -Wl,-z,relro -Wl,-z,now -DDISTRO=$(DISTRO)
MAIN_CPPs := $(shell find src/main/ -type f -name '*.cpp')
MAIN_Ds := $(MAIN_CPPs:src/%.cpp=target/build/main/%.d)
@@ -21,7 +21,8 @@ TEST_Os := $(TEST_Ds:.d=.o)
# ----------------------------------------------------------------------------------------------------------------------------------------
-
+PREFIX=/usr
+DESTDIR=
.PHONY: all
all: target/$(APP_NAME) target/$(APP_NAME).conf.sample test dummy
@@ -103,8 +104,8 @@ $(TEST_PATH).timestamp: $(TEST_PATH)
.PHONY: install
install:
- cp target/$(APP_NAME) /usr/local/bin/
- cp target/$(APP_NAME).conf.sample /usr/local/etc/
+ install -Dm755 target/$(APP_NAME) -t $(DESTDIR)$(PREFIX)/bin/
+ install -Dm755 target/$(APP_NAME).conf.sample -t $(DESTDIR)$(PREFIX)/share/$(APP_NAME)
# ----------------------------------------------------------------------------------------------------------------------------------------
--
2.34.1