aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2016-05-03 21:26:05 +0200
committerGravatar Christian Hesse <mail@eworm.de>2016-05-03 21:26:05 +0200
commitb08dc6a4023f5ee75b667d84712935b42f0381cd (patch)
tree52f8261f2a835b6a1a64dfb0edcc195b41341982
parent5e4f7c163cb3eeae75f4038bbac947d9ba5c3c65 (diff)
downloadnetlink-notify-b08dc6a4023f5ee75b667d84712935b42f0381cd.tar.gz
netlink-notify-b08dc6a4023f5ee75b667d84712935b42f0381cd.tar.zst
fix compiler and linker flags and produce binaries with full RELRO
-rw-r--r--Makefile9
1 files changed, 7 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 10f2635..37c1e85 100644
--- a/Makefile
+++ b/Makefile
@@ -1,13 +1,18 @@
# netlink-notify - Notify about netlink changes
+# commands
CC := gcc
MD := markdown
CONVERT := convert -define png:compression-level=9 -background transparent
INSTALL := install
CP := cp
RM := rm
-CFLAGS += -std=c11 -O2 -Wall -Werror
+
+# flags
+CFLAGS += -std=c11 -O2 -fPIC -Wall -Werror
CFLAGS += $(shell pkg-config --cflags --libs libnotify)
+LDFLAGS += -Wl,-z,now -Wl,-z,relro -pie
+
# this is just a fallback in case you do not use git but downloaded
# a release tarball...
VERSION := 0.7.4
@@ -15,7 +20,7 @@ VERSION := 0.7.4
all: netlink-notify icons README.html
netlink-notify: netlink-notify.c version.h config.h
- $(CC) $(CFLAGS) -o netlink-notify netlink-notify.c
+ $(CC) $(CFLAGS) $(LDFLAGS) -o netlink-notify netlink-notify.c
config.h:
$(CP) config.def.h config.h