name peg file after TYPE
[software/lv2-mdametapiano.git] / Makefile
1 TYPE = mdaPiano
2 ifeq ($(TYPE),mdaPiano)
3 BUILD_TYPE = PIANO
4 else
5 BUILD_TYPE = EPIANO
6 endif
7
8 BUNDLE = lv2-$(TYPE).lv2
9 PREFIX = /usr/local
10 INSTALL_DIR = $(PREFIX)/lib/lv2
11
12 SOURCES = src/*.cpp
13 FLAGS = -fPIC -DPIC -O $(WARNINGS) -D$(BUILD_TYPE)
14 WARNINGS = -g -Wall -pedantic
15
16 build/$(BUNDLE): src/$(TYPE)/manifest.ttl \
17 src/$(TYPE)/$(TYPE).ttl \
18 build/$(TYPE).so \
19 src/$(TYPE)/presets \
20 src/$(TYPE)/data/*.raw
21 rm -rf build/$(BUNDLE)
22 mkdir -p build/$(BUNDLE)
23 cp -r $^ build/$(BUNDLE)
24
25 build/$(TYPE).so: $(SOURCES) src/$(TYPE).peg
26 mkdir -p build
27 $(CXX) $(FLAGS) -shared $(SOURCES) `pkg-config --cflags --libs lvtk-plugin-1` -o $@
28
29 src/$(TYPE).peg: src/$(TYPE)/$(TYPE).ttl
30 ttl2c $^ src/$(TYPE).peg
31
32 install: build/$(BUNDLE)
33 mkdir -p $(INSTALL_DIR)
34 rm -rf $(INSTALL_DIR)/$(BUNDLE)
35 cp -R build/$(BUNDLE) $(INSTALL_DIR)
36
37 clean:
38 rm -rf build src/*.peg