You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/app-arch/qpress/files/qpress-20220819-fix-build-s...

41 lines
1.1 KiB

From 1627b18fdf76e978bdd05b985eb6efb1286fa1da Mon Sep 17 00:00:00 2001
From: Davide Cavalca <dcavalca@fedoraproject.org>
Date: Thu, 24 Nov 2022 16:13:30 -0800
Subject: [PATCH] Rework makefile to ease packaging
---
makefile | 22 +++++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)
diff --git a/makefile b/makefile
index 4890f9d..349fbb2 100755
--- a/makefile
+++ b/makefile
@@ -1,9 +1,21 @@
-PREFIX = /usr/local
+DESTDIR ?=
+PREFIX ?= /usr/local
+CXX ?= g++
+CXXFLAGS ?= -O3
+CXXFLAGS += -Wall -Wextra -Werror
+LDFLAGS ?=
-g++: qpress.cpp aio.cpp quicklz.c utilities.cpp
- g++ -O3 -o qpress -x c quicklz.c -x c++ qpress.cpp aio.cpp utilities.cpp -lpthread -Wall -Wextra -Werror
+qpress: qpress.cpp aio.cpp quicklz.c utilities.cpp
+ $(CXX) $(CXXFLAGS) -o qpress -x c quicklz.c -x c++ qpress.cpp aio.cpp utilities.cpp -lpthread $(LDFLAGS)
install: qpress
- install -m 0755 qpress $(PREFIX)/bin
+ install -D -p -m 0755 -t $(DESTDIR)$(PREFIX)/bin qpress
-.PHONY: install g++
+clean:
+ rm -f qpress
+
+all: qpress
+
+g++: qpress
+
+.PHONY: clean install