Makefile: separate default flags from user flags

This commit is contained in:
Quentin Rameau 2018-04-30 16:11:45 +02:00 committed by Aaron Marcher
parent 085431b282
commit 95665e437b
2 changed files with 9 additions and 9 deletions

View File

@ -27,6 +27,10 @@ COM =\
components/volume\ components/volume\
components/$(OS)/wifi components/$(OS)/wifi
SLSCFLAGS = -I$(X11INC) -D_DEFAULT_SOURCE $(CFLAGS)
SLSLDFLAGS = -L$(X11LIB) $(LDFLAGS)
SLSLIBS = -lX11 $(OSSLIBS) $(LIBS)
all: slstatus all: slstatus
slstatus: slstatus.o $(COM:=.o) $(REQ:=.o) slstatus: slstatus.o $(COM:=.o) $(REQ:=.o)
@ -37,10 +41,10 @@ config.h:
cp config.def.h $@ cp config.def.h $@
.o: .o:
$(CC) -o $@ $(LDFLAGS) $< $(COM:=.o) $(REQ:=.o) $(LDLIBS) $(CC) -o $@ $(SLSLDFLAGS) $< $(COM:=.o) $(REQ:=.o) $(SLSLIBS)
.c.o: .c.o:
$(CC) -o $@ -c $(CPPFLAGS) $(CFLAGS) $< $(CC) -o $@ -c $(SLSCFLAGS) $<
clean: clean:
rm -f slstatus slstatus.o $(COM:=.o) $(REQ:=.o) rm -f slstatus slstatus.o $(COM:=.o) $(REQ:=.o)

View File

@ -4,7 +4,7 @@ VERSION = 0
# customize below to fit your system # customize below to fit your system
# paths # paths
PREFIX = /usr/local PREFIX = /usr/local
MANPREFIX = ${PREFIX}/share/man MANPREFIX = ${PREFIX}/share/man
X11INC = /usr/X11R6/include X11INC = /usr/X11R6/include
@ -14,10 +14,6 @@ X11LIB = /usr/X11R6/lib
#OSSLIBS = -lossaudio #OSSLIBS = -lossaudio
# flags # flags
CPPFLAGS = -I$(X11INC) -D_DEFAULT_SOURCE
CFLAGS = -std=c99 -pedantic -Wall -Wextra -Os CFLAGS = -std=c99 -pedantic -Wall -Wextra -Os
LDFLAGS = -L$(X11LIB) -s LDFLAGS = -s
LDLIBS = -lX11 ${OSSLIBS} LIBS =
# compiler and linker
CC = cc