]> git.lizzy.rs Git - bspwm.git/commitdiff
separate rules for debug and stripped binaries
authorIvan Kanakarakis <ivan.kanak@gmail.com>
Wed, 3 Oct 2012 17:53:16 +0000 (20:53 +0300)
committerIvan Kanakarakis <ivan.kanak@gmail.com>
Wed, 3 Oct 2012 17:53:16 +0000 (20:53 +0300)
Makefile

index 2ffd2acc77bb9ad338a2dffc1c90ed4abf848015..fc508d997854e80280a8e7a03c93b64d09869469 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@ VERSION = 0.1
 
 CC      = gcc
 LIBS    = -lm -lxcb -lxcb-icccm -lxcb-ewmh
-CFLAGS  = -g -std=c99 -pedantic -Wall -Wextra -DDEBUG
+CFLAGS  = -std=c99 -pedantic -Wall -Wextra
 LDFLAGS = $(LIBS)
 
 PREFIX    ?= /usr/local
@@ -14,7 +14,12 @@ CL_SRC = bspc.c helpers.c
 WM_OBJ = $(WM_SRC:.c=.o)
 CL_OBJ = $(CL_SRC:.c=.o)
 
-all: options clean bspwm bspc
+debug: CFLAGS += -O0 -g -DDEBUG
+debug: options bspwm bspc
+
+all: CFLAGS += -Os
+all: LDFLAGS += -s
+all: options bspwm bspc
 
 options:
        @echo "bspwm build options:"
@@ -27,11 +32,11 @@ options:
        @echo "CC $<"
        @$(CC) $(CFLAGS) -DVERSION=\"$(VERSION)\" -c -o $@ $<
 
-bspwm:  $(WM_OBJ)
+bspwm: $(WM_OBJ)
        @echo CC -o $@
        @$(CC) -o $@ $(WM_OBJ) $(LDFLAGS)
 
-bspc:   $(CL_OBJ)
+bspc: $(CL_OBJ)
        @echo CC -o $@
        @$(CC) -o $@ $(CL_OBJ) $(LDFLAGS)