git-remote-mediawiki: use toplevel's Makefile
This makes the Makefile simpler, while providing more features, and more consistency (the exact same rules with the exact same configuration as Git official commands are applied with the new version). Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Matthieu Moy committed
Feb 8, 2013 at 18:31 UTC
1986768f9ce991f5502a9436a8570217b567f14b
3 files changed
+11
-40
contrib/mw-to-git/.gitignore
new
+1
@@ -0,0 +1 @@
1
+git-remote-mediawiki
contrib/mw-to-git/Makefile
+10
-40
@@ -1,47 +1,17 @@
1
#
2
-# Copyright (C) 2012
3
-# Charles Roussel <charles.roussel@ensimag.imag.fr>
4
-# Simon Cathebras <simon.cathebras@ensimag.imag.fr>
5
-# Julien Khayat <julien.khayat@ensimag.imag.fr>
6
-# Guillaume Sasdy <guillaume.sasdy@ensimag.imag.fr>
7
-# Simon Perrat <simon.perrat@ensimag.imag.fr>
2
+# Copyright (C) 2013
3
+# Matthieu Moy <Matthieu.Moy@imag.fr>
4
#
5
## Build git-remote-mediawiki
6
11
--include ../../config.mak.autogen
12
--include ../../config.mak
7
+SCRIPT_PERL=git-remote-mediawiki.perl
8
+GIT_ROOT_DIR=../..
9
+HERE=contrib/mw-to-git/
10
14
-ifndef PERL_PATH
15
- PERL_PATH = /usr/bin/perl
16
-endif
17
-ifndef gitexecdir
18
- gitexecdir = $(shell git --exec-path)
19
-endif
11
+SCRIPT_PERL_FULL=$(patsubst %,$(HERE)/%,$(SCRIPT_PERL))
12
21
-PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH))
22
-gitexecdir_SQ = $(subst ','\'',$(gitexecdir))
23
-SCRIPT = git-remote-mediawiki
13
+all: build
14
25
-.PHONY: install help doc test clean
26
-
27
-help:
28
- @echo 'This is the help target of the Makefile. Current configuration:'
29
- @echo ' gitexecdir = $(gitexecdir_SQ)'
30
- @echo ' PERL_PATH = $(PERL_PATH_SQ)'
31
- @echo 'Run "$(MAKE) install" to install $(SCRIPT) in gitexecdir'
32
- @echo 'Run "$(MAKE) test" to run the testsuite'
33
-
34
-install:
35
- sed -e '1s|#!.*/perl|#!$(PERL_PATH_SQ)|' $(SCRIPT) \
36
- > '$(gitexecdir_SQ)/$(SCRIPT)'
37
- chmod +x '$(gitexecdir)/$(SCRIPT)'
38
-
39
-doc:
40
- @echo 'Sorry, "make doc" is not implemented yet for $(SCRIPT)'
41
-
42
-test:
43
- $(MAKE) -C t/ test
44
-
45
-clean:
46
- $(RM) '$(gitexecdir)/$(SCRIPT)'
47
- $(MAKE) -C t/ clean
15
+build install clean:
16
+ $(MAKE) -C $(GIT_ROOT_DIR) SCRIPT_PERL=$(SCRIPT_PERL_FULL) \
17
+ $@-perl-script