add hardening flags
authorSascha Steinbiss <sascha@steinbiss.name>
Sat, 8 May 2021 10:58:01 +0000 (10:58 +0000)
committerPeter Michael Green <plugwash@raspbian.org>
Sat, 8 May 2021 10:58:01 +0000 (10:58 +0000)
Last-Update: 2016-01-08

Adds necessary build flags for hardening.

Gbp-Pq: Name hardening

Makefile

index 1e11a07abacf103cb89d35c0c7d86aa8a7b7d09c..2e3b002a7a1571418fffb7218eba98664dd1239b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,30 +1,27 @@
-CC                   gcc
-CFLAGS               -g -Wall -O2 -fPIC  #-fno-inline-functions -fno-inline-functions-called-once
-CPPFLAGS=
+CC?=                   gcc
+CFLAGS+=               -g -Wall -O2 -fPIC  #-fno-inline-functions -fno-inline-functions-called-once
+#CPPFLAGS=
 INCLUDES=      
 OBJS=          kthread.o misc.o \
                        bseq.o htab.o bfc.o \
                        rle.o rope.o mrope.o rld0.o \
                        unitig.o mag.o bubble.o ksw.o
 PROG=          fml-asm
-LIBS=          -lm -lz -lpthread
+LDLIBS+=               -lm -lz -lpthread
 SONUMBER=0
 
 .SUFFIXES:.c .o
 
-.c.o:
-               $(CC) -c $(CFLAGS) $(CPPFLAGS) $(INCLUDES) $< -o $@
-
 all:$(PROG) libfml.so.$(SONUMBER)
 
 fml-asm:libfml.a example.o
-               $(CC) $(CFLAGS) $^ -o $@ -L. -lfml $(LIBS)
+               $(CC) $(LDFLAGS) $(CFLAGS) $^ -o $@ -L. -lfml $(LDLIBS)
 
 libfml.a:$(OBJS)
                $(AR) -csru $@ $(OBJS)
 
 libfml.so.$(SONUMBER): $(OBJS)
-               $(CC) -shared -o $@ $(OBJS) -fPIC -Wl,-soname,libfml.so.$(SONUMBER) $(LIBS) $(LDFLAGS)
+               $(CC) $(LDFLAGS) -shared -o $@ $(OBJS) -fPIC -Wl,-soname,libfml.so.$(SONUMBER) $(LDLIBS)
 
 
 clean: