Files
resume/Makefile
2025-08-11 16:33:57 -04:00

41 lines
987 B
Makefile

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 -it \
--volume "$(realpath .)":/data \
--user ${USER_ID}:${GROUP_ID} \
--name ${CONTAINER_NAME} \
${NAME} \
pandoc ${FILE_NAME}.md -f markdown+yaml_metadata_block --template templates/jb2resume.latex -o ${FILE_NAME}.pdf \
; podman stop ${CONTAINER_NAME} \
&& podman rm ${CONTAINER_NAME}
.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"