# # Copyright (c) 2014 Rafael Vega # # BSD Simplified License. # For information on usage and redistribution, and for a DISCLAIMER OF ALL # WARRANTIES, see the file, "LICENSE.txt," in this distribution. # # See https://github.com/libpd/libpd for documentation # # detect platform, move libpd dylib to local folder on mac UNAME = $(shell uname) SOLIB_PREFIX = lib ifeq ($(UNAME), Darwin) # Mac SOLIB_EXT = dylib PLATFORM = mac CXXFLAGS = -D__MACOSX_CORE__ -DHAVE_UNISTD_H AUDIO_API = -framework Foundation -framework CoreAudio else ifeq ($(OS), Windows_NT) # Windows, use Mingw SOLIB_PREFIX = SOLIB_EXT = dll PLATFORM = windows CXXFLAGS = -D__WINDOWS_DS__ AUDIO_API = -lole32 -loleaut32 -ldsound -lwinmm else # assume Linux SOLIB_EXT = so PLATFORM = linux CXXFLAGS = -D__UNIX_JACK__ -D__LINUX_ALSA__ AUDIO_API = -ljack -lasound -pthread endif endif LIBPD_DIR = ../../.. LIBPD = $(LIBPD_DIR)/libs/$(SOLIB_PREFIX)pd.$(SOLIB_EXT) SRC_FILES = src/PdObject.cpp src/main.cpp src/RtAudio.cpp TARGET = pdtest_rtaudio CXXFLAGS += -I$(LIBPD_DIR)/libpd_wrapper -I$(LIBPD_DIR)/libpd_wrapper/util \ -I$(LIBPD_DIR)/pure-data/src -I$(LIBPD_DIR)/cpp \ -I./src -std=c++11 -DLIBPD_USE_STD_MUTEX -O3 .PHONY: clean clobber $(TARGET): ${SRC_FILES:.cpp=.o} $(LIBPD) g++ -o $(TARGET) $^ $(LIBPD) $(AUDIO_API) ifeq ($(PLATFORM), mac) mkdir -p ./libs && cp $(LIBPD) ./libs endif $(LIBPD): cd $(LIBPD_DIR) && make UTIL=true EXTRA=true clean: rm -f src/*.o clobber: clean rm -f $(TARGET) ifeq ($(PLATFORM), mac) rm -rf ./libs endif cd $(LIBPD_DIR) && make clobber