make i3bar use i3’s common.mk
This commit is contained in:
parent
22bac9fd9a
commit
339a7cb8c3
2
Makefile
2
Makefile
|
@ -18,7 +18,7 @@ else
|
||||||
UNUSED:=$(shell $(MAKE) loglevels.h)
|
UNUSED:=$(shell $(MAKE) loglevels.h)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
SUBDIRS=i3-msg i3-input i3-nagbar i3-config-wizard
|
SUBDIRS=i3-msg i3-input i3-nagbar i3-config-wizard i3bar
|
||||||
|
|
||||||
# Depend on the specific file (.c for each .o) and on all headers
|
# Depend on the specific file (.c for each .o) and on all headers
|
||||||
src/%.o: src/%.c ${HEADERS}
|
src/%.o: src/%.c ${HEADERS}
|
||||||
|
|
|
@ -93,7 +93,7 @@ endif
|
||||||
|
|
||||||
# Fallback for libyajl 1 which did not include yajl_version.h. We need
|
# Fallback for libyajl 1 which did not include yajl_version.h. We need
|
||||||
# YAJL_MAJOR from that file to decide which code path should be used.
|
# YAJL_MAJOR from that file to decide which code path should be used.
|
||||||
CFLAGS += -idirafter yajl-fallback
|
CFLAGS += -idirafter $(TOPDIR)/yajl-fallback
|
||||||
|
|
||||||
ifneq (,$(filter Linux GNU GNU/%, $(UNAME)))
|
ifneq (,$(filter Linux GNU GNU/%, $(UNAME)))
|
||||||
CPPFLAGS += -D_GNU_SOURCE
|
CPPFLAGS += -D_GNU_SOURCE
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
TOPDIR=$(shell pwd)
|
TOPDIR=..
|
||||||
|
|
||||||
include $(TOPDIR)/common.mk
|
include $(TOPDIR)/common.mk
|
||||||
|
|
||||||
|
@ -6,11 +6,13 @@ FILES:=$(wildcard src/*.c)
|
||||||
FILES:=$(FILES:.c=.o)
|
FILES:=$(FILES:.c=.o)
|
||||||
HEADERS:=$(wildcard include/*.h)
|
HEADERS:=$(wildcard include/*.h)
|
||||||
|
|
||||||
|
CPPFLAGS += -I$(TOPDIR)/include
|
||||||
|
|
||||||
all: i3bar doc
|
all: i3bar doc
|
||||||
|
|
||||||
i3bar: ${FILES}
|
i3bar: ${FILES}
|
||||||
echo "LINK"
|
echo "LINK"
|
||||||
$(CC) -o i3bar ${FILES} ${LDFLAGS}
|
$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
|
||||||
|
|
||||||
doc:
|
doc:
|
||||||
echo ""
|
echo ""
|
||||||
|
|
|
@ -1,35 +0,0 @@
|
||||||
INSTALL=install
|
|
||||||
ifndef DEBUG
|
|
||||||
DEBUG=1
|
|
||||||
endif
|
|
||||||
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'))"
|
|
||||||
|
|
||||||
# Fallback for libyajl 1 which did not include yajl_version.h. We need
|
|
||||||
# YAJL_MAJOR from that file to decide which code path should be used.
|
|
||||||
CFLAGS += -idirafter yajl-fallback
|
|
||||||
|
|
||||||
CFLAGS += -Wall
|
|
||||||
CFLAGS += -pipe
|
|
||||||
CFLAGS += -g
|
|
||||||
|
|
||||||
CPPFLAGS += -DI3BAR_VERSION=\"${GIT_VERSION}\"
|
|
||||||
CPPFLAGS += -Iinclude
|
|
||||||
|
|
||||||
LDFLAGS += -lev
|
|
||||||
LDFLAGS += -lyajl
|
|
||||||
LDFLAGS += -lxcb
|
|
||||||
LDFLAGS += -lX11
|
|
||||||
LDFLAGS += -L/usr/local/lib
|
|
||||||
|
|
||||||
ifeq ($(DEBUG),1)
|
|
||||||
CFLAGS += -g3
|
|
||||||
else
|
|
||||||
CFLAGS += -O2
|
|
||||||
endif
|
|
||||||
|
|
||||||
.SILENT:
|
|
||||||
|
|
||||||
.PHONY: install clean
|
|
|
@ -184,7 +184,7 @@ int main(int argc, char **argv) {
|
||||||
config.disable_ws = 1;
|
config.disable_ws = 1;
|
||||||
break;
|
break;
|
||||||
case 'v':
|
case 'v':
|
||||||
printf("i3bar version " I3BAR_VERSION " © 2010-2011 Axel Wagner and contributors\n");
|
printf("i3bar version " I3_VERSION " © 2010-2011 Axel Wagner and contributors\n");
|
||||||
exit(EXIT_SUCCESS);
|
exit(EXIT_SUCCESS);
|
||||||
break;
|
break;
|
||||||
case 'V':
|
case 'V':
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
#ifndef YAJL_VERSION_H_
|
|
||||||
#define YAJL_VERSION_H_
|
|
||||||
/* Fallback for libyajl 1 which does not provide yajl_version.h */
|
|
||||||
#define YAJL_MAJOR 1
|
|
||||||
#define YAJL_MINOR 0
|
|
||||||
#define YAJL_MICRO 0
|
|
||||||
#endif
|
|
Loading…
Reference in New Issue