From 297fe5de717870601dd0f0a5dad778027bc5729e Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Thu, 13 Mar 2014 21:04:44 -0400 Subject: Put -lm -lpng at the end of the command line. --- Makefile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 582b209..7a23863 100644 --- a/Makefile +++ b/Makefile @@ -11,15 +11,18 @@ CC ?= gcc CFLAGS ?= -std=c99 -pipe -O2 -Werror -Wall -Wpedantic -Wextra -Wno-sign-compare -Wno-unused-parameter -Wunreachable-code -Wshadow -Wpointer-arith -Wwrite-strings -Wcast-align -Wstrict-prototypes -LDFLAGS ?= -lm -lpng +LDFLAGS ?= -Wl,-O1,--sort-common,--as-needed,-z,relro +LIBS ?= -lm -lpng RM ?= rm -f kd-forest: kd-forest.c kd-forest.h util.c util.h color.c color.h main.c - $(CC) $(CFLAGS) $(LDFLAGS) -o kd-forest kd-forest.c util.c color.c main.c + $(CC) $(CFLAGS) $(LDFLAGS) kd-forest.c util.c color.c main.c $(LIBS) -o kd-forest -image: kd-forest +kd-forest.png: kd-forest ./kd-forest +image: kd-forest.png + clean: $(RM) kd-forest -- cgit v1.2.3