-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
54 lines (42 loc) · 1.76 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# If RACK_DIR is not defined when calling the Makefile, default to two directories above
RACK_DIR ?= ../..
# Must follow the format in the Naming section of
# https://vcvrack.com/manual/PluginDevelopmentTutorial.html
SLUG = Milkrack
# Must follow the format in the Versioning section of
# https://vcvrack.com/manual/PluginDevelopmentTutorial.html
VERSION = 0.6.1
# Platform detection
include $(RACK_DIR)/arch.mk
# FLAGS will be passed to both the C and C++ compiler
FLAGS +=
CFLAGS +=
CXXFLAGS +=
# Careful about linking to shared libraries, since you can't assume much about the user's environment and library search path.
# Static libraries are fine.
LDFLAGS += -fPIC
ifdef ARCH_WIN
LDFLAGS += -shared -Wl,--export-all-symbols -lopengl32
endif
ifdef ARCH_WIN
LIBPROJECTM = libs/win/libprojectM/libprojectM.a
else
LIBPROJECTM = src/deps/projectm/src/libprojectM/.libs/libprojectM.a
endif
OBJECTS += $(LIBPROJECTM)
# Add .cpp and .c files to the build
SOURCES += $(wildcard src/*.cpp)
# Add files to the ZIP package when running `make dist`
# The compiled plugin is automatically added.
DISTRIBUTABLES += $(wildcard LICENSE*) res src/deps/projectm/presets/presets_projectM
# Include the VCV Rack plugin Makefile framework
include $(RACK_DIR)/plugin.mk
dep: $(LIBPROJECTM)
src/deps/projectm/src/libprojectM/.libs/libprojectM.a:
(cd src/deps/projectm; git apply ../projectm_*.diff || true)
(cd src/deps/projectm; ./autogen.sh)
(cd src/deps/projectm; export CFLAGS=-I$(shell pwd)/src/deps/glm CXXFLAGS=-I$(shell pwd)/src/deps/glm ; ./configure --with-pic --enable-static --disable-threading)
(cd src/deps/projectm; export CFLAGS=-I$(shell pwd)/src/deps/glm CXXFLAGS=-I$(shell pwd)/src/deps/glm ; make)
depclean:
(cd src/deps/projectm; make clean)
(cd src/deps/projectm; git checkout -- .)