makefiles: support PREFIX and SYSCONFDIR

This commit is contained in:
Michael Stapelberg 2010-03-16 00:08:54 +01:00
parent 29c4ac9395
commit 1bce8f2104
4 changed files with 19 additions and 13 deletions

View File

@ -56,15 +56,15 @@ src/cfgparse.y.o: src/cfgparse.y ${HEADERS}
install: all
echo "INSTALL"
$(INSTALL) -d -m 0755 $(DESTDIR)/usr/bin
$(INSTALL) -d -m 0755 $(DESTDIR)/etc/i3
$(INSTALL) -d -m 0755 $(DESTDIR)/usr/include/i3
$(INSTALL) -d -m 0755 $(DESTDIR)/usr/share/xsessions
$(INSTALL) -m 0755 i3 $(DESTDIR)/usr/bin/
test -e $(DESTDIR)/etc/i3/config || $(INSTALL) -m 0644 i3.config $(DESTDIR)/etc/i3/config
$(INSTALL) -m 0644 i3.welcome $(DESTDIR)/etc/i3/welcome
$(INSTALL) -m 0644 i3.desktop $(DESTDIR)/usr/share/xsessions/
$(INSTALL) -m 0644 include/i3/ipc.h $(DESTDIR)/usr/include/i3/
$(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/bin
$(INSTALL) -d -m 0755 $(DESTDIR)$(SYSCONFDIR)/i3
$(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/include/i3
$(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/share/xsessions
$(INSTALL) -m 0755 i3 $(DESTDIR)$(PREFIX)/bin/
test -e $(DESTDIR)$(SYSCONFDIR)/i3/config || $(INSTALL) -m 0644 i3.config $(DESTDIR)$(SYSCONFDIR)/i3/config
$(INSTALL) -m 0644 i3.welcome $(DESTDIR)$(SYSCONFDIR)/i3/welcome
$(INSTALL) -m 0644 i3.desktop $(DESTDIR)$(PREFIX)/share/xsessions/
$(INSTALL) -m 0644 include/i3/ipc.h $(DESTDIR)$(PREFIX)/include/i3/
$(MAKE) TOPDIR=$(TOPDIR) -C i3-msg install
$(MAKE) TOPDIR=$(TOPDIR) -C i3-input install

View File

@ -1,6 +1,12 @@
UNAME=$(shell uname)
DEBUG=1
INSTALL=install
PREFIX=/usr
ifeq ($(PREFIX),/usr)
SYSCONFDIR=/etc
else
SYSCONFDIR=$(PREFIX)/etc
endif
GIT_VERSION:="$(shell git describe --tags --always) ($(shell git log --pretty=format:%cd --date=short -n1))"
VERSION:=$(shell git describe --tags --abbrev=0)

View File

@ -18,8 +18,8 @@ all: ${FILES}
install: all
echo "INSTALL"
$(INSTALL) -d -m 0755 $(DESTDIR)/usr/bin
$(INSTALL) -m 0755 i3-input $(DESTDIR)/usr/bin/
$(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/bin
$(INSTALL) -m 0755 i3-input $(DESTDIR)$(PREFIX)/bin/
clean:
rm -f *.o

View File

@ -20,8 +20,8 @@ all: ${FILES}
install: all
echo "INSTALL"
$(INSTALL) -d -m 0755 $(DESTDIR)/usr/bin
$(INSTALL) -m 0755 i3-msg $(DESTDIR)/usr/bin/
$(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/bin
$(INSTALL) -m 0755 i3-msg $(DESTDIR)$(PREFIX)/bin/
clean:
rm -f *.o