perf: some compiler flag optimizations

https://stackoverflow.com/questions/6687630/how-to-remove-unused-c-c-symbols-with-gcc-and-ld
This commit is contained in:
2025-08-27 19:54:24 +02:00
parent 6d9107b360
commit b58bd50e64

View File

@@ -9,10 +9,11 @@ ODIR=dist
PREFIX=/usr
CC?=gcc
CFLAGS?=-O3 -Wall
CFLAGS?=-O3 -Wall -fdata-sections -ffunction-sections
# C PreProcessor flags, not C Plus Plus
CPPFLAGS?=
ALLFLAGS=$(CFLAGS) $(CPPFLAGS) -I$(IDIR)
LDFLAGS?=-Wl,--gc-sections
LIBS=-lpam
@@ -41,7 +42,7 @@ $(ODIR)/%.o: $(CDIR)/%.c $(DEPS)
$(CC) -c -o $@ $< $(ALLFLAGS)
lidm: $(OBJ)
$(CC) -o $@ $^ $(ALLFLAGS) $(LIBS)
$(CC) -o $@ $^ $(ALLFLAGS) $(LIBS) $(LDFLAGS)
clean:
rm -f $(ODIR)/*.o lidm