summaryrefslogtreecommitdiff
path: root/contrib/mw-to-git/Makefile
blob: 3ed728b0efa4b9c121385a37dd6d1edb4cb7726b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#
# Copyright (C) 2012
#     Charles Roussel <charles.roussel@ensimag.imag.fr>
#     Simon Cathebras <simon.cathebras@ensimag.imag.fr>
#     Julien Khayat <julien.khayat@ensimag.imag.fr>
#     Guillaume Sasdy <guillaume.sasdy@ensimag.imag.fr>
#     Simon Perrat <simon.perrat@ensimag.imag.fr>
#
## Build git-remote-mediawiki

-include ../../config.mak.autogen
-include ../../config.mak

ifndef PERL_PATH
	PERL_PATH = /usr/bin/perl
endif
ifndef gitexecdir
	gitexecdir = $(shell git --exec-path)
endif

PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH))
gitexecdir_SQ = $(subst ','\'',$(gitexecdir))
SCRIPT = git-remote-mediawiki

.PHONY: install help doc test clean

help:
	@echo 'This is the help target of the Makefile. Current configuration:'
	@echo '  gitexecdir = $(gitexecdir_SQ)'
	@echo '  PERL_PATH = $(PERL_PATH_SQ)'
	@echo 'Run "$(MAKE) install" to install $(SCRIPT) in gitexecdir'
	@echo 'Run "$(MAKE) test" to run the testsuite'

install:
	sed -e '1s|#!.*/perl|#!$(PERL_PATH_SQ)|' $(SCRIPT) \
		> '$(gitexecdir_SQ)/$(SCRIPT)'
	chmod +x '$(gitexecdir)/$(SCRIPT)'

doc:
	@echo 'Sorry, "make doc" is not implemented yet for $(SCRIPT)'

test:
	$(MAKE) -C t/ test

clean:
	$(RM) '$(gitexecdir)/$(SCRIPT)'
	$(MAKE) -C t/ clean