Merge pull request #13 from hasufell/patch-1

improve build system
This commit is contained in:
Christopher Jeffrey 2012-03-17 18:05:53 -07:00
commit efd5643858
1 changed files with 9 additions and 10 deletions

View File

@ -1,26 +1,25 @@
CC ?= gcc
PREFIX ?= /usr
BINDIR ?= $(PREFIX)/bin
MANDIR ?= $(PREFIX)/share/man/man1
PACKAGES = x11 xcomposite xfixes xdamage xrender
LIBS = `pkg-config --libs $(PACKAGES)` -lm
INCS = `pkg-config --cflags $(PACKAGES)`
CFLAGS = -Wall
LIBS = $(shell pkg-config --libs $(PACKAGES)) -lm
INCS = $(shell pkg-config --cflags $(PACKAGES))
CFLAGS += -Wall
OBJS = compton.o
%.o: src/%.c src/%.h
$(CC) $(CFLAGS) $(INCS) -c src/$*.c
compton: $(OBJS)
$(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS)
$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(OBJS) $(LIBS)
install: compton
@[ -e "$(PREFIX)" ] || mkdir -p "$(PREFIX)"
@[ -e "$(BINDIR)" ] || mkdir -p "$(BINDIR)"
@[ -e "$(MANDIR)" ] || mkdir -p "$(MANDIR)"
@cp compton "$(BINDIR)"
@cp bin/settrans "$(BINDIR)"
@cp man/compton.1 "$(MANDIR)"
@install -Dm755 compton "$(BINDIR)"/compton
@install -Dm755 bin/settrans "$(BINDIR)"/settrans
@install -Dm644 man/compton.1 "$(MANDIR)"/compton.1
uninstall:
@rm -f "$(BINDIR)/compton"