Skip to content

Commit d787dbb

Browse files
committed
Allow overriding LDFLAGS Makefile variables
It could be useful to also override LDFLAGS, for instance to force security related link options. For romheaders, this option has to be added. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
1 parent 7d392bb commit d787dbb

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

detok/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ INCLUDES = -I../shared
3131

3232
# Normal Flags:
3333
CFLAGS ?= -O2 -Wall #-Wextra
34-
LDFLAGS =
34+
LDFLAGS ?=
3535

3636
# Coverage:
3737
#CFLAGS := $(CFLAGS) -fprofile-arcs -ftest-coverage

romheaders/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ DESTDIR ?= /usr/local
2828
CC ?= gcc
2929
STRIP ?= strip
3030
CFLAGS ?= -O2 -Wall -Wextra
31+
LDFLAGS ?=
3132
INCLUDES = -I../shared
3233

3334
SOURCES = romheaders.c ../shared/classcodes.c
@@ -37,7 +38,7 @@ SOURCES = romheaders.c ../shared/classcodes.c
3738
all: romheaders
3839

3940
romheaders: $(SOURCES)
40-
$(CC) $(CFLAGS) $(INCLUDES) $(SOURCES) -o $@
41+
$(CC) $(LDFLAGS) $(CFLAGS) $(INCLUDES) $(SOURCES) -o $@
4142
$(STRIP) romheaders
4243

4344
clean:

toke/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ INCLUDES = -I../shared
3131

3232
# Normal flags
3333
CFLAGS ?= -O2 -Wall #-Wextra
34-
LDFLAGS =
34+
LDFLAGS ?=
3535

3636
# Coverage:
3737
#CFLAGS := $(CFLAGS) -fprofile-arcs -ftest-coverage

0 commit comments

Comments
 (0)