USER=paul FILE_NAME=paul-halvorsen-resume NAME=build-paul-resume CONTAINER_NAME=${NAME}-container USER_ID=$(shell id -u ${USER}) GROUP_ID=$(shell id -g ${USER}) CONTAINER_EXISTS=0 ifneq ("$(shell podman images -q ${NAME} 2> /dev/null)","") CONTAINER_EXISTS=1 endif resume: .podman-build podman run --rm \ --volume "$(realpath .)":/data \ --name ${CONTAINER_NAME} \ ${NAME} \ ${FILE_NAME}.md -f markdown+yaml_metadata_block --template templates/jb2resume.latex -o ${FILE_NAME}.pdf .podman-build: if [ ${CONTAINER_EXISTS} -ne 1 ]; then podman build -t ${NAME} . && echo "" > .podman-build; fi cleanpaper: rm -f ${FILE_NAME}.pdf cleanpodman: @echo "Cleanup files and podman" if [ ${CONTAINER_EXISTS} -ne 0 ]; then podman image rm -f ${NAME} && rm -f .podman-build; fi clean: rm -f *.log cleanall: clean cleanpaper cleanpodman @echo "Cleanup everything"