summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 8 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index aa3896e..ae74a05 100644
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,11 @@
CC ?= cc
CFLAGS = -std=c99 -Os -Wall -Wextra
-LDFLAGS = -s
+# -no-pie: this is a local CLI reading static embedded data with no attack
+# surface, so it does not need PIE/ASLR. Dropping it lets the linker bake the
+# string-table pointers in at link time instead of emitting ~57 KB of runtime
+# relocations -- a ~6% smaller binary for free.
+LDFLAGS = -s -no-pie
PREFIX = /usr/local
# The form to build is read from config.h so there is one source of truth.
@@ -19,7 +23,7 @@ all: clectio
config.h:
cp config.def.h config.h
-mktext: mktext.c lz.h
+mktext: mktext.c
$(CC) $(CFLAGS) -o $@ mktext.c
bin2h: bin2h.c
@@ -38,8 +42,8 @@ endif
text.lz.h: bin2h text_$(FORM).lz
./bin2h text_$(FORM).lz > $@
-clectio: clectio.c config.h text.lz.h gen/liturgy_$(FORM).h lz.h
- $(CC) $(CFLAGS) $(LDFLAGS) -o $@ clectio.c
+clectio: clectio.c puff.c puff.h config.h text.lz.h gen/liturgy_$(FORM).h
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ clectio.c puff.c
size: clectio
@ls -l clectio | awk '{printf "clectio (%s): %d bytes = %.0f KB\n","$(FORM)",$$5,$$5/1024}'