Add target to render guide track.
[music/pretentious.git] / targets.mk
1 # Project root directory
2 TOP := $(dir $(lastword $(MAKEFILE_LIST)))
3
4 # What soundfont to use to generate the MIDI file
5 SOUNDFONT = $(HOME)/soundfonts/FluidR3GM.sf2
6 # Determine how many processors are present
7 CPU_CORES=`grep -m1 "cpu cores" /proc/cpuinfo | tr -cd '[:digit:]'`
8 # The command to run lilypond
9 LILY_CMD = lilypond -ddelete-intermediate-files -drelative-includes -djob-count=$(CPU_CORES)
10
11 parts/%.pdf: parts/%.ly music/%.ly
12 $(LILY_CMD) $<
13
14 %.pdf: %.ly music/*.ly
15 $(LILY_CMD) $<
16
17 %.midi: %.ly music/*.ly
18 $(LILY_CMD) $<
19
20 %.wav: %.midi
21 fluidsynth -r 48000 -F $@ -l -R no -i -n -a alsa $(SOUNDFONT) $<
22
23 %-klick-mono.wav: %.tempo
24 klick -W $@ -f $<
25
26 %-klick.wav: %-klick-mono.wav
27 sox $< $@ channels 2
28
29 %-guide.wav: %-klick.wav %.wav
30 sox --combine mix $*-klick.wav -v 0.25 $*.wav $@
31
32 %.ogg: %.wav
33 oggenc $<
34
35 wav: $(NAME).wav
36 ogg: $(NAME).ogg
37 guide: $(NAME)-guide.wav
38
39 upload-ogg: ogg
40 scp $(NAME).ogg elephly.net:~/elephly.net/secret/band/$(NAME)/$(NAME).ogg
41
42 upload-wav: wav
43 scp $(NAME).wav elephly.net:~/elephly.net/secret/band/$(NAME)/$(NAME).wav