Audio plugin host https://kx.studio/carla
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.

204 lines
6.5KB

  1. #!/usr/bin/make -f
  2. # Makefile for theme #
  3. # ------------------ #
  4. # Created by falkTX
  5. #
  6. CWD=..
  7. MODULENAME=theme
  8. include ../modules/Makefile.mk
  9. # ---------------------------------------------------------------------------------------------------------------------
  10. ifeq ($(MACOS),true)
  11. MAC_BUILDS_PREFIX = ~/builds/carla
  12. endif
  13. ifeq ($(WIN32),true)
  14. NON_STATIC_LINK_FLAGS = $(shell echo $(LINK_FLAGS) | awk 'sub(" -static","")') -static-libgcc
  15. else
  16. NON_STATIC_LINK_FLAGS = $(LINK_FLAGS)
  17. endif
  18. ifeq ($(HAVE_QT4),true)
  19. QT4_CXX_FLAGS = $(BUILD_CXX_FLAGS) $(shell pkg-config --cflags QtCore QtGui)
  20. QT4_LINK_FLAGS = $(NON_STATIC_LINK_FLAGS) $(shell pkg-config --libs QtCore QtGui)
  21. QT4_STYLES_DIR = $(shell pkg-config --variable=libdir QtCore)/qt4/plugins/styles
  22. endif
  23. ifeq ($(HAVE_QT5),true)
  24. QT5_CXX_FLAGS = $(BUILD_CXX_FLAGS) $(shell pkg-config --cflags Qt5Core Qt5Gui Qt5Widgets)
  25. QT5_LINK_FLAGS = $(NON_STATIC_LINK_FLAGS) $(shell pkg-config --libs Qt5Core Qt5Gui Qt5Widgets)
  26. QT5_STYLES_DIR = $(shell pkg-config --variable=libdir Qt5Core)/qt5/plugins/styles
  27. else
  28. ifeq ($(MACOS),true)
  29. ifeq ($(HAVE_PYQT),true)
  30. HAVE_QT5=true
  31. QT5_CXX_FLAGS = $(BUILD_CXX_FLAGS) -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB
  32. QT5_LINK_FLAGS = $(NON_STATIC_LINK_FLAGS) -F $(MAC_BUILDS_PREFIX)/lib -framework QtCore -framework QtGui -framework QtWidgets
  33. QT5_STYLES_DIR = $(MAC_BUILDS_PREFIX)/lib/qt5/plugins/styles
  34. endif
  35. endif
  36. endif
  37. ifeq ($(MACOS),true)
  38. QT5_CXX_FLAGS += -I $(MAC_BUILDS_PREFIX)/include/qt5
  39. endif
  40. # ---------------------------------------------------------------------------------------------------------------------
  41. ifeq ($(HAVE_QT4),true)
  42. FILES_qt4 = \
  43. $(OBJDIR)/moc_CarlaStyle.qt4.cpp \
  44. $(OBJDIR)/moc_CarlaStyleAnimations.qt4.cpp \
  45. $(OBJDIR)/moc_CarlaStylePlugin.qt4.cpp \
  46. $(OBJDIR)/moc_CarlaStylePrivate.qt4.cpp \
  47. $(OBJDIR)/resources.qt4.cpp
  48. endif
  49. ifeq ($(HAVE_QT5),true)
  50. FILES_qt5 = \
  51. $(OBJDIR)/moc_CarlaStyle.qt5.cpp \
  52. $(OBJDIR)/moc_CarlaStyleAnimations.qt5.cpp \
  53. $(OBJDIR)/moc_CarlaStylePlugin.qt5.cpp \
  54. $(OBJDIR)/moc_CarlaStylePrivate.qt5.cpp \
  55. $(OBJDIR)/resources.qt5.cpp
  56. endif
  57. # ---------------------------------------------------------------------------------------------------------------------
  58. ifeq ($(HAVE_QT4),true)
  59. OBJS_qt4 = \
  60. $(OBJDIR)/CarlaStyle.cpp.qt4.o \
  61. $(OBJDIR)/moc_CarlaStyle.qt4.cpp.o \
  62. $(OBJDIR)/moc_CarlaStyleAnimations.qt4.cpp.o \
  63. $(OBJDIR)/moc_CarlaStylePrivate.qt4.cpp.o \
  64. $(OBJDIR)/resources.qt4.cpp.o
  65. OBJS_qt4_shared = $(OBJS_qt4) \
  66. $(OBJDIR)/CarlaStylePlugin.cpp.qt4.o \
  67. $(OBJDIR)/moc_CarlaStylePlugin.qt4.cpp.o
  68. endif
  69. ifeq ($(HAVE_QT5),true)
  70. OBJS_qt5 = \
  71. $(OBJDIR)/CarlaStyle.cpp.qt5.o \
  72. $(OBJDIR)/moc_CarlaStyle.qt5.cpp.o \
  73. $(OBJDIR)/moc_CarlaStyleAnimations.qt5.cpp.o \
  74. $(OBJDIR)/moc_CarlaStylePrivate.qt5.cpp.o \
  75. $(OBJDIR)/resources.qt5.cpp.o
  76. OBJS_qt5_shared = $(OBJS_qt5) \
  77. $(OBJDIR)/CarlaStylePlugin.cpp.qt5.o \
  78. $(OBJDIR)/moc_CarlaStylePlugin.qt5.cpp.o
  79. endif
  80. # ---------------------------------------------------------------------------------------------------------------------
  81. ifeq ($(HAVE_QT5),true)
  82. all: $(BINDIR)/styles/carlastyle$(LIB_EXT) $(BINDIR)/styles/carlastyle.json
  83. else
  84. all:
  85. endif
  86. qt4: $(MODULEDIR)/$(MODULENAME).qt4.a
  87. qt5: $(MODULEDIR)/$(MODULENAME).qt5.a
  88. # ---------------------------------------------------------------------------------------------------------------------
  89. clean:
  90. rm -f $(OBJDIR)/*.o $(MODULEDIR)/$(MODULENAME)*.a $(BINDIR)/styles/carlastyle$(LIB_EXT) $(FILES_qt4) $(FILES_qt5)
  91. debug:
  92. $(MAKE) DEBUG=true
  93. install: $(BINDIR)/styles/carlastyle$(LIB_EXT) $(BINDIR)/styles/carlastyle.json
  94. install -d $(QT5_STYLES_DIR)
  95. install -m 644 $^ $(QT5_STYLES_DIR)
  96. # ---------------------------------------------------------------------------------------------------------------------
  97. $(MODULEDIR)/$(MODULENAME).qt4.a: $(FILES_qt4) $(OBJS_qt4)
  98. -@mkdir -p $(MODULEDIR)
  99. @echo "Creating $(MODULENAME).qt4.a"
  100. @rm -f $@
  101. @$(AR) crs $@ $(OBJS_qt4)
  102. $(MODULEDIR)/$(MODULENAME).qt5.a: $(FILES_qt5) $(OBJS_qt5)
  103. -@mkdir -p $(MODULEDIR)
  104. @echo "Creating $(MODULENAME).qt5.a"
  105. @rm -f $@
  106. @$(AR) crs $@ $(OBJS_qt5)
  107. # ---------------------------------------------------------------------------------------------------------------------
  108. $(BINDIR)/styles/carlastyle.dll: $(FILES_qt5) $(OBJS_qt5_shared)
  109. -@mkdir -p $(BINDIR)/styles
  110. @echo "Linking carlastyle.dll"
  111. @$(CXX) $(OBJS_qt5_shared) $(QT5_LINK_FLAGS) -shared -o $@
  112. $(BINDIR)/styles/carlastyle.dylib: $(FILES_qt5) $(OBJS_qt5_shared)
  113. -@mkdir -p $(BINDIR)/styles
  114. @echo "Linking carlastyle.dylib"
  115. @$(CXX) $(OBJS_qt5_shared) $(QT5_LINK_FLAGS) -dynamiclib -o $@
  116. $(BINDIR)/styles/carlastyle.so: $(FILES_qt5) $(OBJS_qt5_shared)
  117. -@mkdir -p $(BINDIR)/styles
  118. @echo "Linking carlastyle.so"
  119. @$(CXX) $(OBJS_qt5_shared) $(QT5_LINK_FLAGS) -shared -o $@
  120. $(BINDIR)/styles/carlastyle.json: styles/carlastyle.json
  121. -@mkdir -p $(BINDIR)/styles
  122. @cp -f $< $@
  123. # ---------------------------------------------------------------------------------------------------------------------
  124. $(OBJDIR)/moc_%.qt4.cpp: %.hpp
  125. -@mkdir -p $(OBJDIR)
  126. @echo "Generating moc_$*.qt4.cpp"
  127. @$(MOC_QT4) $< -o $@
  128. $(OBJDIR)/moc_%.qt5.cpp: %.hpp
  129. -@mkdir -p $(OBJDIR)
  130. @echo "Generating moc_$*.qt5.cpp"
  131. @$(MOC_QT5) -Istyles $< -o $@
  132. $(OBJDIR)/resources.qt4.cpp: $(CWD)/../resources/resources-theme.qrc
  133. -@mkdir -p $(OBJDIR)
  134. @echo "Generating resources.qt4.cpp"
  135. @$(RCC_QT4) $< -o $@
  136. $(OBJDIR)/resources.qt5.cpp: $(CWD)/../resources/resources-theme.qrc
  137. -@mkdir -p $(OBJDIR)
  138. @echo "Generating resources.qt5.cpp"
  139. @$(RCC_QT5) $< -o $@
  140. # ---------------------------------------------------------------------------------------------------------------------
  141. $(OBJDIR)/%.qt4.cpp.o: $(OBJDIR)/%.qt4.cpp $(OBJDIR)/moc_CarlaStyle.qt4.cpp
  142. -@mkdir -p $(OBJDIR)
  143. @echo "Compiling $*.cpp (Qt4)"
  144. @$(CXX) $< $(QT4_CXX_FLAGS) -Wno-unused-variable -c -o $@
  145. $(OBJDIR)/%.qt5.cpp.o: $(OBJDIR)/%.qt5.cpp $(OBJDIR)/moc_CarlaStyle.qt5.cpp
  146. -@mkdir -p $(OBJDIR)
  147. @echo "Compiling $*.cpp (Qt5)"
  148. @$(CXX) $< $(QT5_CXX_FLAGS) -c -o $@
  149. $(OBJDIR)/%.cpp.qt4.o: %.cpp $(OBJDIR)/moc_CarlaStyle.qt4.cpp
  150. -@mkdir -p $(OBJDIR)
  151. @echo "Compiling $< (Qt4)"
  152. @$(CXX) $< $(QT4_CXX_FLAGS) -c -o $@
  153. $(OBJDIR)/%.cpp.qt5.o: %.cpp $(OBJDIR)/moc_CarlaStyle.qt5.cpp
  154. -@mkdir -p $(OBJDIR)
  155. @echo "Compiling $< (Qt5)"
  156. @$(CXX) $< $(QT5_CXX_FLAGS) -c -o $@
  157. # ---------------------------------------------------------------------------------------------------------------------
  158. -include $(OBJS_qt4_shared:%.o=%.d)
  159. -include $(OBJS_qt5_shared:%.o=%.d)
  160. # ---------------------------------------------------------------------------------------------------------------------