From: Graham Knop Date: Wed, 22 Jul 2015 13:08:42 +0000 (-0400) Subject: refactoring Makefile code X-Git-Tag: v0.002000~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=81d518f6f2a71347e8b665abd7254e28dac7d3f3;hp=be03260764ee2695074d374f3d5e2ebe4e95b746;p=p5sagit%2FDistar.git refactoring Makefile code --- diff --git a/lib/Distar.pm b/lib/Distar.pm index 08c6046..0c2124a 100644 --- a/lib/Distar.pm +++ b/lib/Distar.pm @@ -105,20 +105,19 @@ sub write_manifest_skip { my $self = shift; my $dist_test = $self->SUPER::dist_test(@_); - my $include = ''; - if (open my $fh, '<', 'maint/Makefile.include') { - $include = "\n# --- Makefile.include:\n" . do { local $/; <$fh> }; - } - - $dist_test .= "REMAKE = \$(PERLRUN) Makefile.PL @{[ map { $self->quote_literal($_) } @ARGV ]}"; - $dist_test .= <<'END' + $dist_test .= <<"END"; # --- Distar section: + +REMAKE = \$(PERLRUN) Makefile.PL @{[ map { $self->quote_literal($_) } @ARGV ]} + +END + $dist_test .= <<'END'; preflight: $(ABSPERLRUN) Distar/helpers/preflight $(VERSION) release: preflight $(MAKE) disttest - rm -rf $(DISTVNAME) + $(RM_RF) $(DISTVNAME) $(MAKE) $(DISTVNAME).tar$(SUFFIX) git commit -a -m "Release commit for $(VERSION)" git tag v$(VERSION) -m "release v$(VERSION)" @@ -140,13 +139,18 @@ refresh: $(REMAKE) END + my $include = ''; + if (open my $fh, '<', 'maint/Makefile.include') { + $include = "\n# --- Makefile.include:\n" . do { local $/; <$fh> }; + } + for my $type ('', 'minor', 'major') { if ($include !~ /^bump$type:/m) { my $arg = $type || '$(V)'; $dist_test .= <<"END" bump$type: - Distar/helpers/bump-version --git \$(VERSION) $arg - rm Makefile + \$(ABSPERLRUN) Distar/helpers/bump-version --git \$(VERSION) $arg + \$(RM_F) \$(FIRST_MAKEFILE) \$(REMAKE) END }