2012-03-18 09:00:49 +08:00
|
|
|
CC ?= gcc
|
|
|
|
|
2012-02-27 20:49:50 +08:00
|
|
|
PREFIX ?= /usr
|
2012-03-21 08:30:20 +08:00
|
|
|
BINDIR ?= $(PREFIX)/bin
|
|
|
|
MANDIR ?= $(PREFIX)/share/man/man1
|
2012-02-27 20:49:50 +08:00
|
|
|
|
Feature: #7: VSync
- 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.
2012-10-08 10:20:01 +08:00
|
|
|
PACKAGES = x11 xcomposite xfixes xdamage xrender xext xrandr
|
|
|
|
LIBS = -lm -lrt
|
2012-10-03 21:13:34 +08:00
|
|
|
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
|
2011-11-07 08:20:45 +08:00
|
|
|
|
Feature: #7: VSync
- 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.
2012-10-08 10:20:01 +08:00
|
|
|
ifeq "$(NO_VSYNC_DRM)" ""
|
|
|
|
CFG += -DCONFIG_VSYNC_DRM
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq "$(NO_VSYNC_OPENGL)" ""
|
|
|
|
CFG += -DCONFIG_VSYNC_OPENGL
|
|
|
|
LIBS += -lGL
|
|
|
|
endif
|
|
|
|
|
2012-10-10 21:12:46 +08:00
|
|
|
CFLAGS ?= -DNDEBUG
|
2012-09-28 09:10:34 +08:00
|
|
|
CFLAGS += $(CFG)
|
|
|
|
|
2012-10-03 21:13:34 +08:00
|
|
|
LIBS += $(shell pkg-config --libs $(PACKAGES))
|
|
|
|
INCS += $(shell pkg-config --cflags $(PACKAGES))
|
|
|
|
CFLAGS += -Wall -std=c99
|
|
|
|
OBJS = compton.o
|
|
|
|
|
2012-02-27 15:42:38 +08:00
|
|
|
%.o: src/%.c src/%.h
|
|
|
|
$(CC) $(CFLAGS) $(INCS) -c src/$*.c
|
2011-11-07 08:20:45 +08:00
|
|
|
|
|
|
|
compton: $(OBJS)
|
2012-03-18 09:00:49 +08:00
|
|
|
$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(OBJS) $(LIBS)
|
2011-11-07 08:20:45 +08:00
|
|
|
|
|
|
|
install: compton
|
2012-03-21 08:30:20 +08:00
|
|
|
@install -Dm755 compton "$(DESTDIR)$(BINDIR)"/compton
|
2012-06-24 06:39:49 +08:00
|
|
|
@install -Dm755 bin/compton-trans "$(DESTDIR)$(BINDIR)"/compton-trans
|
2012-03-21 08:30:20 +08:00
|
|
|
@install -Dm644 man/compton.1 "$(DESTDIR)$(MANDIR)"/compton.1
|
2012-06-24 06:39:49 +08:00
|
|
|
@install -Dm644 man/compton-trans.1 "$(DESTDIR)$(MANDIR)"/compton-trans.1
|
2011-11-07 08:20:45 +08:00
|
|
|
|
|
|
|
uninstall:
|
2012-03-21 08:30:20 +08:00
|
|
|
@rm -f "$(DESTDIR)$(BINDIR)/compton"
|
2012-06-24 06:39:49 +08:00
|
|
|
@rm -f "$(DESTDIR)$(BINDIR)/compton-trans"
|
2012-03-21 08:30:20 +08:00
|
|
|
@rm -f "$(DESTDIR)$(MANDIR)/compton.1"
|
2012-06-24 06:39:49 +08:00
|
|
|
@rm -f "$(DESTDIR)$(MANDIR)/compton-trans.1"
|
2011-11-07 08:20:45 +08:00
|
|
|
|
|
|
|
clean:
|
2011-12-09 22:46:40 +08:00
|
|
|
@rm -f $(OBJS) compton
|
2011-11-07 08:20:45 +08:00
|
|
|
|
|
|
|
.PHONY: uninstall clean
|