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.

197 lines
6.4KB

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