From: Quentin Rameau Date: Tue, 11 Jul 2017 22:26:35 +0000 (+0200) Subject: Let the user specify C and LD FLAGS X-Git-Url: https://git.danieliu.xyz/?a=commitdiff_plain;h=d4928ed;p=st.git Let the user specify C and LD FLAGS --- diff --git a/Makefile b/Makefile index f5b84a0..128ee9d 100644 --- a/Makefile +++ b/Makefile @@ -11,15 +11,15 @@ all: options st options: @echo st build options: - @echo "CFLAGS = $(CFLAGS)" - @echo "LDFLAGS = $(LDFLAGS)" + @echo "CFLAGS = $(STCFLAGS)" + @echo "LDFLAGS = $(STLDFLAGS)" @echo "CC = $(CC)" config.h: cp config.def.h config.h .c.o: - $(CC) $(CFLAGS) -c $< + $(CC) $(STCFLAGS) -c $< st.o: config.h st.h win.h x.o: arg.h st.h win.h @@ -27,7 +27,7 @@ x.o: arg.h st.h win.h $(OBJ): config.h config.mk st: $(OBJ) - $(CC) $(LDFLAGS) -o $@ $(OBJ) + $(CC) $(STLDFLAGS) -o $@ $(OBJ) clean: rm -f st $(OBJ) st-$(VERSION).tar.gz diff --git a/config.mk b/config.mk index 527a64d..0aceec4 100644 --- a/config.mk +++ b/config.mk @@ -20,8 +20,8 @@ LIBS = -L$(X11LIB) -lm -lrt -lX11 -lutil -lXft \ # flags CPPFLAGS = -DVERSION=\"$(VERSION)\" -D_XOPEN_SOURCE=600 -CFLAGS = -g -std=c99 -pedantic -Wall -Wvariadic-macros -Os $(INCS) $(CPPFLAGS) -LDFLAGS = -g $(LIBS) +STCFLAGS = $(INCS) $(CPPFLAGS) $(CFLAGS) +STLDFLAGS = $(LIBS) $(LDFLAGS) # compiler and linker # CC = c99