1
0
Fork 0
mirror of https://github.com/yshui/picom.git synced 2024-11-11 13:51:02 -05:00
picom/Makefile

79 lines
1.9 KiB
Makefile
Raw Normal View History

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
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
2011-11-06 19:20:45 -05:00
ifeq "$(NO_VSYNC_DRM)" ""
CFG += -DCONFIG_VSYNC_DRM
endif
ifeq "$(NO_VSYNC_OPENGL)" ""
CFG += -DCONFIG_VSYNC_OPENGL
LIBS += -lGL
endif
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
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)
$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(OBJS) $(LIBS)
2011-11-06 19:20:45 -05:00
docs:
# HTML documentation
asciidoc man/compton.1.asciidoc
asciidoc man/compton-trans.1.asciidoc
# man page
a2x --format manpage man/compton.1.asciidoc
a2x --format manpage man/compton-trans.1.asciidoc
2011-11-06 19:20:45 -05:00
install: compton
2012-03-20 20:30:20 -04:00
@install -Dm755 compton "$(DESTDIR)$(BINDIR)"/compton
@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
@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"
@rm -f "$(DESTDIR)$(BINDIR)/compton-trans"
2012-03-20 20:30:20 -04:00
@rm -f "$(DESTDIR)$(MANDIR)/compton.1"
@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