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.

181 lines
6.0KB

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