view Makefile.example @ 74:65c802d88e23

Force Emscripten to emit the static memory init code inside the JS file. - Emscripten emits it into a separate .mem file for optimised builds, as of 1.12.1 - The file is loaded asyncronously, so occasionally the runtime hadn't initialised before trying to call functions (happened in Chrome, similar to what we've seen before) - This is the easiest fix, without changing the JS for this simple example.
author Lucas Thompson <lucas.thompson@qmul.ac.uk>
date Wed, 24 Aug 2016 14:18:08 +0100
parents c2a90b45642e
children
line wrap: on
line source

ADAPTER_HEADERS	:= VamPipeAdapter.h VamPipePluginLibrary.h 
ADAPTER_SOURCES	:= VamPipePluginLibrary.cpp

SDK_DIR		:= ../vamp-plugin-sdk

PLUGIN_SOURCES	:= \
		$(SDK_DIR)/examples/ZeroCrossing.cpp \
		$(SDK_DIR)/examples/SpectralCentroid.cpp \
		$(SDK_DIR)/examples/PercussionOnsetDetector.cpp \
		$(SDK_DIR)/examples/FixedTempoEstimator.cpp \
		$(SDK_DIR)/examples/AmplitudeFollower.cpp \
		$(SDK_DIR)/examples/PowerSpectrum.cpp

OTHER_SOURCES	:= \
		../json/json11/json11.cpp

SDK_LIBS	:= \
		$(SDK_DIR)/libvamp-hostsdk.a \
		$(SDK_DIR)/libvamp-sdk.a

EXAMPLE_EXT	:= .so
EXAMPLE		:= example$(EXAMPLE_EXT)
EXAMPLE_SOURCE	:= example.cpp
EXAMPLE_SOURCES	:= $(EXAMPLE_SOURCE) $(ADAPTER_SOURCES) $(PLUGIN_SOURCES) $(OTHER_SOURCES)
EXAMPLE_LDFLAGS	:= -shared -Wl,-Bsymbolic -Wl,-soname=example.so -Wl,-z,defs -Wl,--version-script=vampipe.map

TEST		:= quick-test
TEST_SOURCE	:= quick-test.cpp
TEST_LDFLAGS	:= -ldl

CXXFLAGS	:= -std=c++11 -fPIC -Wall -Wextra -g
INCPATH		:= -I$(SDK_DIR) -I.. -I../json

all:		$(EXAMPLE) $(TEST)
		./$(TEST)

$(EXAMPLE):	$(EXAMPLE_SOURCES) $(ADAPTER_HEADERS) $(SDK_LIBS)
		$(CXX) $(CXXFLAGS) $(INCPATH) -o $(EXAMPLE) \
		       $(EXAMPLE_SOURCES) $(SDK_LIBS) $(EXAMPLE_LDFLAGS)

$(TEST):	$(TEST_SOURCE)
		$(CXX) $(CXXFLAGS) -o $(TEST) $(TEST_SOURCE) $(TEST_LDFLAGS)

clean:
		rm -f $(EXAMPLE) $(TEST)