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