From c3172fb0fdd549873f4e97da4085314c90881304 Mon Sep 17 00:00:00 2001 From: Emil Miler Date: Mon, 3 Jun 2024 09:54:05 +0200 Subject: [PATCH] Make PDF the default target --- .gitea/workflows/build.yaml | 2 +- makefile | 8 ++++++-- readme.md | 11 ++++++++--- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index e96b927..a716eeb 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -22,7 +22,7 @@ jobs: run: git clone https://git.0x45.cz/em/mixtape.git /workspace/em/mixtape - name: Build Chordpro - run: make + run: make pdf html - name: Build Zola run: zola build diff --git a/makefile b/makefile index cf2117e..d386a54 100644 --- a/makefile +++ b/makefile @@ -12,7 +12,7 @@ SONG_PDF := $(patsubst %$(SRC_EXTENSION),%.pdf,$(SONG_CHO)) SONG_HTML := $(patsubst %$(SRC_EXTENSION),%.html,$(SONG_CHO)) SONGBOOK := songbook.pdf -.DEFAULT_GOAL := all +.DEFAULT_GOAL := pdf %.pdf: %$(SRC_EXTENSION) $(CHORDPRO_CMD) -o $@ $< @@ -20,7 +20,7 @@ SONGBOOK := songbook.pdf %.html: %$(SRC_EXTENSION) $(CHORDPRO_CMD) -o $@ $< -all: $(SONG_PDF) $(SONG_HTML) $(SONGBOOK) +all: pdf html songbook $(SONGBOOK): $(SONG_PDF) gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=$@ $^ @@ -31,6 +31,10 @@ html: $(SONG_HTML) .PHONY: pdf pdf: $(SONG_PDF) +.PHONY: songbook +songbook: pdf + $(MAKE) $(SONGBOOK) + .PHONY: clean clean: rm -f $(SONG_PDF) $(SONG_HTML) $(SONGBOOK) diff --git a/readme.md b/readme.md index 41fcd8a..8357e74 100644 --- a/readme.md +++ b/readme.md @@ -14,10 +14,15 @@ alias chordpro="docker run -ti --rm --env HOME=\$HOME --env USER=\$USER --workdi ## Building -`make` defaults to `all` which builds individual PDF and HTML files for -all songs. It also builds one complete PDF songbook with all songs. +`make` defaults to `pdf` which builds individual PDF files for all songs. -Available targets: `all`, `pdf`, `html`, `clean` +Target | Description +-|- +`all` | `pdf`, `html`, `songbook` +`pdf` | Build individual PDF files +`html` | Build individual HTML files +`songbook` | Build one complete PDF songbook with all songs +`clean` | Remove all generated files You can also build PDF for a specific page with: