--- P.S: Could also drop `-std=c99` from CFLAGS and set CC to c99. But didn't do that since it wasn't needed for my goal of being able to do something like the following: $ make CFLAGS="-O3 -flto" LDFLAGS="-O3 -flto" Makefile | 8 +++++--- config.mk | 6 +++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index a03a95c..8d25ad0 100644 --- a/Makefile +++ b/Makefile _AT_@ -11,11 +11,13 @@ all: options dmenu stest options: _AT_echo dmenu build options: _AT_echo "CFLAGS = $(CFLAGS)" + _AT_echo "CPPFLAGS = $(CPPFLAGS)" _AT_echo "LDFLAGS = $(LDFLAGS)" + _AT_echo "LDLIBS = $(LDLIBS)" _AT_echo "CC = $(CC)" .c.o: - $(CC) -c $(CFLAGS) $< + $(CC) -c $(CPPFLAGS) $(CFLAGS) $< config.h: cp config.def.h $_AT_ _AT_@ -23,10 +25,10 @@ config.h: $(OBJ): arg.h config.h config.mk drw.h dmenu: dmenu.o drw.o util.o - $(CC) -o $_AT_ dmenu.o drw.o util.o $(LDFLAGS) + $(CC) -o $_AT_ dmenu.o drw.o util.o $(LDFLAGS) $(LDLIBS) stest: stest.o - $(CC) -o $_AT_ stest.o $(LDFLAGS) + $(CC) -o $_AT_ stest.o $(LDFLAGS) $(LDLIBS) clean: rm -f dmenu stest $(OBJ) dmenu-$(VERSION).tar.gz diff --git a/config.mk b/config.mk index b0bd246..a513b74 100644 --- a/config.mk +++ b/config.mk _AT_@ -24,9 +24,9 @@ INCS = -I$(X11INC) -I$(FREETYPEINC) LIBS = -L$(X11LIB) -lX11 $(XINERAMALIBS) $(FREETYPELIBS) # flags -CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700 -D_POSIX_C_SOURCE=200809L -DVERSION=\"$(VERSION)\" $(XINERAMAFLAGS) -CFLAGS = -std=c99 -pedantic -Wall -Os $(INCS) $(CPPFLAGS) -LDFLAGS = $(LIBS) +CPPFLAGS = $(INCS) -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700 -D_POSIX_C_SOURCE=200809L -DVERSION=\"$(VERSION)\" $(XINERAMAFLAGS) +CFLAGS = -std=c99 -pedantic -Wall -Os +LDLIBS = $(LIBS) # compiler and linker CC = cc -- 2.35.1Received on Mon Jul 04 2022 - 11:01:35 CEST
This archive was generated by hypermail 2.3.0 : Mon Jul 04 2022 - 11:12:29 CEST