perl/Makefile: move "mkdir -p" to module installation loop for maintainability

In the NO_PERL_MAKEMAKER=YesPlease fallback case, make the directory
that will contain each module when installing it (simulating "install
-D") instead of hardcoding "Git/SVN/Memoize is the deepest level".
This should make this codepath which is not used often on development
machines a little easier to maintain.

Requested-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Jonathan Nieder 2012-06-15 18:02:34 -05:00 коммит произвёл Junio C Hamano
Родитель 7dba3f73e9
Коммит 73abda3b2a
1 изменённых файлов: 14 добавлений и 2 удалений

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

@ -34,22 +34,34 @@ modules += Git/SVN/Ra
$(makfile): ../GIT-CFLAGS Makefile
echo all: private-Error.pm Git.pm Git/I18N.pm > $@
echo ' mkdir -p blib/lib/Git/SVN/Memoize' >> $@
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: >> $@
echo ' mkdir -p "$$(DESTDIR)$(instdir_SQ)/Git/SVN/Memoize"' >> $@
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"' >> $@