58c0ecec40
- Add D-Bus support. Currently 7 methods are available: "reset" (same as SIGUSR1), "list_win" (list the windows compton manages), "win_get" (get a property of the window), "win_set" (set a property of the window), "find_win" (find window based on client window / focus), "opts_get" (get the value of a compton option), and "opts_set" (set the value of a compton option), together with 4 signals: "win_added", "win_destroyed", "win_mapped", "win_unmapped". - D-Bus support depends on libdbus. - As there are many items and my time is tight, no much tests are done. Bugs to be expected. - Create a new header file `common.h` that contains shared content. - Fix some bugs in timeout handling. - Update file headers in all source files. - Re-enable --unredir-if-possible on multi-screen set-ups, as the user could turn if off manually anyway. - Check if the window is mapped in `repair_win()`. - Add ps->track_atom_lst and its handlers, to prepare for the new condition format. - Known issue 1: "win_get", "win_set", "opts_get", "opts_set" support a very limited number of targets only. New ones will be added gradually. - Known issue 2: Accidental drop of D-Bus connection is not handled. - Known issue 3: Introspection does not reveal all available methods, because some methods have unpredictable prototypes. Still hesitating about what to do... - Known issue 4: Error handling is not finished yet. Compton does not always reply with the correct error message (but it does print out the correct error message, usually).
105 lines
2.5 KiB
Makefile
105 lines
2.5 KiB
Makefile
# Use tab to indent recipe lines, spaces to indent other lines, otherwise
|
|
# GNU make may get unhappy.
|
|
|
|
CC ?= gcc
|
|
|
|
PREFIX ?= /usr
|
|
BINDIR ?= $(PREFIX)/bin
|
|
MANDIR ?= $(PREFIX)/share/man/man1
|
|
|
|
PACKAGES = x11 xcomposite xfixes xdamage xrender xext xrandr
|
|
LIBS = -lm -lrt
|
|
INCS =
|
|
|
|
OBJS = compton.o
|
|
|
|
# === Configuration flags ===
|
|
CFG =
|
|
|
|
# ==== libconfig ====
|
|
ifeq "$(NO_LIBCONFIG)" ""
|
|
CFG += -DCONFIG_LIBCONFIG
|
|
PACKAGES += libconfig
|
|
|
|
# libconfig-1.3* does not define LIBCONFIG_VER* macros, so we use
|
|
# pkg-config to determine its version here
|
|
CFG += $(shell pkg-config --atleast-version=1.4 libconfig || echo '-DCONFIG_LIBCONFIG_LEGACY')
|
|
endif
|
|
|
|
# ==== PCRE regular expression ====
|
|
ifeq "$(NO_REGEX_PCRE)" ""
|
|
CFG += -DCONFIG_REGEX_PCRE
|
|
LIBS += $(shell pcre-config --libs)
|
|
INCS += $(shell pcre-config --cflags)
|
|
ifeq "$(NO_REGEX_PCRE_JIT)" ""
|
|
CFG += -DCONFIG_REGEX_PCRE_JIT
|
|
endif
|
|
endif
|
|
|
|
# ==== DRM VSync ====
|
|
ifeq "$(NO_VSYNC_DRM)" ""
|
|
CFG += -DCONFIG_VSYNC_DRM
|
|
endif
|
|
|
|
# ==== OpenGL VSync ====
|
|
ifeq "$(NO_VSYNC_OPENGL)" ""
|
|
CFG += -DCONFIG_VSYNC_OPENGL
|
|
LIBS := -lGL $(LIBS)
|
|
endif
|
|
|
|
# ==== D-Bus ====
|
|
ifeq "$(NO_DBUS)" ""
|
|
CFG += -DCONFIG_DBUS
|
|
PACKAGES += dbus-1
|
|
OBJS += dbus.o
|
|
endif
|
|
|
|
# === Version string ===
|
|
COMPTON_VERSION ?= git-$(shell git describe --always --dirty)-$(shell git log -1 --date=short --pretty=format:%cd)
|
|
CFG += -DCOMPTON_VERSION="\"$(COMPTON_VERSION)\""
|
|
|
|
LDFLAGS ?= -Wl,-O1 -Wl,--as-needed
|
|
CFLAGS ?= -DNDEBUG -O2 -D_FORTIFY_SOURCE=2
|
|
CFLAGS += $(CFG)
|
|
|
|
LIBS += $(shell pkg-config --libs $(PACKAGES))
|
|
INCS += $(shell pkg-config --cflags $(PACKAGES))
|
|
|
|
CFLAGS += -Wall -std=c99
|
|
MANPAGES = man/compton.1 man/compton-trans.1
|
|
MANPAGES_HTML = $(addsuffix .html,$(MANPAGES))
|
|
|
|
# === Recipes ===
|
|
.DEFAULT_GOAL := compton
|
|
|
|
%.o: src/%.c src/%.h src/common.h
|
|
$(CC) $(CFLAGS) $(INCS) -c src/$*.c
|
|
|
|
compton: $(OBJS)
|
|
$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(OBJS) $(LIBS)
|
|
|
|
man/%.1: man/%.1.asciidoc
|
|
a2x --format manpage $<
|
|
|
|
man/%.1.html: man/%.1.asciidoc
|
|
asciidoc $<
|
|
|
|
docs: $(MANPAGES) $(MANPAGES_HTML)
|
|
|
|
install: compton docs
|
|
@install -Dm755 compton "$(DESTDIR)$(BINDIR)"/compton
|
|
@install -Dm755 bin/compton-trans "$(DESTDIR)$(BINDIR)"/compton-trans
|
|
@install -Dm644 man/compton.1 "$(DESTDIR)$(MANDIR)"/compton.1
|
|
@install -Dm644 man/compton-trans.1 "$(DESTDIR)$(MANDIR)"/compton-trans.1
|
|
|
|
uninstall:
|
|
@rm -f "$(DESTDIR)$(BINDIR)/compton"
|
|
@rm -f "$(DESTDIR)$(BINDIR)/compton-trans"
|
|
@rm -f "$(DESTDIR)$(MANDIR)/compton.1"
|
|
@rm -f "$(DESTDIR)$(MANDIR)/compton-trans.1"
|
|
|
|
clean:
|
|
@rm -f $(OBJS) compton $(MANPAGES) $(MANPAGES_HTML)
|
|
|
|
.PHONY: uninstall clean docs
|