Skip to content

Commit

Permalink
Makefile: fix LDFLAGS order; and don't force -Werror
Browse files Browse the repository at this point in the history
Fix order of LDFLAGS, as mentioned in #158, this is necessary for e.g.
`-Wl,--as-needed` to work correctly.

-Werror is now only added in non-NDEBUG builds.

Ref: gentoo/gentoo#38168
  • Loading branch information
emanuele6 authored and bagder committed Aug 16, 2024
1 parent 40c0a73 commit 5cb314b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ ifndef TRURL_IGNORE_CURL_CONFIG
LDLIBS += $$(curl-config --libs)
CFLAGS += $$(curl-config --cflags)
endif
CFLAGS += -W -Wall -Wshadow -Werror -pedantic
CFLAGS += -W -Wall -Wshadow -pedantic
CFLAGS += -Wconversion -Wmissing-prototypes -Wwrite-strings -Wsign-compare -Wno-sign-conversion
ifndef NDEBUG
CFLAGS += -g
CFLAGS += -Werror -g
endif
MANUAL = trurl.1

Expand All @@ -43,7 +43,7 @@ INSTALL ?= install
PYTHON3 ?= python3

$(TARGET): $(OBJS)
$(CC) $(OBJS) -o $(TARGET) $(LDFLAGS) $(LDLIBS)
$(CC) $(LDFLAGS) $(OBJS) -o $(TARGET) $(LDLIBS)

trurl.o: trurl.c version.h

Expand Down

0 comments on commit 5cb314b

Please sign in to comment.