-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
44 lines (40 loc) · 1019 Bytes
/
Makefile
File metadata and controls
44 lines (40 loc) · 1019 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Copyright (c) 2023-2024 Joel K. Pettersson <[email protected]>
#
# This file can be freely copied, modified, distributed. It has no warranty.
.SILENT:
.SUFFIXES: .sau .au .flac .wav .mp3 .ogg
DIRS = *
FMT = mp3
SRATE_TMP=192000 # higher than SRATE for oversampling, e.g. 4x for high quality
SRATE = 48000
SAUGNS = saugns
SOX = sox
.sau.au .sau.flac .sau.wav:
@echo $@; \
$(SAUGNS) -r$(SRATE_TMP) $< -o- | $(SOX) - -r$(SRATE) $@
.sau.mp3:
@echo $@; \
$(SAUGNS) -r$(SRATE_TMP) $< -o- | $(SOX) - -r$(SRATE) -C -3.01 $@
.sau.ogg:
@echo $@; \
$(SAUGNS) -r$(SRATE_TMP) $< -o- | $(SOX) - -r$(SRATE) -C 5.8 $@
all:
@for d in $(DIRS); do \
if [ -d $$d ] && [ -n "`ls $$d`" ]; then \
for f in $$d/*.sau; do \
make -s "$${f%.sau}.$(FMT)"; \
done; \
fi; \
done
check:
@for d in $(DIRS); do \
if [ -d $$d ] && [ -n "`ls $$d`" ]; then \
$(SAUGNS) -c $$d/*.sau; \
fi; \
done
clean:
@if [ "$(FMT)" != "sau" ]; then \
for d in $(DIRS); do \
rm -f $$d/*.$(FMT); \
done; \
fi