Update Makefile

This commit is contained in:
2024-10-14 01:20:28 +08:00
parent 6c6808f63c
commit a59c9c4ab6
+35 -35
View File
@@ -50,9 +50,9 @@ GREPSTR := " \|(\|)\|^submit\|^analysis\|_cache\|_freeze\|^site_libs\|^www"
all: local upload clean commit all: local upload clean commit
force: updrefbib check_git_status render filehash upload clean commit force: updrefbib check_git_status updvariable render filehash upload clean commit
local: updrefbib check_git_status lazyrender local: updrefbib check_git_status updvariable lazyrender
updmakefile: updmakefile:
@if [ "$(OS)" = "OSX" ] && [ "$(HOSTNAME)" = "max" ]; then \ @if [ "$(OS)" = "OSX" ] && [ "$(HOSTNAME)" = "max" ]; then \
@@ -261,54 +261,54 @@ fix_links:
@find ./www -type f -name "*.bak" -exec rm {} + @find ./www -type f -name "*.bak" -exec rm {} +
updvariable: updvariable:
@touch _variable.yml # 如果文件不存在则创建 @touch _variables.yml # 如果文件不存在则创建
@grep -q '^reponame:' _variable.yml || echo "reponame: $(reponame)" >> _variable.yml @grep -q '^reponame:' _variables.yml || echo "reponame: $(reponame)" >> _variables.yml
@if grep -q '^reponame:' _variable.yml; then \ @if grep -q '^reponame:' _variables.yml; then \
sed -i '' 's/^reponame:.*/reponame: $(reponame)/' _variable.yml; \ sed -i '' 's/^reponame:.*/reponame: $(reponame)/' _variables.yml; \
else \ else \
echo "reponame: $(reponame)" >> _variable.yml; \ echo "reponame: $(reponame)" >> _variables.yml; \
fi fi
@grep -q '^projtype:' _variable.yml || echo "projtype: $(projtype)" >> _variable.yml @grep -q '^projtype:' _variables.yml || echo "projtype: $(projtype)" >> _variables.yml
@if grep -q '^projtype:' _variable.yml; then \ @if grep -q '^projtype:' _variables.yml; then \
sed -i '' 's/^projtype:.*/projtype: $(projtype)/' _variable.yml; \ sed -i '' 's/^projtype:.*/projtype: $(projtype)/' _variables.yml; \
else \ else \
echo "projtype: $(projtype)" >> _variable.yml; \ echo "projtype: $(projtype)" >> _variables.yml; \
fi fi
@grep -q '^branch:' _variable.yml || echo "branch: $(branchname)" >> _variable.yml @grep -q '^branch:' _variables.yml || echo "branch: $(branchname)" >> _variables.yml
@if grep -q '^branch:' _variable.yml; then \ @if grep -q '^branch:' _variables.yml; then \
sed -i '' 's/^branch:.*/branch: $(branchname)/' _variable.yml; \ sed -i '' 's/^branch:.*/branch: $(branchname)/' _variables.yml; \
else \ else \
echo "branch: $(branchname)" >> _variable.yml; \ echo "branch: $(branchname)" >> _variables.yml; \
fi fi
@grep -q '^pubtype:' _variable.yml || echo "pubtype: $(pubtype)" >> _variable.yml @grep -q '^pubtype:' _variables.yml || echo "pubtype: $(pubtype)" >> _variables.yml
@if grep -q '^pubtype:' _variable.yml; then \ @if grep -q '^pubtype:' _variables.yml; then \
sed -i '' 's/^pubtype:.*/pubtype: $(pubtype)/' _variable.yml; \ sed -i '' 's/^pubtype:.*/pubtype: $(pubtype)/' _variables.yml; \
else \ else \
echo "pubtype: $(pubtype)" >> _variable.yml; \ echo "pubtype: $(pubtype)" >> _variables.yml; \
fi fi
@grep -q '^nwAB:' _variable.yml || echo "nwAB: $(nwAB)" >> _variable.yml @grep -q '^nwAB:' _variables.yml || echo "nwAB: $(nwAB)" >> _variables.yml
@if grep -q '^nwAB:' _variable.yml; then \ @if grep -q '^nwAB:' _variables.yml; then \
sed -i '' 's/^nwAB:.*/nwAB: $(nwAB)/' _variable.yml; \ sed -i '' 's/^nwAB:.*/nwAB: $(nwAB)/' _variables.yml; \
else \ else \
echo "nwAB: $(nwAB)" >> _variable.yml; \ echo "nwAB: $(nwAB)" >> _variables.yml; \
fi fi
@grep -q '^nwMS:' _variable.yml || echo "nwMS: $(nwMS)" >> _variable.yml @grep -q '^nwMS:' _variables.yml || echo "nwMS: $(nwMS)" >> _variables.yml
@if grep -q '^nwMS:' _variable.yml; then \ @if grep -q '^nwMS:' _variables.yml; then \
sed -i '' 's/^nwMS:.*/nwMS: $(nwMS)/' _variable.yml; \ sed -i '' 's/^nwMS:.*/nwMS: $(nwMS)/' _variables.yml; \
else \ else \
echo "nwMS: $(nwMS)" >> _variable.yml; \ echo "nwMS: $(nwMS)" >> _variables.yml; \
fi fi
@grep -q '^figtblMS:' _variable.yml || echo "figtblMS: $(figtblMS)" >> _variable.yml @grep -q '^figtblMS:' _variables.yml || echo "figtblMS: $(figtblMS)" >> _variables.yml
@if grep -q '^figtblMS:' _variable.yml; then \ @if grep -q '^figtblMS:' _variables.yml; then \
sed -i '' 's/^figtblMS:.*/figtblMS: $(figtblMS)/' _variable.yml; \ sed -i '' 's/^figtblMS:.*/figtblMS: $(figtblMS)/' _variables.yml; \
else \ else \
echo "figtblMS: $(figtblMS)" >> _variable.yml; \ echo "figtblMS: $(figtblMS)" >> _variables.yml; \
fi fi
@grep -q '^figtblSM:' _variable.yml || echo "figtblSM: $(figtblSM)" >> _variable.yml @grep -q '^figtblSM:' _variables.yml || echo "figtblSM: $(figtblSM)" >> _variables.yml
@if grep -q '^figtblSM:' _variable.yml; then \ @if grep -q '^figtblSM:' _variables.yml; then \
sed -i '' 's/^figtblSM:.*/figtblSM: $(figtblSM)/' _variable.yml; \ sed -i '' 's/^figtblSM:.*/figtblSM: $(figtblSM)/' _variables.yml; \
else \ else \
echo "figtblSM: $(figtblSM)" >> _variable.yml; \ echo "figtblSM: $(figtblSM)" >> _variables.yml; \
fi fi
@mkpapervar @mkpapervar