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 <[email protected]>
---
 contrib/mw-to-git/.gitignore                       |  1 +
 contrib/mw-to-git/Makefile                         | 64 ++++++----------------
 ...-remote-mediawiki => git-remote-mediawiki.perl} |  0
 3 files changed, 18 insertions(+), 47 deletions(-)
 create mode 100644 contrib/mw-to-git/.gitignore
 rewrite contrib/mw-to-git/Makefile (96%)
 rename contrib/mw-to-git/{git-remote-mediawiki => git-remote-mediawiki.perl} 
(100%)

diff --git a/contrib/mw-to-git/.gitignore b/contrib/mw-to-git/.gitignore
new file mode 100644
index 0000000..b919655
--- /dev/null
+++ b/contrib/mw-to-git/.gitignore
@@ -0,0 +1 @@
+git-remote-mediawiki
diff --git a/contrib/mw-to-git/Makefile b/contrib/mw-to-git/Makefile
dissimilarity index 96%
index 3ed728b..f149719 100644
--- a/contrib/mw-to-git/Makefile
+++ b/contrib/mw-to-git/Makefile
@@ -1,47 +1,17 @@
-#
-# Copyright (C) 2012
-#     Charles Roussel <[email protected]>
-#     Simon Cathebras <[email protected]>
-#     Julien Khayat <[email protected]>
-#     Guillaume Sasdy <[email protected]>
-#     Simon Perrat <[email protected]>
-#
-## 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
+#
+# Copyright (C) 2013
+#     Matthieu Moy <[email protected]>
+#
+## Build git-remote-mediawiki
+
+SCRIPT_PERL=git-remote-mediawiki.perl
+GIT_ROOT_DIR=../..
+HERE=contrib/mw-to-git/
+
+SCRIPT_PERL_FULL=$(patsubst %,$(HERE)/%,$(SCRIPT_PERL))
+
+all: build
+
+build install clean:
+       $(MAKE) -C $(GIT_ROOT_DIR) SCRIPT_PERL=$(SCRIPT_PERL_FULL) \
+                $@-perl-script
diff --git a/contrib/mw-to-git/git-remote-mediawiki 
b/contrib/mw-to-git/git-remote-mediawiki.perl
similarity index 100%
rename from contrib/mw-to-git/git-remote-mediawiki
rename to contrib/mw-to-git/git-remote-mediawiki.perl
-- 
1.8.1.2.530.g3cc16e4.dirty

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to