Skip to content
Snippets Groups Projects
Makefile 844 B
Newer Older
all: docker
SamCH93's avatar
SamCH93 committed

# specify same name as in paper/Makefile
FILE=rsabsence
SamCH93's avatar
SamCH93 committed

## build locally
local:
	-cd paper && make pdf clean
	-mv paper/$(FILE).pdf ./
SamCH93's avatar
SamCH93 committed

## build docker image (requires root access for docker)
dbuild: Dockerfile
	docker build \
    -t $(FILE) .
SamCH93's avatar
SamCH93 committed

SamCH93's avatar
SamCH93 committed
## run docker image that produces *tex* from within docker
## and compiles to *pdf* outside docker
docker: dbuild
	docker run \
    --rm \
	--env FILE=$(FILE) \
	-v $(CURDIR):/output \
		$(FILE)
## compile pdf using LaTeX outside docker
	mv $(FILE).tex paper/
	mkdir -p paper/figure
	mv figure/* paper/figure
	rmdir figure/
	cd paper && make pdf2 clean
SamCH93's avatar
SamCH93 committed
	mv paper/$(FILE).pdf ./
SamCH93's avatar
SamCH93 committed

## run docker image that produces *pdf* from within docker
docker2: dbuild
	docker run \
    --rm \
	--env pdfdocker="true" \
	--env FILE=$(FILE) \
	--volume $(CURDIR):/output \
	$(FILE)
	mv $(FILE).pdf ./