b59e592588
- Add VSync feature. 3 possible VSync methods available: "sw" (software, not too reliable, but at least you have something to fallback to), "drm" (using DRM_IOCTL_WAIT_VBLANK, should work only on DRI drivers), "opengl" (using SGI_swap_control extension OpenGL, might work on more drivers than the DRM method). "sw" and "opengl" are briefly tested, "drm" received utterly no test (because I use the nVidia binary blob). They are enabled with "--vsync sw" / "--vsync drm" / "--vsync opengl". - Add --refresh-rate to let user specify a refresh rate for software VSync, in case the automatic refresh rate detection does not work well. - Seemingly the automatic refresh rate detection using X RandR in software VSync detects refresh rate incorrectly. Need further investigation. - Fix a few bugs in fading timing. - Add a workaround for client window detection on Fluxbox, as Fluxbox (incorrectly?) sets the override-redirect flag upon all frame windows. - Software VSync adds dependency on librt (a part of glibc) for nanosecond-level timing functions, and libXrandr for automatic refresh rate detection; DRM VSync adds dependency on libdrm to use its drm.h, but does not link to libdrm; OpenGL VSync adds dependency on libGL. - Print timing information on DEBUG_REPAINT.
70 lines
1.6 KiB
Makefile
70 lines
1.6 KiB
Makefile
CC ?= gcc
|
|
|
|
PREFIX ?= /usr
|
|
BINDIR ?= $(PREFIX)/bin
|
|
MANDIR ?= $(PREFIX)/share/man/man1
|
|
|
|
PACKAGES = x11 xcomposite xfixes xdamage xrender xext xrandr
|
|
LIBS = -lm -lrt
|
|
INCS =
|
|
|
|
# Parse configuration flags
|
|
CFG =
|
|
|
|
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
|
|
|
|
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
|
|
|
|
ifeq "$(NO_VSYNC_DRM)" ""
|
|
CFG += -DCONFIG_VSYNC_DRM
|
|
endif
|
|
|
|
ifeq "$(NO_VSYNC_OPENGL)" ""
|
|
CFG += -DCONFIG_VSYNC_OPENGL
|
|
LIBS += -lGL
|
|
endif
|
|
|
|
CFLAGS += $(CFG)
|
|
|
|
LIBS += $(shell pkg-config --libs $(PACKAGES))
|
|
INCS += $(shell pkg-config --cflags $(PACKAGES))
|
|
CFLAGS += -Wall -std=c99
|
|
OBJS = compton.o
|
|
|
|
%.o: src/%.c src/%.h
|
|
$(CC) $(CFLAGS) $(INCS) -c src/$*.c
|
|
|
|
compton: $(OBJS)
|
|
$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(OBJS) $(LIBS)
|
|
|
|
install: compton
|
|
@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
|
|
|
|
.PHONY: uninstall clean
|