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:
Richard Grenville 2013-02-05 16:49:27 +08:00
parent 8e34736c19
commit 218250546e
2 changed files with 11 additions and 11 deletions

1
.gitignore vendored
View File

@ -34,6 +34,7 @@ install_manifest.txt
# Misc files
core
*.core
oprofile_data/
compton.plist
callgrind.out.*

View File

@ -14,7 +14,7 @@ INCS =
OBJS = compton.o
# === Configuration flags ===
CFG =
CFG = -std=c99
# ==== libconfig ====
ifeq "$(NO_LIBCONFIG)" ""
@ -67,12 +67,11 @@ CFG += -DCOMPTON_VERSION="\"$(COMPTON_VERSION)\""
LDFLAGS ?= -Wl,-O1 -Wl,--as-needed
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
CFLAGS += -Wall
BINS = compton bin/compton-trans
MANPAGES = man/compton.1 man/compton-trans.1
@ -81,14 +80,14 @@ MANPAGES_HTML = $(addsuffix .html,$(MANPAGES))
# === Recipes ===
.DEFAULT_GOAL := compton
.clang_complete: Makefile
@(for i in $(filter-out -O% -DNDEBUG, $(CFLAGS) $(INCS)); do echo "$$i"; done) > $@
src/.clang_complete: Makefile
@(for i in $(filter-out -O% -DNDEBUG, $(CFG) $(CFLAGS) $(INCS)); do echo "$$i"; done) > $@
%.o: src/%.c src/%.h src/common.h
$(CC) $(CFLAGS) $(INCS) -c src/$*.c
$(CC) $(CFG) $(CFLAGS) $(INCS) -c src/$*.c
compton: $(OBJS)
$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(OBJS) $(LIBS)
$(CC) $(CFG) $(LDFLAGS) $(CFLAGS) -o $@ $(OBJS) $(LIBS)
man/%.1: man/%.1.asciidoc
a2x --format manpage $<
@ -100,12 +99,12 @@ docs: $(MANPAGES) $(MANPAGES_HTML)
install: $(BINS) docs
@install -d "$(DESTDIR)$(BINDIR)" "$(DESTDIR)$(MANDIR)"
@install -D -m755 $(BINS) "$(DESTDIR)$(BINDIR)"/
@install -D -m644 $(MANPAGES) "$(DESTDIR)$(MANDIR)"/
@install -m755 $(BINS) "$(DESTDIR)$(BINDIR)"/
@install -m644 $(MANPAGES) "$(DESTDIR)$(MANDIR)"/
ifneq "$(DOCDIR)" ""
@install -d "$(DESTDIR)$(DOCDIR)"
@install -D -m644 README.md compton.sample.conf "$(DESTDIR)$(DOCDIR)"/
@install -D -m755 dbus-examples/cdbus-driver.sh "$(DESTDIR)$(DOCDIR)"/
@install -m644 README.md compton.sample.conf "$(DESTDIR)$(DOCDIR)"/
@install -m755 dbus-examples/cdbus-driver.sh "$(DESTDIR)$(DOCDIR)"/
endif
uninstall: