4 GIT_VERSION:="$(shell git describe --tags --always) ($(shell git log --pretty=format:%cd --date=short -n1))"
5 VERSION:=$(shell git describe --tags --abbrev=0)
12 CFLAGS += -I/usr/local/include
13 CFLAGS += -DI3_VERSION=\"${GIT_VERSION}\"
15 # Check if pkg-config is installed, because without pkg-config, the following
16 # check for the version of libxcb cannot be done.
17 ifeq ($(shell which pkg-config 2>/dev/null 1>/dev/null || echo 1),1)
18 $(error "pkg-config was not found")
21 ifeq ($(shell pkg-config --exists xcb-keysyms || echo 1),1)
22 $(error "pkg-config could not find xcb-keysyms.pc")
25 ifeq ($(shell pkg-config --exact-version=0.3.3 xcb-keysyms && echo 1),1)
26 # xcb-keysyms fixed API from 0.3.3 to 0.3.4, so for some months, we will
27 # have this here. Distributions should upgrade their libxcb in the meantime.
28 CFLAGS += -DOLD_XCB_KEYSYMS_API
32 LDFLAGS += -lxcb-event
33 LDFLAGS += -lxcb-property
34 LDFLAGS += -lxcb-keysyms
37 LDFLAGS += -lxcb-icccm
38 LDFLAGS += -lxcb-xinerama
42 LDFLAGS += -L/usr/local/lib -L/usr/pkg/lib
44 ifeq ($(UNAME),NetBSD)
45 # We need -idirafter instead of -I to prefer the system’s iconv over GNU libiconv
46 CFLAGS += -idirafter /usr/pkg/include
47 LDFLAGS += -Wl,-rpath,/usr/local/lib -Wl,-rpath,/usr/pkg/lib
50 ifeq ($(UNAME),OpenBSD)
51 CFLAGS += -ftrampolines
52 CFLAGS += -I${X11BASE}/include
54 LDFLAGS += -L${X11BASE}/lib
57 ifeq ($(UNAME),FreeBSD)
61 ifneq (,$(filter Linux GNU GNU/%, $(UNAME)))
62 CFLAGS += -D_GNU_SOURCE
66 # Extended debugging flags, macros shall be available in gcc
73 # Don’t print command lines which are run
76 # Always remake the following targets
77 .PHONY: install clean dist distclean