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>
This commit is contained in:
Matthieu Moy 2013-02-08 18:31:17 +01:00 коммит произвёл Junio C Hamano
Родитель 4c06b41888
Коммит 1986768f9c
3 изменённых файлов: 11 добавлений и 40 удалений

1
contrib/mw-to-git/.gitignore поставляемый Normal file
Просмотреть файл

@ -0,0 +1 @@
git-remote-mediawiki

Просмотреть файл

@ -1,47 +1,17 @@
# #
# Copyright (C) 2012 # Copyright (C) 2013
# Charles Roussel <charles.roussel@ensimag.imag.fr> # Matthieu Moy <Matthieu.Moy@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 ## Build git-remote-mediawiki
-include ../../config.mak.autogen SCRIPT_PERL=git-remote-mediawiki.perl
-include ../../config.mak GIT_ROOT_DIR=../..
HERE=contrib/mw-to-git/
ifndef PERL_PATH SCRIPT_PERL_FULL=$(patsubst %,$(HERE)/%,$(SCRIPT_PERL))
PERL_PATH = /usr/bin/perl
endif
ifndef gitexecdir
gitexecdir = $(shell git --exec-path)
endif
PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH)) all: build
gitexecdir_SQ = $(subst ','\'',$(gitexecdir))
SCRIPT = git-remote-mediawiki
.PHONY: install help doc test clean build install clean:
$(MAKE) -C $(GIT_ROOT_DIR) SCRIPT_PERL=$(SCRIPT_PERL_FULL) \
help: $@-perl-script
@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