DEBUG=1
COVERAGE=0
INSTALL=install
+FLEX=flex
+BISON=bison
ifndef PREFIX
PREFIX=/usr
endif
# We redirect stderr to /dev/null because pkg-config prints an error if support
# for gnome-config was enabled but gnome-config is not actually installed.
cflags_for_lib = $(shell pkg-config --silence-errors --cflags $(1) 2>/dev/null)
-ldflags_for_lib = $(shell pkg-config --exists $(1) && pkg-config --libs $(1) 2>/dev/null || echo -l$(2))
+ldflags_for_lib = $(shell pkg-config --exists 2>/dev/null $(1) && pkg-config --libs $(1) 2>/dev/null || echo -l$(2))
CFLAGS += -std=c99
CFLAGS += -pipe
CFLAGS += $(call cflags_for_lib, yajl)
CFLAGS += $(call cflags_for_lib, libev)
CFLAGS += $(call cflags_for_lib, libpcre)
+CFLAGS += $(call cflags_for_lib, libstartup-notification-1.0)
CPPFLAGS += -DI3_VERSION=\"${GIT_VERSION}\"
CPPFLAGS += -DSYSCONFDIR=\"${SYSCONFDIR}\"
-CPPFLAGS += -DTERM_EMU=\"$(TERM_EMU)\"
-ifeq ($(shell pkg-config --atleast-version=8.10 libpcre && echo 1),1)
+ifeq ($(shell pkg-config --atleast-version=8.10 libpcre 2>/dev/null && echo 1),1)
CPPFLAGS += -DPCRE_HAS_UCP=1
endif
LIBS += -lm
+# Darwin (Mac OS X) doesn’t have librt
+ifneq ($(UNAME),Darwin)
+LIBS += -lrt
+endif
LIBS += -L $(TOPDIR)/libi3 -li3
LIBS += $(call ldflags_for_lib, xcb-event,xcb-event)
LIBS += $(call ldflags_for_lib, xcb-keysyms,xcb-keysyms)
LIBS += $(call ldflags_for_lib, yajl,yajl)
LIBS += $(call ldflags_for_lib, libev,ev)
LIBS += $(call ldflags_for_lib, libpcre,pcre)
+LIBS += $(call ldflags_for_lib, libstartup-notification-1.0,startup-notification-1)
# Please test if -Wl,--as-needed works on your platform and send me a patch.
# it is known not to work on Darwin (Mac OS X)