Skip to content

Commit

Permalink
Makefile cleanup:
Browse files Browse the repository at this point in the history
* Replace all "?=" with just "=". This means you now have to pass these as
  arguments to "make", not through env vars.
* Rename PYTHON2_CMD to PYTHON2.
* Use python2 directly instead of using the $(command -v python2) stuff.
  • Loading branch information
sjohannes committed Apr 29, 2017
1 parent 185cf56 commit 6b0e145
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
PYTHON2_CMD ?= $(if $(shell command -v python2), $(shell command -v python2), $(error "python2 not found in PATH (is it installed?)"))
PYTHON2 = python2
PYTEST = py.test

PREFIX ?= /usr/local
PREFIX = /usr/local
EPREFIX = $(PREFIX)

LIBINSTALLDIR = $(EPREFIX)/lib
DATADIR = $(PREFIX)/share
MANPREFIX ?= $(PREFIX)/share
MANPREFIX = $(PREFIX)/share
# /etc if PREFIX is /usr, $PREFIX/etc otherwise.
ETCDIR := $(shell [ "$(PREFIX)" = "/usr" ] && echo /etc || echo "$(PREFIX)/etc")
XDGCONFDIR ?= $(ETCDIR)/xdg
XDGCONFDIR = $(ETCDIR)/xdg

# Find bash-completion's completions directory, first by checking pkg-config,
# then using a hard-coded path. Override BASHCOMPDIR if it's still wrong for
Expand All @@ -35,8 +35,8 @@ all_no_locale: compile manpage
@echo "Ready to install..."

compile:
$(PYTHON2_CMD) -m compileall -q xl xlgui
-$(PYTHON2_CMD) -O -m compileall -q xl xlgui
$(PYTHON2) -m compileall -q xl xlgui
-$(PYTHON2) -O -m compileall -q xl xlgui
$(MAKE) -C plugins compile

make-install-dirs:
Expand Down Expand Up @@ -149,7 +149,7 @@ install-target: make-install-dirs
-install -m 644 exaile.bash-completion $(DESTDIR)$(BASHCOMPDIR)/exaile
install -m 644 data/config/settings.ini $(EXAILECONFDIR)
tools/generate-launcher "$(DESTDIR)" "$(PREFIX)" "$(EPREFIX)" "$(LIBINSTALLDIR)" \
"$(PYTHON2_CMD)" && \
"$(PYTHON2)" && \
chmod 755 $(EXAILEBINDIR)/exaile
sed "s|\@bindir\@|$(EPREFIX)/bin|" data/org.exaile.Exaile.service.in > \
$(DESTDIR)$(DATADIR)/dbus-1/services/org.exaile.Exaile.service
Expand Down Expand Up @@ -177,7 +177,7 @@ manpage:
| gzip -9 > exaile.1.gz

completion:
$(PYTHON2_CMD) tools/generate-completion.py > exaile.bash-completion
$(PYTHON2) tools/generate-completion.py > exaile.bash-completion

clean:
-find . -name "*.~[0-9]~" -exec rm -f {} \;
Expand Down

0 comments on commit 6b0e145

Please sign in to comment.