Misc #86: Compatibility with BSD install
- Make Makefile compatible with BSD install, by dropping -D. - Make CFG independent in Makefile, to allow people to specify CFLAGS as a parameter to make. - Correct location of .clang_complete.
This commit is contained in:
parent
8e34736c19
commit
218250546e
|
@ -34,6 +34,7 @@ install_manifest.txt
|
||||||
|
|
||||||
# Misc files
|
# Misc files
|
||||||
core
|
core
|
||||||
|
*.core
|
||||||
oprofile_data/
|
oprofile_data/
|
||||||
compton.plist
|
compton.plist
|
||||||
callgrind.out.*
|
callgrind.out.*
|
||||||
|
|
21
Makefile
21
Makefile
|
@ -14,7 +14,7 @@ INCS =
|
||||||
OBJS = compton.o
|
OBJS = compton.o
|
||||||
|
|
||||||
# === Configuration flags ===
|
# === Configuration flags ===
|
||||||
CFG =
|
CFG = -std=c99
|
||||||
|
|
||||||
# ==== libconfig ====
|
# ==== libconfig ====
|
||||||
ifeq "$(NO_LIBCONFIG)" ""
|
ifeq "$(NO_LIBCONFIG)" ""
|
||||||
|
@ -67,12 +67,11 @@ CFG += -DCOMPTON_VERSION="\"$(COMPTON_VERSION)\""
|
||||||
|
|
||||||
LDFLAGS ?= -Wl,-O1 -Wl,--as-needed
|
LDFLAGS ?= -Wl,-O1 -Wl,--as-needed
|
||||||
CFLAGS ?= -DNDEBUG -O2 -D_FORTIFY_SOURCE=2
|
CFLAGS ?= -DNDEBUG -O2 -D_FORTIFY_SOURCE=2
|
||||||
CFLAGS += $(CFG)
|
|
||||||
|
|
||||||
LIBS += $(shell pkg-config --libs $(PACKAGES))
|
LIBS += $(shell pkg-config --libs $(PACKAGES))
|
||||||
INCS += $(shell pkg-config --cflags $(PACKAGES))
|
INCS += $(shell pkg-config --cflags $(PACKAGES))
|
||||||
|
|
||||||
CFLAGS += -Wall -std=c99
|
CFLAGS += -Wall
|
||||||
|
|
||||||
BINS = compton bin/compton-trans
|
BINS = compton bin/compton-trans
|
||||||
MANPAGES = man/compton.1 man/compton-trans.1
|
MANPAGES = man/compton.1 man/compton-trans.1
|
||||||
|
@ -81,14 +80,14 @@ MANPAGES_HTML = $(addsuffix .html,$(MANPAGES))
|
||||||
# === Recipes ===
|
# === Recipes ===
|
||||||
.DEFAULT_GOAL := compton
|
.DEFAULT_GOAL := compton
|
||||||
|
|
||||||
.clang_complete: Makefile
|
src/.clang_complete: Makefile
|
||||||
@(for i in $(filter-out -O% -DNDEBUG, $(CFLAGS) $(INCS)); do echo "$$i"; done) > $@
|
@(for i in $(filter-out -O% -DNDEBUG, $(CFG) $(CFLAGS) $(INCS)); do echo "$$i"; done) > $@
|
||||||
|
|
||||||
%.o: src/%.c src/%.h src/common.h
|
%.o: src/%.c src/%.h src/common.h
|
||||||
$(CC) $(CFLAGS) $(INCS) -c src/$*.c
|
$(CC) $(CFG) $(CFLAGS) $(INCS) -c src/$*.c
|
||||||
|
|
||||||
compton: $(OBJS)
|
compton: $(OBJS)
|
||||||
$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(OBJS) $(LIBS)
|
$(CC) $(CFG) $(LDFLAGS) $(CFLAGS) -o $@ $(OBJS) $(LIBS)
|
||||||
|
|
||||||
man/%.1: man/%.1.asciidoc
|
man/%.1: man/%.1.asciidoc
|
||||||
a2x --format manpage $<
|
a2x --format manpage $<
|
||||||
|
@ -100,12 +99,12 @@ docs: $(MANPAGES) $(MANPAGES_HTML)
|
||||||
|
|
||||||
install: $(BINS) docs
|
install: $(BINS) docs
|
||||||
@install -d "$(DESTDIR)$(BINDIR)" "$(DESTDIR)$(MANDIR)"
|
@install -d "$(DESTDIR)$(BINDIR)" "$(DESTDIR)$(MANDIR)"
|
||||||
@install -D -m755 $(BINS) "$(DESTDIR)$(BINDIR)"/
|
@install -m755 $(BINS) "$(DESTDIR)$(BINDIR)"/
|
||||||
@install -D -m644 $(MANPAGES) "$(DESTDIR)$(MANDIR)"/
|
@install -m644 $(MANPAGES) "$(DESTDIR)$(MANDIR)"/
|
||||||
ifneq "$(DOCDIR)" ""
|
ifneq "$(DOCDIR)" ""
|
||||||
@install -d "$(DESTDIR)$(DOCDIR)"
|
@install -d "$(DESTDIR)$(DOCDIR)"
|
||||||
@install -D -m644 README.md compton.sample.conf "$(DESTDIR)$(DOCDIR)"/
|
@install -m644 README.md compton.sample.conf "$(DESTDIR)$(DOCDIR)"/
|
||||||
@install -D -m755 dbus-examples/cdbus-driver.sh "$(DESTDIR)$(DOCDIR)"/
|
@install -m755 dbus-examples/cdbus-driver.sh "$(DESTDIR)$(DOCDIR)"/
|
||||||
endif
|
endif
|
||||||
|
|
||||||
uninstall:
|
uninstall:
|
||||||
|
|
Loading…
Reference in New Issue