Skip to content
Snippets Groups Projects
Select Git revision
  • 671b92f1abb97e93ab1ddf90b4f1bbc211df089f
  • master default protected
2 results

Makefile

Blame
  • user avatar
    dgelessus authored
    The Gradle-based build had multiple problems and quirks: insufficient
    Java heap space when generating PDFs, bugs in the version selection for
    Ruby gems, and now a JCenter outage that made the build fail completely
    for a short time because some plugin dependencies couldn't be resolved.
    
    The build is now simple enough that a plain Makefile does the job as
    well, using the regular command-line version of Asciidoctor. This is
    noticeably faster than the Gradle build and hopefully should be simpler
    to maintain as well.
    c3a010a9
    History
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    Makefile 1.05 KiB
    ASCIIDOCTOR := asciidoctor
    ASCIIDOCTOR_PDF := asciidoctor-pdf
    ASCIIDOCTOR_OPTIONS := \
    	--attribute imagesoutdir=build/images \
    	--require asciidoctor-bibtex \
    	--require asciidoctor-diagram \
    
    BIBTEX_FILES := $(wildcard src/docs/bibtex/*.bib)
    COMBINED_BIBTEX_FILE := src/docs/asciidoc/combined.bib
    
    MAIN_FILE := src/docs/asciidoc/prob_handbook.adoc
    CHAPTER_FILES := $(wildcard src/docs/asciidoc/chapter/Java_API/*.adoc)
    
    .PHONY: all
    all: build/prob_handbook.html build/prob_handbook.pdf
    
    $(COMBINED_BIBTEX_FILE): $(BIBTEX_FILES)
    	cat $^ > $@
    
    build/prob_handbook.html: $(MAIN_FILE) $(CHAPTER_FILES) $(COMBINED_BIBTEX_FILE)
    	$(ASCIIDOCTOR) $(ASCIIDOCTOR_OPTIONS) --destination-dir $(@D) --source-dir $(<D) $<
    	cp src/docs/asciidoc/images/*.png build/images
    
    build/prob_handbook.pdf: $(MAIN_FILE) $(CHAPTER_FILES) $(COMBINED_BIBTEX_FILE)
    	$(ASCIIDOCTOR_PDF) $(ASCIIDOCTOR_OPTIONS) --destination-dir $(@D) --source-dir $(<D) $<
    
    .PHONY: html
    html: build/prob_handbook.html
    
    .PHONY: pdf
    pdf: build/prob_handbook.pdf
    
    .PHONY: clean
    clean:
    	$(RM) -r build $(COMBINED_BIBTEX_FILE)