New Makefile for libsndfile-ocaml library integration; Makefiles chain modified.
[Faustine.git] / Makefile.in
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 # @cp $(SNDFILE_PATH)/sndfile_stub.o $(SRC_DIR)
17 ## Using ocamlopt with 'make opt'
18 @cd $(SRC_DIR) && $(MAKE) opt #OCAML_INCLUDE_PATH=$(OCAML_INCLUDE_PATH) SNDFILE_PATH=$(SNDFILE_PATH)
19 @cd $(SRC_DIR) && $(MAKE) clean
20
21 .PHONY: clean mrproper test help install uninstall
22
23 help :
24 @echo "make or make all : compiler the faustine interpreter"
25 @echo "make clean : remove all object files"
26 @echo "make doc : generate the documentation using ocamldoc (TODO)"
27 @echo "make install : install the interpreter and the library files in $(prefix)/bin $(prefix)/lib/faustine"
28 @echo "make uninstall : undo what install did"
29 @echo "make dist : make a tar.gz file ready for distribution (TODO)"
30
31 clean:
32 @(cd $(SRC_DIR) && $(MAKE) clean)
33 @(rm -f *~)
34
35 mrproper: clean
36 @(cd $(SRC_DIR) && $(MAKE) mrproper)
37 @(cd $(PREPROCESSOR_DIR) && $(MAKE) clean)
38
39 test: # TODO, obsolete
40 @rm -f $(OUTPUTSOUNDS_DIR)/output0.wav
41 @cd $(SRC_DIR) && ./faustine -d ../dsp_files/sin.dsp
42 @ls -l $(OUTPUTSOUNDS_DIR)/output0.wav
43
44 @echo " You might want to check the output file with either:"
45 @echo "audacity ../examples/output_sounds/output0.wav"
46 @echo "open ../examples/output_sounds/output0.wav"
47 @echo "octave -q --eval 'plot(wavread(\"../examples/output_sounds/output0.wav\")); pause'"
48
49 install :
50 mkdir -p $(prefix)/lib/faustine/
51 mkdir -p $(prefix)/bin/
52 install interpretor/faustine $(prefix)/bin/
53 install -m 0644 $(arch) $(prefix)/lib/faustine/
54
55 uninstall :
56 rm -rf $(prefix)/lib/faustine/
57 rm -f $(prefix)/bin/faustine