From 2886a81574fce8cddba8792e3659fa18815f544c Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Tue, 2 Jul 2024 10:31:52 +0200 Subject: [PATCH] Linker flags and makefile cleanup --- Makefile | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 6b1324e..10c26a0 100644 --- a/Makefile +++ b/Makefile @@ -14,10 +14,9 @@ CFLAGS += -fshort-enums else CFLAGS += -g -O0 -std=c99 -march=native -mtune=native CFLAGS += -DDEBUG -endif +endif # DEBUG -# Include debug flags -CFLAGS += -g -O0 -std=c99 -march=native -mtune=native +LDFLAGS = -lm C_SOURCES = $(wildcard *.c) C_HEADERS = $(wildcard *.h) @@ -35,7 +34,7 @@ all: $(OBJECTS) @$(CC) $(CFLAGS) -S -masm=intel $< driver: $(OBJECTS) - @$(CC) $(CFLAGS) $^ -o $@ + @$(CC) $(LDFLAGS) $^ -o $@ run: driver @./driver @@ -44,7 +43,7 @@ lib: $(OBJECTS) @ar rcs librbuf.a ringbuf.o dylib: $(OBJECTS) - @$(CC) $(CFLAGS) -fPIC -shared -o librbuf.so ringbuf.o + @$(CC) $(LDLAGS) -fPIC -shared -o librbuf.so ringbuf.o install: @cp librbuf.a /usr/local/lib