makefiles: support PREFIX and SYSCONFDIR
This commit is contained in:
parent
29c4ac9395
commit
1bce8f2104
18
Makefile
18
Makefile
|
@ -56,15 +56,15 @@ src/cfgparse.y.o: src/cfgparse.y ${HEADERS}
|
||||||
|
|
||||||
install: all
|
install: all
|
||||||
echo "INSTALL"
|
echo "INSTALL"
|
||||||
$(INSTALL) -d -m 0755 $(DESTDIR)/usr/bin
|
$(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/bin
|
||||||
$(INSTALL) -d -m 0755 $(DESTDIR)/etc/i3
|
$(INSTALL) -d -m 0755 $(DESTDIR)$(SYSCONFDIR)/i3
|
||||||
$(INSTALL) -d -m 0755 $(DESTDIR)/usr/include/i3
|
$(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/include/i3
|
||||||
$(INSTALL) -d -m 0755 $(DESTDIR)/usr/share/xsessions
|
$(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/share/xsessions
|
||||||
$(INSTALL) -m 0755 i3 $(DESTDIR)/usr/bin/
|
$(INSTALL) -m 0755 i3 $(DESTDIR)$(PREFIX)/bin/
|
||||||
test -e $(DESTDIR)/etc/i3/config || $(INSTALL) -m 0644 i3.config $(DESTDIR)/etc/i3/config
|
test -e $(DESTDIR)$(SYSCONFDIR)/i3/config || $(INSTALL) -m 0644 i3.config $(DESTDIR)$(SYSCONFDIR)/i3/config
|
||||||
$(INSTALL) -m 0644 i3.welcome $(DESTDIR)/etc/i3/welcome
|
$(INSTALL) -m 0644 i3.welcome $(DESTDIR)$(SYSCONFDIR)/i3/welcome
|
||||||
$(INSTALL) -m 0644 i3.desktop $(DESTDIR)/usr/share/xsessions/
|
$(INSTALL) -m 0644 i3.desktop $(DESTDIR)$(PREFIX)/share/xsessions/
|
||||||
$(INSTALL) -m 0644 include/i3/ipc.h $(DESTDIR)/usr/include/i3/
|
$(INSTALL) -m 0644 include/i3/ipc.h $(DESTDIR)$(PREFIX)/include/i3/
|
||||||
$(MAKE) TOPDIR=$(TOPDIR) -C i3-msg install
|
$(MAKE) TOPDIR=$(TOPDIR) -C i3-msg install
|
||||||
$(MAKE) TOPDIR=$(TOPDIR) -C i3-input install
|
$(MAKE) TOPDIR=$(TOPDIR) -C i3-input install
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,12 @@
|
||||||
UNAME=$(shell uname)
|
UNAME=$(shell uname)
|
||||||
DEBUG=1
|
DEBUG=1
|
||||||
INSTALL=install
|
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))"
|
GIT_VERSION:="$(shell git describe --tags --always) ($(shell git log --pretty=format:%cd --date=short -n1))"
|
||||||
VERSION:=$(shell git describe --tags --abbrev=0)
|
VERSION:=$(shell git describe --tags --abbrev=0)
|
||||||
|
|
||||||
|
|
|
@ -18,8 +18,8 @@ all: ${FILES}
|
||||||
|
|
||||||
install: all
|
install: all
|
||||||
echo "INSTALL"
|
echo "INSTALL"
|
||||||
$(INSTALL) -d -m 0755 $(DESTDIR)/usr/bin
|
$(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/bin
|
||||||
$(INSTALL) -m 0755 i3-input $(DESTDIR)/usr/bin/
|
$(INSTALL) -m 0755 i3-input $(DESTDIR)$(PREFIX)/bin/
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *.o
|
rm -f *.o
|
||||||
|
|
|
@ -20,8 +20,8 @@ all: ${FILES}
|
||||||
|
|
||||||
install: all
|
install: all
|
||||||
echo "INSTALL"
|
echo "INSTALL"
|
||||||
$(INSTALL) -d -m 0755 $(DESTDIR)/usr/bin
|
$(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/bin
|
||||||
$(INSTALL) -m 0755 i3-msg $(DESTDIR)/usr/bin/
|
$(INSTALL) -m 0755 i3-msg $(DESTDIR)$(PREFIX)/bin/
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *.o
|
rm -f *.o
|
||||||
|
|
Loading…
Reference in New Issue