mirror of
https://github.com/javalsai/lidm.git
synced 2025-08-31 02:18:00 +02:00
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:
5
Makefile
5
Makefile
@@ -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
|
||||
|
Reference in New Issue
Block a user