push: move unqualified refname error into a function
[git/raj.git] / contrib / mw-to-git / Makefile
blob4e603512a39fe209b537cdc47c344c99f7cc38f1
2 # Copyright (C) 2013
3 # Matthieu Moy <Matthieu.Moy@imag.fr>
5 # To build and test:
7 # make
8 # bin-wrapper/git mw preview Some_page.mw
9 # bin-wrapper/git clone mediawiki::http://example.com/wiki/
11 # To install, run Git's toplevel 'make install' then run:
13 # make install
15 GIT_MEDIAWIKI_PM=Git/Mediawiki.pm
16 SCRIPT_PERL=git-remote-mediawiki.perl
17 SCRIPT_PERL+=git-mw.perl
18 GIT_ROOT_DIR=../..
19 HERE=contrib/mw-to-git/
21 INSTALL = install
23 SCRIPT_PERL_FULL=$(patsubst %,$(HERE)/%,$(SCRIPT_PERL))
24 INSTLIBDIR=$(shell $(MAKE) -C $(GIT_ROOT_DIR)/ \
25 -s --no-print-directory prefix=$(prefix) \
26 perllibdir=$(perllibdir) perllibdir)
27 DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
28 INSTLIBDIR_SQ = $(subst ','\'',$(INSTLIBDIR))
30 all: build
32 test: all
33 $(MAKE) -C t
35 check: perlcritic test
37 install_pm:
38 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(INSTLIBDIR_SQ)/Git'
39 $(INSTALL) -m 644 $(GIT_MEDIAWIKI_PM) \
40 '$(DESTDIR_SQ)$(INSTLIBDIR_SQ)/$(GIT_MEDIAWIKI_PM)'
42 build:
43 $(MAKE) -C $(GIT_ROOT_DIR) SCRIPT_PERL="$(SCRIPT_PERL_FULL)" \
44 build-perl-script
46 install: install_pm
47 $(MAKE) -C $(GIT_ROOT_DIR) SCRIPT_PERL="$(SCRIPT_PERL_FULL)" \
48 install-perl-script
50 clean:
51 $(MAKE) -C $(GIT_ROOT_DIR) SCRIPT_PERL="$(SCRIPT_PERL_FULL)" \
52 clean-perl-script
54 perlcritic:
55 perlcritic -5 $(SCRIPT_PERL)
56 -perlcritic -2 $(SCRIPT_PERL)
58 .PHONY: all test check install_pm install clean perlcritic