MakeFile

    Example see more:

    Hello Summary

    DEBUG ?= 0
    CONTAINER := $(shell command -v podman 2>/dev/null)
    
    CONTAINER_OPTIONS=run --net=none -v "$$PWD":/workdir -w /workdir blang/latex:ubuntu \
    /bin/sh -c
    
    PDF_GENERATION=pdflatex file.tex $(OUTPUT)
    
    ifeq ($(DEBUG), 1)
      OUTPUT=
    else
      OUTPUT=>/dev/null
    endif
    
    # default call
    all: pdf
    
    .PHONY: environment pdf clean
    
    environment:
    ifdef CONTAINER
      podman pull blang/latex:ubuntu
    endif
    
    pdf: environment
    ifdef CONTAINER
      podman $(CONTAINER_OPTIONS) "$(PDF_GENERATION)"
    else
      $(PDF_GENERATION)
    endif
    
    clean:
      rm -f file.pdf
    

    Usage: make DEBUG=1