contrib / mw-to-git / Makefileon commit git-remote-mediawiki build: handle DESTDIR/INSTLIBDIR with whitespace (c635b05)
   1#
   2# Copyright (C) 2013
   3#     Matthieu Moy <Matthieu.Moy@imag.fr>
   4#
   5# To install, run Git's toplevel 'make install' then run:
   6#
   7#   make install
   8
   9GIT_MEDIAWIKI_PM=Git/Mediawiki.pm
  10SCRIPT_PERL=git-remote-mediawiki.perl
  11GIT_ROOT_DIR=../..
  12HERE=contrib/mw-to-git/
  13
  14INSTALL = install
  15
  16SCRIPT_PERL_FULL=$(patsubst %,$(HERE)/%,$(SCRIPT_PERL))
  17INSTLIBDIR=$(shell $(MAKE) -C $(GIT_ROOT_DIR)/perl \
  18                -s --no-print-directory instlibdir)
  19DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
  20INSTLIBDIR_SQ = $(subst ','\'',$(INSTLIBDIR))
  21
  22all: build
  23
  24install_pm:
  25        $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(INSTLIBDIR_SQ)/Git'
  26        $(INSTALL) -m 644 $(GIT_MEDIAWIKI_PM) \
  27                '$(DESTDIR_SQ)$(INSTLIBDIR_SQ)/$(GIT_MEDIAWIKI_PM)'
  28
  29build:
  30        $(MAKE) -C $(GIT_ROOT_DIR) SCRIPT_PERL=$(SCRIPT_PERL_FULL) \
  31                build-perl-script
  32
  33install: install_pm
  34        $(MAKE) -C $(GIT_ROOT_DIR) SCRIPT_PERL=$(SCRIPT_PERL_FULL) \
  35                install-perl-script
  36
  37clean:
  38        $(MAKE) -C $(GIT_ROOT_DIR) SCRIPT_PERL=$(SCRIPT_PERL_FULL) \
  39                clean-perl-script
  40
  41perlcritic:
  42        perlcritic -2 *.perl