mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Inline makecmd in make mode
This commit is contained in:
parent
3d0110a95a
commit
13da5d7b2f
@ -67,7 +67,6 @@ class Make:
|
||||
self.srcdir = srcdir
|
||||
self.builddir = builddir
|
||||
self.opts = [*opts]
|
||||
self.makecmd = os.environ.get('MAKE', 'make') # refer $MAKE to determine make command
|
||||
|
||||
def builddir_join(self, *comps: str) -> str:
|
||||
return path.join(self.builddir, *comps)
|
||||
@ -105,10 +104,11 @@ class Make:
|
||||
if self.run_generic_build('latex') > 0:
|
||||
return 1
|
||||
|
||||
if sys.platform == 'win32':
|
||||
makecmd = os.environ.get('MAKE', 'make.bat')
|
||||
else:
|
||||
makecmd = self.makecmd
|
||||
# Use $MAKE to determine the make command
|
||||
make_fallback = 'make.bat' if sys.platform == 'win32' else 'make'
|
||||
makecmd = os.environ.get('MAKE', make_fallback)
|
||||
if not makecmd.lower().startswith('make'):
|
||||
raise RuntimeError('Invalid $MAKE command: %r' % makecmd)
|
||||
try:
|
||||
with chdir(self.builddir_join('latex')):
|
||||
return subprocess.call([makecmd, 'all-pdf'])
|
||||
@ -120,10 +120,11 @@ class Make:
|
||||
if self.run_generic_build('latex') > 0:
|
||||
return 1
|
||||
|
||||
if sys.platform == 'win32':
|
||||
makecmd = os.environ.get('MAKE', 'make.bat')
|
||||
else:
|
||||
makecmd = self.makecmd
|
||||
# Use $MAKE to determine the make command
|
||||
make_fallback = 'make.bat' if sys.platform == 'win32' else 'make'
|
||||
makecmd = os.environ.get('MAKE', make_fallback)
|
||||
if not makecmd.lower().startswith('make'):
|
||||
raise RuntimeError('Invalid $MAKE command: %r' % makecmd)
|
||||
try:
|
||||
with chdir(self.builddir_join('latex')):
|
||||
return subprocess.call([makecmd, 'all-pdf'])
|
||||
@ -134,11 +135,16 @@ class Make:
|
||||
def build_info(self) -> int:
|
||||
if self.run_generic_build('texinfo') > 0:
|
||||
return 1
|
||||
|
||||
# Use $MAKE to determine the make command
|
||||
makecmd = os.environ.get('MAKE', 'make')
|
||||
if not makecmd.lower().startswith('make'):
|
||||
raise RuntimeError('Invalid $MAKE command: %r' % makecmd)
|
||||
try:
|
||||
with chdir(self.builddir_join('texinfo')):
|
||||
return subprocess.call([self.makecmd, 'info'])
|
||||
return subprocess.call([makecmd, 'info'])
|
||||
except OSError:
|
||||
print('Error: Failed to run: %s' % self.makecmd)
|
||||
print('Error: Failed to run: %s' % makecmd)
|
||||
return 1
|
||||
|
||||
def build_gettext(self) -> int:
|
||||
|
Loading…
Reference in New Issue
Block a user