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.

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