[hackers] [slstatus] Makefile: separate default flags from user flags || Quentin Rameau

From: <git_AT_suckless.org>
Date: Mon, 30 Apr 2018 16:30:20 +0200 (CEST)

commit 95665e437b8f556db4d5499e189e224e3c6e6a12
Author: Quentin Rameau <quinq_AT_fifth.space>
AuthorDate: Mon Apr 30 16:11:45 2018 +0200
Commit: Aaron Marcher <me_AT_drkhsh.at>
CommitDate: Mon Apr 30 16:27:07 2018 +0200

    Makefile: separate default flags from user flags

diff --git a/Makefile b/Makefile
index 7d80893..a2c49c8 100644
--- a/Makefile
+++ b/Makefile
_AT_@ -27,6 +27,10 @@ COM =\
         components/volume\
         components/$(OS)/wifi
 
+SLSCFLAGS = -I$(X11INC) -D_DEFAULT_SOURCE $(CFLAGS)
+SLSLDFLAGS = -L$(X11LIB) $(LDFLAGS)
+SLSLIBS = -lX11 $(OSSLIBS) $(LIBS)
+
 all: slstatus
 
 slstatus: slstatus.o $(COM:=.o) $(REQ:=.o)
_AT_@ -37,10 +41,10 @@ config.h:
         cp config.def.h $_AT_
 
 .o:
- $(CC) -o $_AT_ $(LDFLAGS) $< $(COM:=.o) $(REQ:=.o) $(LDLIBS)
+ $(CC) -o $_AT_ $(SLSLDFLAGS) $< $(COM:=.o) $(REQ:=.o) $(SLSLIBS)
 
 .c.o:
- $(CC) -o $_AT_ -c $(CPPFLAGS) $(CFLAGS) $<
+ $(CC) -o $_AT_ -c $(SLSCFLAGS) $<
 
 clean:
         rm -f slstatus slstatus.o $(COM:=.o) $(REQ:=.o)
diff --git a/config.mk b/config.mk
index a148da4..bb2324f 100644
--- a/config.mk
+++ b/config.mk
_AT_@ -4,7 +4,7 @@ VERSION = 0
 # customize below to fit your system
 
 # paths
-PREFIX = /usr/local
+PREFIX = /usr/local
 MANPREFIX = ${PREFIX}/share/man
 
 X11INC = /usr/X11R6/include
_AT_@ -14,10 +14,6 @@ X11LIB = /usr/X11R6/lib
 #OSSLIBS = -lossaudio
 
 # flags
-CPPFLAGS = -I$(X11INC) -D_DEFAULT_SOURCE
 CFLAGS = -std=c99 -pedantic -Wall -Wextra -Os
-LDFLAGS = -L$(X11LIB) -s
-LDLIBS = -lX11 ${OSSLIBS}
-
-# compiler and linker
-CC = cc
+LDFLAGS = -s
+LIBS =
Received on Mon Apr 30 2018 - 16:30:20 CEST

This archive was generated by hypermail 2.3.0 : Mon Apr 30 2018 - 16:36:38 CEST