f566a2111eb4cd66b11ec1c8ceb64f28e3b08d2f
[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 %.ogg: %.wav
24 oggenc $<
25
26 wav: $(NAME).wav
27 ogg: $(NAME).ogg
28
29 upload-ogg: ogg
30 scp $(NAME).ogg elephly.net:~/elephly.net/secret/band/$(NAME)/$(NAME).ogg
31
32 upload-wav: wav
33 scp $(NAME).wav elephly.net:~/elephly.net/secret/band/$(NAME)/$(NAME).wav