Convert submodule PlotNeuralNet into a regular folder
This commit is contained in:
57
thesis/third_party/PlotNeuralNet/deepsad/Makefile
vendored
Normal file
57
thesis/third_party/PlotNeuralNet/deepsad/Makefile
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
# ====== CONFIG ======
|
||||
# Add names (without extension). Example: NAMES = report thesis notes
|
||||
NAMES = subter_lenet_arch subter_ef_arch
|
||||
|
||||
TEX = $(NAMES:%=%.tex)
|
||||
PDF = $(NAMES:%=%.pdf)
|
||||
|
||||
.PHONY: all clean clean-aux clobber
|
||||
# Keep generated .tex even if a rule aborts
|
||||
.PRECIOUS: %.tex
|
||||
|
||||
# Default: build all PDFs
|
||||
all: $(PDF)
|
||||
|
||||
# ====== Rules ======
|
||||
# Generate {name}.tex from {name}.py
|
||||
# Pre-clean: remove aux + old .tex only if {name}.py is newer (or .tex missing)
|
||||
%.tex: %.py
|
||||
@if [ ! -e "$@" ] || [ "$<" -nt "$@" ]; then \
|
||||
echo "[preclean] $*: removing aux + old .tex"; \
|
||||
rm -f "$*.aux" "$*.log" "$*.fdb_latexmk" "$*.fls" "$*.tex"; \
|
||||
fi
|
||||
@echo "python $< > $@"
|
||||
@python "$<" > "$@"
|
||||
|
||||
# Generate {name}.pdf from {name}.tex
|
||||
# Pre-clean: remove aux (keep .tex) only if PDF is out-of-date
|
||||
# Post-clean: remove aux (keep .tex) after successful pdflatex
|
||||
%.pdf: %.tex
|
||||
@if [ ! -e "$@" ] || [ "$<" -nt "$@" ]; then \
|
||||
echo "[preclean] $*: removing aux (keeping .tex)"; \
|
||||
rm -f "$*.aux" "$*.log" "$*.fdb_latexmk" "$*.fls"; \
|
||||
fi
|
||||
@echo "pdflatex $<"
|
||||
@pdflatex --interaction=nonstopmode "$<" || { echo "pdflatex failed; keeping logs for debugging."; exit 1; }
|
||||
@rm -f "$*.aux" "$*.log" "$*.fdb_latexmk" "$*.fls"
|
||||
|
||||
# ====== Convenience targets ======
|
||||
# Clean everything for listed names (including .tex)
|
||||
clean:
|
||||
@echo "[clean] removing aux + .tex for: $(NAMES)"
|
||||
@for n in $(NAMES); do \
|
||||
rm -f "$$n.aux" "$$n.log" "$$n.fdb_latexmk" "$$n.fls" "$$n.tex"; \
|
||||
done
|
||||
|
||||
# Remove only aux/log-type files (keep .tex)
|
||||
clean-aux:
|
||||
@echo "[clean-aux] removing aux (keeping .tex) for: $(NAMES)"
|
||||
@for n in $(NAMES); do \
|
||||
rm -f "$$n.aux" "$$n.log" "$$n.fdb_latexmk" "$$n.fls"; \
|
||||
done
|
||||
|
||||
# Nuke everything, including PDFs
|
||||
clobber: clean
|
||||
@echo "[clobber] removing PDFs for: $(NAMES)"
|
||||
@for n in $(NAMES); do rm -f "$$n.pdf"; done
|
||||
|
||||
Reference in New Issue
Block a user