diff options
author | pdp8 <pdp8@pdp8.info> | 2024-03-04 23:13:40 +0100 |
---|---|---|
committer | pdp8 <pdp8@pdp8.info> | 2024-03-04 23:13:40 +0100 |
commit | 0555b2cd77986d916968f1443e375fad005c8d43 (patch) | |
tree | 84112db3509f5d9b40fe41abd14fa6bc1c41303d /Makefile | |
parent | 6b40f3b54efabb740e825ba3d94b5695c2b98ede (diff) |
html.rb separated, Makefile for website generation
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 95 |
1 files changed, 63 insertions, 32 deletions
@@ -1,49 +1,80 @@ -media_dir = /srv/media +MEDIA_DIR := /srv/media +TEST_DIR := /srv/www/pdp8-test +PUB_DIR := /srv/www/pdp8 -music_dir = $(media_dir)/music -flac = $(wildcard $(music_dir)/*/*.flac) -mp3 := $(subst flac,mp3,$(flac)) +MUSIC_DIR := $(MEDIA_DIR)/music +FLAC := $(wildcard $(MUSIC_DIR)/*/*.flac) +MP3 := $(subst flac,mp3,$(FLAC)) -img_dir = $(media_dir)/pictures -src_dir = $(img_dir)/src -thumb_dir = $(img_dir)/thumb -www_dir = $(img_dir)/www -img = $(wildcard $(src_dir)/*.jpeg) -img_thumb := $(subst $(src_dir), $(thumb_dir), $(subst jpeg,webp, $(img))) -img_www := $(subst $(src_dir), $(www_dir), $(subst jpeg,webp, $(img))) +IMG_DIR := $(MEDIA_DIR)/pictures +WWW_DIR := $(IMG_DIR)/www +IMG := $(wildcard $(SRC_DIR)/*.jpeg) +IMG_WWW := $(subst $(SRC_DIR), $(WWW_DIR), $(subst jpeg,webp, $(IMG))) -video_dir = /srv/media/videos -video_webm = $(wildcard $(video_dir)/*/*.webm) -video_mp4 := $(subst webm,mp4, $(video_webm)) -video_webp := $(subst webm,webp, $(video_webm)) -video_png := $(subst webm,png, $(video_webm)) +VIDEO_DIR := /srv/media/videos +VIDEO_WEBM := $(wildcard $(VIDEO_DIR)/*/*.webm) +VIDEO_MP4 := $(subst webm,mp4, $(VIDEO_WEBM)) +VIDEO_WEBP := $(subst webm,webp, $(VIDEO_WEBM)) +VIDEO_PNG := $(subst webm,png, $(VIDEO_WEBM)) -climbing_dir = /srv/media/climbing -climbing_webm = $(wildcard $(climbing_dir)/*.webm) -climbing_mp4 := $(subst webm,mp4, $(climbing_webm)) -climbing_webp := $(subst webm,webp, $(climbing_webm)) +CLIMBING_DIR := /srv/media/climbing +CLIMBING_WEBM := $(wildcard $(CLIMBING_DIR)/*.webm) +CLIMBING_MP4 := $(subst webm,mp4, $(CLIMBING_WEBM)) +CLIMBING_WEBP := $(subst webm,webp, $(CLIMBING_WEBM)) -all: music pictures videos climbing +HTML := index.html music.html pictures.html videos.html climbing.html about.html code.html contact.html social/create.html social/announce.html +OTHER := pdp8.png 540px-PDP-8_.jpg style.css robots.txt sitemap.txt rss.xml -music: $(mp3) +TEST_HTML := $(addprefix $(TEST_DIR)/, $(HTML)) +TEST_OTHER := $(addprefix $(TEST_DIR)/, $(OTHER)) +PUB_HTML := $(addprefix $(PUB_DIR)/, $(HTML)) -pictures: $(img_www) $(img_thumb) +all: test + cd $(TEST_DIR); git commit -am "$$(date)"; git push; cd $(PUB_DIR); git pull -videos: $(video_mp4) $(video_webp) +test: $(TEST_HTML) $(TEST_OTHER) -climbing: $(climbing_mp4) $(climbing_webp) +$(TEST_DIR)/rss.xml: $(TEST_HTML) + ./rss.rb -%.mp3: %.flac - ffmpeg -i $< -y -vsync 0 -ab 256k -map_metadata 0 -id3v2_version 3 $@ +$(TEST_DIR)/index.html: $(TEST_DIR)/music.html + cp $< $@ + +$(TEST_DIR)/music.html: $(MP3) + ./music.rb + +$(TEST_DIR)/pictures.html: /srv/social/outbox/create/ $(IMG_WWW) + ./pictures.rb + +$(TEST_DIR)/videos.html: $(VIDEO_MP4) $(VIDEO_WEBP) + ./videos.rb + +$(TEST_DIR)/climbing.html: $(CLIMBING_MP4) $(CLIMBING_WEBP) + ./climbing.rb + +$(TEST_DIR)/%.html: ./html/%.html + ./file.rb $< + +$(TEST_DIR)/%.png: ./html/%.png + cp $< $@ + +$(TEST_DIR)/%.jpg: ./html/%.jpg + cp $< $@ + +$(TEST_DIR)/%.css: ./html/%.css + cp $< $@ + +$(TEST_DIR)/%.txt: ./html/%.txt + cp $< $@ + +%.MP3: %.FLAC + ffmpeg -i $< -y -vsync 0 -ab 256k -MAP_METADATA 0 -ID3V2_VERSION 3 $@ %.webp: %.webm - ffmpeg -i $< -hide_banner -loglevel error -vf thumbnail -frames:v 1 -c:v png -f image2pipe - | convert - $@ + ffmpeg -i $< -HIDE_BANNER -loglevel error -vf thumbnail -frames:v 1 -c:v png -f image2pipe - | convert - $@ -$(www_dir)/%.webp: $(src_dir)/%.jpeg +$(WWW_DIR)/%.webp: $(IMG_DIR)/%.jpeg convert $< -resize 1536x1024 -quality 85 $@ -$(thumb_dir)/%.webp: $(src_dir)/%.jpeg - convert $< -resize 150x100 -quality 85 $@ - %.mp4: %.webm ffmpeg -i $< -vf scale=1280:-2 -c:v h264 -c:a aac -b:a 128k -strict -2 -movflags faststart $@ |