+INSTALL=install
+DEBUG=1
+PREFIX=/usr
+
+# The escaping is absurd, but we need to escape for shell, sed, make, define
+GIT_VERSION:="$(shell git describe --tags --always) ($(shell git log --pretty=format:%cd --date=short -n1), branch $(shell [ -f .git/HEAD ] && sed 's/ref: refs\/heads\/\(.*\)/\\\\\\"\1\\\\\\"/g' .git/HEAD || echo 'unknown'))"
+
CFLAGS += -Wall
CFLAGS += -pipe
CFLAGS += -Iinclude
CFLAGS += -g
+CFLAGS += -DI3BAR_VERSION=\"${GIT_VERSION}\"
+
LDFLAGS += -lev
LDFLAGS += -lyajl
LDFLAGS += -lxcb
LDFLAGS += -lxcb-atom
+LDFLAGS += -L/usr/local/lib
+
+ifeq ($(DEBUG),1)
+CFLAGS += -g3
+else
+CFLAGS += -O2
+endif
+
.SILENT:
+
+.PHONY: install clean
{ "command", required_argument, 0, 'c' },
{ "font", required_argument, 0, 'f' },
{ "help", no_argument, 0, 'h' },
+ { "version", no_argument, 0, 'v' },
{ NULL, 0, 0, 0}
};
- while ((opt = getopt_long(argc, argv, "s:c:f:h", long_opt, &option_index)) != -1) {
+ while ((opt = getopt_long(argc, argv, "s:c:f:hv", long_opt, &option_index)) != -1) {
switch (opt) {
case 's':
socket_path = expand_path(optarg);
case 'f':
fontname = strdup(optarg);
break;
+ case 'v':
+ printf("i3bar version " I3BAR_VERSION " © 2010 Axel Wagner and contributors\n");
+ exit(EXIT_SUCCESS);
default:
printf("Usage: %s [-s socket_path] [-c command] [-f font] [-h]\n", argv[0]);
printf("-s <socket_path>: Connect to i3 via <socket_path>\n");