From cf3b54a5523d8d2f8724ec54b78ecd71d0b268a9 Mon Sep 17 00:00:00 2001 From: Tomasz Kramkowski Date: Sun, 4 Aug 2024 10:58:20 +0700 Subject: Makefile improvements --- GNUmakefile | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 82769b1..93f1727 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -13,8 +13,7 @@ title_10m := "Versatile Beeps" tracknum_15m := 1 title_15m := "Medium Beeps" -title = $(title_$(1)) -tracknum = $(tracknum_$(1)) +get = $($(1)_$(2)) all: ogg mp3 ogg: $(oggs) @@ -24,16 +23,21 @@ mp3: $(mp3s) 10m.pcm: duration := 600 15m.pcm: duration := 900 -%.ogg: %.pcm - oggenc --quiet --raw --raw-bits=8 --raw-chan=1 --raw-rate=8000 --quality=5 --artist=$(artist) --genre=$(genre) --date=$(year) --tracknum=$(call tracknum,$*) --title=$(call title,$*) --album=$(album) --output=$@ $< +%.ogg: %.pcm GNUmakefile + oggenc --quiet --raw --raw-bits=8 --raw-chan=1 --raw-rate=8000 --quality=5 \ + --artist=$(artist) --genre=$(genre) --date=$(year) \ + --tracknum=$(call get,tracknum,$*) --title=$(call get,title,$*) \ + --album=$(album) --output=$@ $< -%.mp3: %.pcm - lame --quiet -r -s 8 --bitwidth 8 --unsigned -m m -V 4 --tt $(call title,$*) --ta $(artist) --tl $(album) --ty $(year) --tn $(call tracknum,$*) --tg $(genre) --noreplaygain $< $@ +%.mp3: %.pcm GNUmakefile + lame --quiet -r -s 8 --bitwidth 8 --unsigned -m m -V 4 \ + --tt $(call get,title,$*) --ta $(artist) --tl $(album) --ty $(year) \ + --tn $(call get,tracknum,$*) --tg $(genre) --noreplaygain $< $@ $(pcms): target/release/beeps GNUmakefile $< $(duration) >$@ -target/release/beeps: Cargo.lock Cargo.toml beeps.rs +target/release/beeps: Cargo.lock Cargo.toml beeps.rs GNUmakefile cargo build --release clean: -- cgit v1.2.3-54-g00ecf