]> git.sur5r.net Git - i3/i3/commitdiff
common.mk: Split XCB common flags
authorQuentin Glidic <sardemff7+git@sardemff7.net>
Sun, 22 Jul 2012 22:10:42 +0000 (00:10 +0200)
committerQuentin Glidic <sardemff7+git@sardemff7.net>
Sun, 22 Jul 2012 22:12:55 +0000 (00:12 +0200)
common.mk
i3-config-wizard/i3-config-wizard.mk
i3-dump-log/i3-dump-log.mk
i3-input/i3-input.mk
i3-msg/i3-msg.mk
i3-nagbar/i3-nagbar.mk
i3bar/i3bar.mk
src/i3.mk

index 3b75d380b1ef077af2fd0e6654e5fc691bd63b57..d6a7572f94fd463a6fb3844a0cdfd2f71d15267f 100644 (file)
--- a/common.mk
+++ b/common.mk
@@ -63,24 +63,23 @@ endif
 cflags_for_lib = $(shell pkg-config --silence-errors --cflags $(1) 2>/dev/null)
 ldflags_for_lib = $(shell pkg-config --exists 2>/dev/null $(1) && pkg-config --libs $(1) 2>/dev/null || echo -l$(2))
 
-ifeq ($(shell pkg-config --exists xcb-util 2>/dev/null || echo 1),1)
-I3_CPPFLAGS += -DXCB_COMPAT
-CFLAGS += $(call cflags_for_lib, xcb-atom)
-CFLAGS += $(call cflags_for_lib, xcb-aux)
-else
-CFLAGS += $(call cflags_for_lib, xcb-util)
-endif
-CFLAGS += $(call cflags_for_lib, xcb)
 
 LIBS += -L $(TOPDIR) -li3
-LIBS += $(call ldflags_for_lib, xcb-event,xcb-event)
+
+# XCB common stuff
+XCB_CFLAGS  := $(call cflags_for_lib, xcb)
+XCB_CFLAGS  += $(call cflags_for_lib, xcb-event)
+XCB_LIBS    := $(call ldflags_for_lib, xcb,xcb)
+XCB_LIBS    += $(call ldflags_for_lib, xcb-event,xcb-event)
 ifeq ($(shell pkg-config --exists xcb-util 2>/dev/null || echo 1),1)
-LIBS += $(call ldflags_for_lib, xcb-atom,xcb-atom)
-LIBS += $(call ldflags_for_lib, xcb-aux,xcb-aux)
+XCB_CFLAGS  += $(call cflags_for_lib, xcb-atom)
+XCB_CFLAGS  += $(call cflags_for_lib, xcb-aux)
+XCB_LIBS    += $(call ldflags_for_lib, xcb-atom,xcb-atom)
+XCB_LIBS    += $(call ldflags_for_lib, xcb-aux,xcb-aux)
 else
-LIBS += $(call ldflags_for_lib, xcb-util)
+XCB_CFLAGS  += $(call cflags_for_lib, xcb-util)
+XCB_LIBS    += $(call ldflags_for_lib, xcb-util)
 endif
-LIBS += $(call ldflags_for_lib, xcb,xcb)
 
 # XCB keyboard stuff
 XCB_KBD_CFLAGS := $(call cflags_for_lib, xcb-keysyms)
index 1d2bc37aa0c0c041dec61e39f22ddd5049a3e11f..bce679dfc932c06f0b918bc6a1e8e058dff838f0 100644 (file)
@@ -5,8 +5,8 @@ CLEAN_TARGETS += clean-i3-config-wizard
 i3_config_wizard_SOURCES_GENERATED  = i3-config-wizard/cfgparse.tab.c i3-config-wizard/cfgparse.yy.c
 i3_config_wizard_SOURCES           := $(filter-out $(i3_config_wizard_SOURCES_GENERATED),$(wildcard i3-config-wizard/*.c))
 i3_config_wizard_HEADERS           := $(wildcard i3-config-wizard/*.h)
-i3_config_wizard_CFLAGS             = $(XCB_KBD_CFLAGS) $(X11_CFLAGS)
-i3_config_wizard_LIBS               = $(XCB_KBD_LIBS) $(X11_LIBS)
+i3_config_wizard_CFLAGS             = $(XCB_CFLAGS) $(XCB_KBD_CFLAGS) $(X11_CFLAGS)
+i3_config_wizard_LIBS               = $(XCB_LIBS) $(XCB_KBD_LIBS) $(X11_LIBS)
 
 i3_config_wizard_OBJECTS := $(i3_config_wizard_SOURCES_GENERATED:.c=.o) $(i3_config_wizard_SOURCES:.c=.o)
 
index edaead4c68548a52d8a125f18908d761e5ab4783..1508a8dc25260965f3dd5c25120bb740a9725cd4 100644 (file)
@@ -4,8 +4,8 @@ CLEAN_TARGETS += clean-i3-dump-log
 
 i3_dump_log_SOURCES := $(wildcard i3-dump-log/*.c)
 i3_dump_log_HEADERS := $(wildcard i3-dump-log/*.h)
-i3_dump_log_CFLAGS   =
-i3_dump_log_LIBS     =
+i3_dump_log_CFLAGS   = $(XCB_CFLAGS)
+i3_dump_log_LIBS     = $(XCB_LIBS)
 
 i3_dump_log_OBJECTS := $(i3_dump_log_SOURCES:.c=.o)
 
index 849fbc694b0a3b6002a87b26cd61f56faa46526c..9fb4b194704d2ed928c7063325f9410f03849fd4 100644 (file)
@@ -4,8 +4,8 @@ CLEAN_TARGETS += clean-i3-input
 
 i3_input_SOURCES := $(wildcard i3-input/*.c)
 i3_input_HEADERS := $(wildcard i3-input/*.h)
-i3_input_CFLAGS   = $(XCB_KBD_CFLAGS)
-i3_input_LIBS     = $(XCB_KBD_LIBS)
+i3_input_CFLAGS   = $(XCB_CFLAGS) $(XCB_KBD_CFLAGS)
+i3_input_LIBS     = $(XCB_LIBS) $(XCB_KBD_LIBS)
 
 i3_input_OBJECTS := $(i3_input_SOURCES:.c=.o)
 
index b835185c657c9b18073af678b3aecd85a287fd62..bab26da63fff9f32c16f76fee767bbb6acf04a6d 100644 (file)
@@ -4,8 +4,8 @@ CLEAN_TARGETS += clean-i3-msg
 
 i3_msg_SOURCES := $(wildcard i3-msg/*.c)
 i3_msg_HEADERS := $(wildcard i3-msg/*.h)
-i3_msg_CFLAGS   =
-i3_msg_LIBS     =
+i3_msg_CFLAGS   = $(XCB_CFLAGS)
+i3_msg_LIBS     = $(XCB_LIBS)
 
 i3_msg_OBJECTS := $(i3_msg_SOURCES:.c=.o)
 
index 37c91a982b7bf6958213bed8043a3d18682a8cf7..f54d8380554d3c5c4475f12899917ca6bad74c37 100644 (file)
@@ -4,8 +4,8 @@ CLEAN_TARGETS += clean-i3-nagbar
 
 i3_nagbar_SOURCES := $(wildcard i3-nagbar/*.c)
 i3_nagbar_HEADERS := $(wildcard i3-nagbar/*.h)
-i3_nagbar_CFLAGS   =
-i3_nagbar_LIBS     =
+i3_nagbar_CFLAGS   = $(XCB_CFLAGS)
+i3_nagbar_LIBS     = $(XCB_LIBS)
 
 i3_nagbar_OBJECTS := $(i3_nagbar_SOURCES:.c=.o)
 
index 9ede97f608d2c46aa6abb44cb777a5253dd8f053..cf3bf346a0a41facd167da9413c2c34fc91688f0 100644 (file)
@@ -4,8 +4,8 @@ CLEAN_TARGETS += clean-i3bar
 
 i3bar_SOURCES := $(wildcard i3bar/src/*.c)
 i3bar_HEADERS := $(wildcard i3bar/include/*.h)
-i3bar_CFLAGS   = $(X11_CFLAGS) $(YAJL_CFLAGS) $(LIBEV_CFLAGS)
-i3bar_LIBS     = $(X11_LIBS) $(YAJL_LIBS) $(LIBEV_LIBS)
+i3bar_CFLAGS   = $(XCB_CFLAGS) $(X11_CFLAGS) $(YAJL_CFLAGS) $(LIBEV_CFLAGS)
+i3bar_LIBS     = $(XCB_LIBS) $(X11_LIBS) $(YAJL_LIBS) $(LIBEV_LIBS)
 
 i3bar_OBJECTS := $(i3bar_SOURCES:.c=.o)
 
index 49b7ce469ec4efa6d19c0731becdce3038dbf831..6030bbc6b79ffde5ccabf263daddfeefaaf9bbf9 100644 (file)
--- a/src/i3.mk
+++ b/src/i3.mk
@@ -6,8 +6,8 @@ i3_SOURCES_GENERATED  = src/cfgparse.tab.c src/cfgparse.yy.c
 i3_SOURCES           := $(filter-out $(i3_SOURCES_GENERATED),$(wildcard src/*.c))
 i3_HEADERS_CMDPARSER := $(wildcard include/GENERATED_*.h)
 i3_HEADERS           := $(filter-out $(i3_HEADERS_CMDPARSER),$(wildcard include/*.h))
-i3_CFLAGS             = $(XCB_KBD_CFLAGS) $(XCB_WM_CFLAGS) $(X11_CFLAGS) $(XCURSOR_CFLAGS) $(YAJL_CFLAGS) $(LIBEV_CFLAGS) $(PCRE_CFLAGS) $(LIBSN_CFLAGS)
-i3_LIBS               = $(XCB_KBD_LIBS) $(XCB_WM_LIBS) $(X11_LIBS) $(XCURSOR_LIBS) $(YAJL_LIBS) $(LIBEV_LIBS) $(PCRE_LIBS) $(LIBSN_LIBS) -lm
+i3_CFLAGS             = $(XCB_CFLAGS) $(XCB_KBD_CFLAGS) $(XCB_WM_CFLAGS) $(X11_CFLAGS) $(XCURSOR_CFLAGS) $(YAJL_CFLAGS) $(LIBEV_CFLAGS) $(PCRE_CFLAGS) $(LIBSN_CFLAGS)
+i3_LIBS               = $(XCB_LIBS) $(XCB_KBD_LIBS) $(XCB_WM_LIBS) $(X11_LIBS) $(XCURSOR_LIBS) $(YAJL_LIBS) $(LIBEV_LIBS) $(PCRE_LIBS) $(LIBSN_LIBS) -lm
 
 i3_OBJECTS := $(i3_SOURCES_GENERATED:.c=.o) $(i3_SOURCES:.c=.o)