mirror of
https://github.com/javalsai/lidm.git
synced 2025-08-31 18:38: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
|
PREFIX=/usr
|
||||||
|
|
||||||
CC?=gcc
|
CC?=gcc
|
||||||
CFLAGS?=-O3 -Wall
|
CFLAGS?=-O3 -Wall -fdata-sections -ffunction-sections
|
||||||
# C PreProcessor flags, not C Plus Plus
|
# C PreProcessor flags, not C Plus Plus
|
||||||
CPPFLAGS?=
|
CPPFLAGS?=
|
||||||
ALLFLAGS=$(CFLAGS) $(CPPFLAGS) -I$(IDIR)
|
ALLFLAGS=$(CFLAGS) $(CPPFLAGS) -I$(IDIR)
|
||||||
|
LDFLAGS?=-Wl,--gc-sections
|
||||||
|
|
||||||
LIBS=-lpam
|
LIBS=-lpam
|
||||||
|
|
||||||
@@ -41,7 +42,7 @@ $(ODIR)/%.o: $(CDIR)/%.c $(DEPS)
|
|||||||
$(CC) -c -o $@ $< $(ALLFLAGS)
|
$(CC) -c -o $@ $< $(ALLFLAGS)
|
||||||
|
|
||||||
lidm: $(OBJ)
|
lidm: $(OBJ)
|
||||||
$(CC) -o $@ $^ $(ALLFLAGS) $(LIBS)
|
$(CC) -o $@ $^ $(ALLFLAGS) $(LIBS) $(LDFLAGS)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f $(ODIR)/*.o lidm
|
rm -f $(ODIR)/*.o lidm
|
||||||
|
Reference in New Issue
Block a user