git-remote-mediawiki build: handle DESTDIR/INSTLIBDIR with whitespace
[git/debian.git] / contrib / mw-to-git / Makefile
blob37b68e2571e1e65968eab88c068aea3e6cbc22de
2 # Copyright (C) 2013
3 # Matthieu Moy <Matthieu.Moy@imag.fr>
5 # To install, run Git's toplevel 'make install' then run:
7 # make install
9 GIT_MEDIAWIKI_PM=Git/Mediawiki.pm
10 SCRIPT_PERL=git-remote-mediawiki.perl
11 GIT_ROOT_DIR=../..
12 HERE=contrib/mw-to-git/
14 INSTALL = install
16 SCRIPT_PERL_FULL=$(patsubst %,$(HERE)/%,$(SCRIPT_PERL))
17 INSTLIBDIR=$(shell $(MAKE) -C $(GIT_ROOT_DIR)/perl \
18 -s --no-print-directory instlibdir)
19 DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
20 INSTLIBDIR_SQ = $(subst ','\'',$(INSTLIBDIR))
22 all: build
24 install_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)'
29 build:
30 $(MAKE) -C $(GIT_ROOT_DIR) SCRIPT_PERL=$(SCRIPT_PERL_FULL) \
31 build-perl-script
33 install: install_pm
34 $(MAKE) -C $(GIT_ROOT_DIR) SCRIPT_PERL=$(SCRIPT_PERL_FULL) \
35 install-perl-script
37 clean:
38 $(MAKE) -C $(GIT_ROOT_DIR) SCRIPT_PERL=$(SCRIPT_PERL_FULL) \
39 clean-perl-script
41 perlcritic:
42 perlcritic -2 *.perl