mirror of
https://github.com/git/git.git
synced 2026-01-21 16:06:04 +00:00
'make clean', or a 'git clean -dfx' will delete the PM stamp file, so it cannot be a direct target in such clean conditions, resulting in an error. Normally the PM.stamp is recreated by the git/Makefile, except when a dry-run is requested, for example, as used in the msysgit msvc-build script which implements the compat/vcbuild/README using contrib/buildsystems. The script msvc-build is introduced later in this series. Protect the PM.stamp target when the PM.stamp file does not exist, allowing a Git 'Makefile -n' to succeed on a clean repo. Signed-off-by: Philip Oakley <philipoakley@iee.org> --- This is development of the original "[PATCH 4/17] Makefile: a dry-run can error out if no perl. Document the issue" 2015-06-25, (http://marc.info/?l=git&m=143519054716960&w=2), which simply documented the issue and then used NO_PERL to avoid the problem. See follow on email thread for some discussion.
93 lines
2.3 KiB
Makefile
93 lines
2.3 KiB
Makefile
#
|
|
# Makefile for perl support modules and routine
|
|
#
|
|
makfile:=perl.mak
|
|
modules =
|
|
|
|
PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH))
|
|
prefix_SQ = $(subst ','\'',$(prefix))
|
|
localedir_SQ = $(subst ','\'',$(localedir))
|
|
|
|
ifndef V
|
|
QUIET = @
|
|
endif
|
|
|
|
all install instlibdir: $(makfile)
|
|
$(QUIET)$(MAKE) -f $(makfile) $@
|
|
|
|
clean:
|
|
$(QUIET)test -f $(makfile) && $(MAKE) -f $(makfile) $@ || exit 0
|
|
$(RM) ppport.h
|
|
$(RM) $(makfile)
|
|
$(RM) $(makfile).old
|
|
$(RM) PM.stamp
|
|
|
|
ifneq (,$(wildcard PM.stamp))
|
|
$(makfile): PM.stamp
|
|
endif
|
|
|
|
ifdef NO_PERL_MAKEMAKER
|
|
instdir_SQ = $(subst ','\'',$(prefix)/lib)
|
|
|
|
modules += Git
|
|
modules += Git/I18N
|
|
modules += Git/IndexInfo
|
|
modules += Git/Packet
|
|
modules += Git/SVN
|
|
modules += Git/SVN/Memoize/YAML
|
|
modules += Git/SVN/Fetcher
|
|
modules += Git/SVN/Editor
|
|
modules += Git/SVN/GlobSpec
|
|
modules += Git/SVN/Log
|
|
modules += Git/SVN/Migration
|
|
modules += Git/SVN/Prompt
|
|
modules += Git/SVN/Ra
|
|
modules += Git/SVN/Utils
|
|
|
|
$(makfile): ../GIT-CFLAGS Makefile
|
|
echo all: private-Error.pm Git.pm Git/I18N.pm > $@
|
|
set -e; \
|
|
for i in $(modules); \
|
|
do \
|
|
if test $$i = $${i%/*}; \
|
|
then \
|
|
subdir=; \
|
|
else \
|
|
subdir=/$${i%/*}; \
|
|
fi; \
|
|
echo ' $(RM) blib/lib/'$$i'.pm' >> $@; \
|
|
echo ' mkdir -p blib/lib'$$subdir >> $@; \
|
|
echo ' cp '$$i'.pm blib/lib/'$$i'.pm' >> $@; \
|
|
done
|
|
echo ' $(RM) blib/lib/Error.pm' >> $@
|
|
'$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \
|
|
echo ' cp private-Error.pm blib/lib/Error.pm' >> $@
|
|
echo install: >> $@
|
|
set -e; \
|
|
for i in $(modules); \
|
|
do \
|
|
if test $$i = $${i%/*}; \
|
|
then \
|
|
subdir=; \
|
|
else \
|
|
subdir=/$${i%/*}; \
|
|
fi; \
|
|
echo ' $(RM) "$$(DESTDIR)$(instdir_SQ)/'$$i'.pm"' >> $@; \
|
|
echo ' mkdir -p "$$(DESTDIR)$(instdir_SQ)'$$subdir'"' >> $@; \
|
|
echo ' cp '$$i'.pm "$$(DESTDIR)$(instdir_SQ)/'$$i'.pm"' >> $@; \
|
|
done
|
|
echo ' $(RM) "$$(DESTDIR)$(instdir_SQ)/Error.pm"' >> $@
|
|
'$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \
|
|
echo ' cp private-Error.pm "$$(DESTDIR)$(instdir_SQ)/Error.pm"' >> $@
|
|
echo instlibdir: >> $@
|
|
echo ' echo $(instdir_SQ)' >> $@
|
|
else
|
|
$(makfile): Makefile.PL ../GIT-CFLAGS
|
|
$(PERL_PATH) $< PREFIX='$(prefix_SQ)' INSTALL_BASE='' --localedir='$(localedir_SQ)'
|
|
endif
|
|
|
|
# this is just added comfort for calling make directly in perl dir
|
|
# (even though GIT-CFLAGS aren't used yet. If ever)
|
|
../GIT-CFLAGS:
|
|
$(MAKE) -C .. GIT-CFLAGS
|