Linker flags and makefile cleanup

This commit is contained in:
Imbus 2024-07-02 10:31:52 +02:00
parent a5c5ecd64b
commit 2886a81574

View file

@ -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