1
0
flewkey.com/Makefile

72 lines
1.7 KiB
Makefile

PAGES_IN = $(wildcard pages/*)
POSTS_IN = $(wildcard posts/*.md)
MUSIC_IN = $(wildcard music/*.mp3)
PAGES_OUT = $(addprefix dist/,$(notdir $(PAGES_IN:.md=.html)))
POSTS_OUT = $(addprefix dist/blog/,$(notdir $(POSTS_IN:.md=.html)))
MUSIC_OUT = $(addprefix dist/music/,$(notdir $(MUSIC_IN)))
POST_LISTS = dist/blog/index.html dist/blog/feed.xml
MUSIC_LISTS = dist/music/index.html dist/music/feed.xml
all: $(PAGES_OUT) $(POSTS_OUT) $(MUSIC_OUT) $(POST_LISTS) $(MUSIC_LISTS)
cp -urv static/. dist
dist/index.html: pages/index.md dist music.json $(POSTS_OUT)
scripts/template_md.py $< $@
dist/%.html: pages/%.md | dist
scripts/template_md.py $< $@
dist/%.html: pages/%.html | dist
cp $< $@
dist/blog/%.html: posts/%.md dist/blog temp/openring.html
scripts/template_md.py $< $@
dist/music/%.mp3: music/%.mp3 | dist/music
cp $< $@
$(POST_LISTS): $(POSTS_OUT)
scripts/gen_blog.py posts $@
$(MUSIC_LISTS): music.json | $(OUTPUT_MUSIC)
scripts/gen_music.py $< $@
temp/openring.html: temp templates/openring.html scripts/openring/openring
scripts/openring/openring -l 256\
-s http://jakob.space/feed.xml \
-s https://drewdevault.com/feed.xml \
-s http://mjsstuf.x10host.com/wp49/feed/ \
-s https://blag.nicolor.tech/feed/feed.xml \
-s https://cricket.piapiac.org/blog/atom.xml \
< templates/openring.html \
> temp/openring.html
scripts/openring/openring:
cd scripts/openring && go build
dist/blog:
mkdir -p dist/blog
dist/music:
mkdir -p dist/music
dist:
mkdir dist
temp:
mkdir temp
.PHONY: clean upload
upload: dist
lftp -c "set ftp:list-options -a;\
open '$(shell cat ftp_url.txt)';\
lcd dist;\
cd public_html;\
mirror --reverse"
clean:
rm -rf dist