The JUCE cross-platform C++ framework, with DISTRHO/KXStudio specific changes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

73 lines
2.0KB

  1. ifeq ($(shell uname),Darwin)
  2. PLATFORM = MacOS
  3. else
  4. PLATFORM = Linux
  5. endif
  6. # C++ compiler.
  7. CXX := g++ -std=c++11
  8. # Build configuration (Debug or Release).
  9. ifndef CONFIG
  10. CONFIG := Debug
  11. endif
  12. ifeq ($(CONFIG),Debug)
  13. CXXFLAGS += -O0 -g -DDEBUG=1 -D_DEBUG=1
  14. else
  15. CXXFLAGS += -O3 -DNDEBUG
  16. endif
  17. # The name of your application.
  18. APP_NAME := BlockFinder
  19. # The path to the modules directory in the BLOCKS SDK directory.
  20. SDK_PATH := ../../../SDK
  21. # The path to temporary build files.
  22. OBJECT_DIR := build/$(CONFIG)
  23. # The path to the compiled BLOCKSSDK library.
  24. BLOCKS_LIBRARY := $(SDK_PATH)/Build/$(PLATFORM)/$(CONFIG)/libBLOCKS-SDK.a
  25. # The source code for this application.
  26. SOURCE_FILES := $(wildcard ../*.cpp) $(foreach EXT,.cpp .mm,$(wildcard *$(EXT)))
  27. # Make a list of object files from .cpp files.
  28. SOURCE_OBJ := $(addprefix $(OBJECT_DIR)/,$(notdir $(addsuffix .o,$(basename $(SOURCE_FILES)))))
  29. # Header include paths (prefix with -I).
  30. INCLUDES := -I$(SDK_PATH)
  31. # Frameworks and libraries.
  32. ifeq ($(PLATFORM),MacOS)
  33. LIBS := -framework Accelerate -framework AudioToolbox -framework Carbon -framework Cocoa -framework CoreAudio -framework CoreMIDI -framework IOKit -framework OpenGL -framework QuartzCore
  34. else
  35. LIBS := -L/usr/X11R6/lib/ $(shell pkg-config --libs alsa libcurl x11) -ldl -lpthread -lrt
  36. CXXFLAGS += -DLINUX=1
  37. endif
  38. ##############################################################################
  39. # Build rules #
  40. ##############################################################################
  41. .PHONEY: clean
  42. $(CONFIG)/$(APP_NAME): $(SOURCE_OBJ) $(BLOCKS_LIBRARY)
  43. @mkdir -p $(dir $@)
  44. $(CXX) $^ -o $@ $(LIBS)
  45. $(OBJECT_DIR)/%.o: ../%.cpp
  46. @mkdir -p $(dir $@)
  47. $(CXX) $(CXXFLAGS) $(INCLUDES) -o $@ -c $<
  48. $(OBJECT_DIR)/%.o: %.cpp
  49. @mkdir -p $(dir $@)
  50. $(CXX) $(CXXFLAGS) $(INCLUDES) -o $@ -c $<
  51. $(OBJECT_DIR)/%.o: %.mm
  52. @mkdir -p $(dir $@)
  53. $(CXX) $(CXXFLAGS) $(INCLUDES) -o $@ -c $<
  54. clean:
  55. rm -rf $(CONFIG) $(OBJECT_DIR)