Skip to content
Extraits de code Groupes Projets
Valider 625e5dd8 rédigé par Martin Braquet's avatar Martin Braquet
Parcourir les fichiers

Make release compatible with Windows

parent dfc5b36a
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -10,6 +10,13 @@ MAIN_NAME=how_to_contribute
PDF_NAME=$(MAIN_NAME).pdf
OUT_MAIN_NAME=How_to_Contribute
# Operating system
ifeq ($(OS),Windows_NT)
MYPYTHON:=python
else
MYPYTHON:=python3
endif
# You want latexmk to *always* run, because make does not have all the info.
.PHONY: clean
......@@ -48,5 +55,5 @@ release: $(PDF_NAME) clean prerelease
echo $(ALL_RELEASE)
prerelease:
$(eval MYPATH:=$(shell python3 ../mysmartcp.py -1))
$(eval MYPATH:=$(shell $(MYPYTHON) ../mysmartcp.py -1))
mkdir -p "${MYPATH}"
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Apr 11 10:31:33 2020
@author: Martin Braquet
"""
import sys
if sys.platform.startswith('win32'):
print(sys.argv[1].encode("latin-1").decode("utf-8"))
else:
print(sys.argv[1])
......@@ -50,4 +50,7 @@ with open(os.path.dirname(os.path.realpath(__file__)) + '/config.yml', 'r') as s
out_path = abspath + '/' + cycle + '/' + option_map + '/Q' + str(quadri) + '/L' + option + str(code) \
+ ' - ' + titre + '/' + type_map
print(out_path)
\ No newline at end of file
if sys.platform.startswith('win32'):
print(out_path.encode("latin-1").decode("utf-8"))
else:
print(out_path)
......@@ -67,6 +67,13 @@ endef
# Directory of the script mysmartcp.py
SMARTCP:=$(BASE_DIR)../../../mysmartcp.py
# Operating system
ifeq ($(OS),Windows_NT)
MYPYTHON:=python
else
MYPYTHON:=python3
endif
# 1e: make all
# 2e: make only out-of-date
# .PHONY: clean cleanaux $(ALL)
......@@ -82,11 +89,12 @@ pdf: $(ALL) cleanaux
release: $(ALL) cleanaux prerelease $(ALL_RELEASE)
prerelease:
$(eval MYPATH:=$(shell python3 ${SMARTCP} ${INPUT})) # Obtain the path/location of the output folder for this PDF
mkdir -p "${MYPATH}" # Create the output folder (if not existing yet)
$(eval MYPATH:=$(shell $(MYPYTHON) ${SMARTCP} ${INPUT})) # Obtain the path/location of the output folder for this PDF
mkdir -p "${MYPATH}" # Create the output folder (if not existing yet)
release_$(MAIN_NAME):
cp "$(MAIN_NAME).pdf" "${MYPATH}/$(OUT_MAIN_NAME).pdf" # Copy the PDF in the output folder
$(eval OUT_MAIN_NAME_ENCODED:=$(shell $(MYPYTHON) $(BASE_DIR)../../../myencode.py ${OUT_MAIN_NAME})) # Encode special characters in OUT_MAIN_NAME
cp "$(MAIN_NAME).pdf" "${MYPATH}/$(OUT_MAIN_NAME_ENCODED).pdf" # Copy the PDF in the output folder
release_$(MAIN_NAME_SOL):
cp "$(MAIN_NAME_SOL).pdf" "${MYPATH}/$(OUT_MAIN_NAME_SOL).pdf" # Copy the solution of the PDF in the output folder
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter