File: hardening

package info (click to toggle)
fermi-lite 0.1%2Bgit20221215.85f159e-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 748 kB
  • sloc: ansic: 5,196; makefile: 65; sh: 17
file content (43 lines) | stat: -rw-r--r-- 1,186 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
Description: add hardening flags
 Adds necessary build flags for hardening.
Author: Sascha Steinbiss <sascha@steinbiss.name>
Last-Update: 2016-01-08
--- fermi-lite.orig/Makefile
+++ fermi-lite/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: