Use multiple CPU cores for lilypond.
[music/pretentious.git] / targets.mk
1 # What soundfont to use to generate the MIDI file
2 SOUNDFONT = $(HOME)/soundfonts/FluidR3GM.sf2
3 # Determine how many processors are present
4 CPU_CORES=`grep -m1 "cpu cores" /proc/cpuinfo | tr -cd '[:digit:]'`
5 # The command to run lilypond
6 LILY_CMD = lilypond -ddelete-intermediate-files -djob-count=$(CPU_CORES)
7
8 %.midi: %.ly parts/*.ly
9 $(LILY_CMD) $<
10
11 %.wav: %.midi
12 fluidsynth -r 48000 -F $@ -l -R no -i -n -a alsa $(SOUNDFONT) $<
13
14 %.ogg: %.wav
15 oggenc $<
16
17 wav: $(NAME).wav
18 ogg: $(NAME).ogg
19
20 upload-ogg: ogg
21 scp $(NAME).ogg elephly.net:~/elephly.net/secret/band/$(NAME)/$(NAME).ogg
22
23 upload-wav: wav
24 scp $(NAME).wav elephly.net:~/elephly.net/secret/band/$(NAME)/$(NAME).wav