aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2016-05-03 21:19:50 +0200
committerGravatar Christian Hesse <mail@eworm.de>2016-05-03 21:19:50 +0200
commit32af97395ea39b81434061a4e76fc9794e4f81ad (patch)
treee6d0250e7677db485336e52eb4e780bd52849701 /Makefile
parentd99976fb2b887dce25f144d1b885c7349484f6d2 (diff)
downloadextract-artwork-32af97395ea39b81434061a4e76fc9794e4f81ad.tar.gz
extract-artwork-32af97395ea39b81434061a4e76fc9794e4f81ad.tar.zst
fix compiler and linker flags and produce binaries with full RELRO
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile9
1 files changed, 7 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index a082cb9..dc87898 100644
--- a/Makefile
+++ b/Makefile
@@ -1,12 +1,17 @@
# extract-artwork - Extract artwork from media files
+# commands
CC := gcc
MD := markdown
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 libavformat libavutil)
+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.0.1
@@ -14,7 +19,7 @@ VERSION := 0.0.1
all: extract-artwork README.html
extract-artwork: extract-artwork.c
- $(CC) $(CFLAGS) -o extract-artwork extract-artwork.c
+ $(CC) $(CFLAGS) $(LDFLAGS) -o extract-artwork extract-artwork.c
README.html: README.md
$(MD) README.md > README.html