Commit dd30057e authored by Andrew Price's avatar Andrew Price
Browse files

Link with --as-needed

parent d6b35f9f
Loading
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -72,6 +72,8 @@ MWCFLAGS = -std=gnu99 -g $(DEFS) $(CCSEC) $(WARNINGS)
ifeq ($(UNAME),FreeBSD)
MWCFLAGS += -I/usr/local/include
MWLDFLAGS = -L/usr/local/lib
else
MWLDFLAGS += -Wl,--as-needed
endif
ifneq ($(RELEASE_BUILD),0)
MWCFLAGS += -O2
+1 −1
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@ LDLIBS += -ljansson -lsqlite3
build: mwserv

mwserv: $(CODE:.c=.o) ../libmw.a
	$(CC) $(LDFLAGS) $(LDLIBS) -o $@ $^
	$(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS)

clean:
	-rm -f *.o .*.d *.d mwserv
+1 −1
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@ CFLAGS+= -I.. -I/usr/include/postgresql
build: mwpoll

mwpoll: mwpoll.o import.o comms.o mwstring.o ../libmw.a
	$(CC) $(LDFLAGS) $(LDLIBS) -o $@ $^
	$(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS)

clean:
	-rm -f *.o .*.d *.d mwpoll