X-Git-Url: http://git.tremily.us/?a=blobdiff_plain;f=contrib%2Fmw-to-git%2FMakefile;h=f14971987c3d14892ad212485c4b1662d73165f7;hb=1986768f9ce991f5502a9436a8570217b567f14b;hp=3ed728b0efa4b9c121385a37dd6d1edb4cb7726b;hpb=74474a94f217a0499cc23346d8d094893fb46257;p=git.git diff --git a/contrib/mw-to-git/Makefile b/contrib/mw-to-git/Makefile index 3ed728b0e..f14971987 100644 --- a/contrib/mw-to-git/Makefile +++ b/contrib/mw-to-git/Makefile @@ -1,47 +1,17 @@ # -# Copyright (C) 2012 -# Charles Roussel -# Simon Cathebras -# Julien Khayat -# Guillaume Sasdy -# Simon Perrat +# Copyright (C) 2013 +# Matthieu Moy # ## Build git-remote-mediawiki --include ../../config.mak.autogen --include ../../config.mak +SCRIPT_PERL=git-remote-mediawiki.perl +GIT_ROOT_DIR=../.. +HERE=contrib/mw-to-git/ -ifndef PERL_PATH - PERL_PATH = /usr/bin/perl -endif -ifndef gitexecdir - gitexecdir = $(shell git --exec-path) -endif +SCRIPT_PERL_FULL=$(patsubst %,$(HERE)/%,$(SCRIPT_PERL)) -PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH)) -gitexecdir_SQ = $(subst ','\'',$(gitexecdir)) -SCRIPT = git-remote-mediawiki +all: build -.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 +build install clean: + $(MAKE) -C $(GIT_ROOT_DIR) SCRIPT_PERL=$(SCRIPT_PERL_FULL) \ + $@-perl-script