aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2016-05-03 21:15:18 +0200
committerGravatar Christian Hesse <mail@eworm.de>2016-05-03 21:15:18 +0200
commitde5cecd9bd63c0f7732fe266ee95e878d33ba61f (patch)
tree343301168ff149c65664aac64ef419c66509d9af /Makefile
parent5c3b36d4dc52c83d0ff22f166175bd980b139e49 (diff)
downloadcqrlogo-de5cecd9bd63c0f7732fe266ee95e878d33ba61f.tar.gz
cqrlogo-de5cecd9bd63c0f7732fe266ee95e878d33ba61f.tar.zst
fix compiler and linker flags and produce binaries with full RELRO
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile8
1 files changed, 7 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 1763dd0..0447956 100644
--- a/Makefile
+++ b/Makefile
@@ -4,6 +4,7 @@
PREFIX := /usr
APACHECONF := /etc/httpd/conf/extra/
LIGHTTPDCONF := /etc/lighttpd/conf.d/
+
# commands
CC := gcc
CP := cp
@@ -16,19 +17,24 @@ RM := rm
SED := sed
PNGCHK := pngcheck
ZBARIMG := zbarimg
+
# flags
-CFLAGS += -std=c11 -O2 -fpic -pie -Wall -Werror
+CFLAGS += -std=c11 -O2 -fPIC -Wall -Werror
CFLAGSSTATIC = $(CFLAGS)
CFLAGSSTATIC += -liniparser
CFLAGSSTATIC += $(shell pkg-config --cflags --libs libpng)
CFLAGSSTATIC += $(shell pkg-config --cflags --libs zlib)
CFLAGSSTATIC += $(shell pkg-config --cflags --libs libqrencode)
+LDFLAGS += -Wl,-z,now -Wl,-z,relro -pie
+
# calls to compiled binary files
CQRLOGO_CGI += LD_LIBRARY_PATH=lib/ ./cqrlogo.cgi
CQRLOGO_FCGI += LD_LIBRARY_PATH=lib/ ./cqrlogo.fcgi
+
# this is just a fallback in case you do not use git but downloaded
# a release tarball...
VERSION := 0.5.3
+
# library abi version
SOVERSION := 0