diff options
-rw-r--r-- | Makefile | 73 | ||||
-rw-r--r-- | dynamic.mk | 77 |
2 files changed, 70 insertions, 80 deletions
@@ -1,77 +1,16 @@ .POSIX: -FQDN = euandre.org +.DEFAULT: + $(MAKE) generated.mk + $(MAKE) -f dynamic.mk $< - - -derived-assets = \ - static/lord-favicon.png \ - static/lord-favicon.ico \ - favicon.ico \ - TODOs.html \ - - - -all: public - -dynamic: generated.mk +all: generated.mk $(MAKE) -f dynamic.mk all generated.mk: ALWAYS JEKYLL_COMPAT sh src/development/dynmake.sh > $@ -JEKYLL_COMPAT: - sh src/development/JEKYLL_COMPAT/copy-content.sh -# NOOP rule to assert that the targets that depend on it are -# always considered stale. ALWAYS: -static/lord-favicon.png: static/lord-favicon.svg - inkscape -o $@ -w 2048 -h 2048 -b white static/lord-favicon.svg - -static/lord-favicon.ico: static/lord-favicon.svg - convert static/lord-favicon.svg $@ - -favicon.ico: static/lord-favicon.ico - ln -fs static/lord-favicon.ico $@ - -TODOs.html: TODOs.md - sh aux/workflow/TODOs.sh -n website -m public-inbox > $@ - - - - -check: - -disabled: - sh aux/assert-shellcheck.sh - sh aux/workflow/assert-todos.sh - sh scripts/assert-spelling.sh - sh scripts/extract-translations.sh - sh scripts/apply-translations.sh - -dev-check: check - -clean: - if [ -e generated.mk ]; then \ - $(MAKE) -f dynamic.mk clean; \ - fi - rm -rf \ - public/ .jekyll-cache \ - $(derived-assets) \ - src/content/ generated.mk - - -JEKYLL = JEKYLL_ENV=production jekyll -public: $(derived-assets) dynamic - $(JEKYLL) build - -run: all - open 'http://localhost:4000' - $(JEKYLL) serve - -deploy: all - rsync -avzP public/ $(FQDN):/home/user-data/www/default/ --delete - -fqdn: - printf '$(FQDN)' +JEKYLL_COMPAT: + sh src/development/JEKYLL_COMPAT/copy-content.sh @@ -1,4 +1,11 @@ .POSIX: +FQDN = euandre.org +PORT = 4444 + + + +include generated.mk + .SUFFIXES: @@ -19,14 +26,10 @@ .flac.ogg: ffmpeg -y -i $< -ar 48000 -vn -c:a libvorbis -b:a 320k $@ -default: all -include generated.mk - - -pastebins.env = $(pastebins.md:.md=.env) +pastebins.env = $(pastebins.md:.md=.env) pastebins.html = $(pastebins.md:.md=.html) -pastebins = $(pastebins.env) $(pastebins.html) +pastebins = $(pastebins.env) $(pastebins.html) html = $(pastebins.html) @@ -38,19 +41,67 @@ lilypond = $(lilypond.pdf) $(lilypond.midi) $(lilypond.ogg) podcasts.ogg = $(podcasts.flac:.flac=.ogg) podcasts = $(podcasts.ogg) +favicons = \ + static/lord-favicon.png \ + static/lord-favicon.ico \ + favicon.ico \ + ALL = \ - $(html) \ - $(lilypond) \ - $(torrent-files) \ - $(podcasts) + $(html) \ + $(lilypond) \ + $(torrent-files) \ + $(podcasts) \ + $(favicons) \ + TODOs.html \ $(html): src/development/genhtml.sh -all: $(ALL) +all: $(ALL) public $(torrent-files): mktorrent -f -v -d -n $@ -o $@ -c '' "$(@D)/`basename $@ .torrent`" clean: - rm -f \ - $(ALL) + rm -rf $(ALL) public/ .jekyll-cache/ src/content/ generated.mk + +TODOs.html: TODOs.md + sh aux/workflow/TODOs.sh -n website -m public-inbox > $@ + +static/lord-favicon.png: static/lord-favicon.svg + inkscape -o $@ -w 2048 -h 2048 -b white static/lord-favicon.svg + +static/lord-favicon.ico: static/lord-favicon.svg + convert static/lord-favicon.svg $@ + +favicon.ico: static/lord-favicon.ico + ln -fs static/lord-favicon.ico $@ + + +check: +dev-check: check + +fqdn: + printf '$(FQDN)' + + +disabled: + sh aux/assert-shellcheck.sh + sh aux/workflow/assert-todos.sh + sh scripts/assert-spelling.sh + sh scripts/extract-translations.sh + sh scripts/apply-translations.sh + + +# `public` depends on $(ALL) because `jekyll build` needs some of the files +# generated in $(ALL), IOW for JEKYLL_COMPAT. As soon as jekyll is removed, +# `public` can become an alias for `all`, and the "$(ALL) public" combo can be +# replaced by "all", such as the dependencies for "run". +public: $(ALL) + JEKYLL_ENV=production jekyll build + +run: $(ALL) public + open 'http://localhost:$(PORT)' + serve -d public/ -p $(PORT) + +deploy: all + rsync -avzP public/ $(FQDN):/home/user-data/www/default/ --delete |