Merge branch 'libsndfile'
[Faustine.git] / Makefile
1 # Faustine top-level Makefile.
2
3 EXEC = faustine
4 SRC_DIR = interpretor
5 PREPROCESSOR_DIR = $(SRC_DIR)/preprocessor/faust-0.9.47mr3
6 OUTPUTSOUNDS_DIR = examples/output_sounds
7
8 DESTDIR ?=
9 PREFIX ?= /usr/local
10 prefix := $(DESTDIR)$(PREFIX)
11 arch := $(wildcard architecture/*.*)
12
13 all: $(EXEC)
14
15 faustine:
16 @cd $(SRC_DIR) && $(MAKE) opt # using ocamlopt
17 @cd $(SRC_DIR) && $(MAKE) clean
18
19 .PHONY: clean mrproper test help install uninstall
20
21 help :
22 @echo "make or make all : compiler the faustine interpreter"
23 @echo "make clean : remove all object files"
24 @echo "make doc : generate the documentation using ocamldoc (TODO)"
25 @echo "make install : install the interpreter and the library files in $(prefix)/bin $(prefix)/lib/faustine"
26 @echo "make uninstall : undo what install did"
27 @echo "make dist : make a tar.gz file ready for distribution (TODO)"
28
29 clean:
30 @(cd $(SRC_DIR) && $(MAKE) clean)
31 @(rm -f *~)
32
33 mrproper: clean
34 @(cd $(SRC_DIR) && $(MAKE) mrproper)
35 @(cd $(PREPROCESSOR_DIR) && $(MAKE) clean)
36
37 test: # TODO, obsolete
38 @rm -f $(OUTPUTSOUNDS_DIR)/output0.wav
39 @cd $(SRC_DIR) && ./faustine -d ../dsp_files/sin.dsp
40 @ls -l $(OUTPUTSOUNDS_DIR)/output0.wav
41
42 @echo " You might want to check the output file with either:"
43 @echo "audacity ../examples/output_sounds/output0.wav"
44 @echo "open ../examples/output_sounds/output0.wav"
45 @echo "octave -q --eval 'plot(wavread(\"../examples/output_sounds/output0.wav\")); pause'"
46
47 install :
48 mkdir -p $(prefix)/lib/faustine/
49 mkdir -p $(prefix)/bin/
50 install interpretor/faustine $(prefix)/bin/
51 install -m 0644 $(arch) $(prefix)/lib/faustine/
52
53 uninstall :
54 rm -rf $(prefix)/lib/faustine/
55 rm -f $(prefix)/bin/faustine