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.

283 lines
9.8KB

  1. #!/usr/bin/make -f
  2. # Makefile for jackbridge #
  3. # ----------------------- #
  4. # Created by falkTX
  5. #
  6. CWD=..
  7. MODULENAME=jackbridge
  8. include ../modules/Makefile.mk
  9. # ---------------------------------------------------------------------------------------------------------------------
  10. BUILD_CXX_FLAGS += $(JACKBRIDGE_FLAGS) -I../backend
  11. LINK_FLAGS += $(JACKBRIDGE_LIBS)
  12. ifeq ($(JACKBRIDGE_DIRECT),true)
  13. BUILD_CXX_FLAGS += $(JACK_FLAGS) -DJACKBRIDGE_DIRECT
  14. LINK_FLAGS += $(JACK_LIBS)
  15. endif
  16. ifneq ($(BUILDING_FOR_WINE),true)
  17. ifeq ($(WINDOWS),true)
  18. BUILD_CXX_FLAGS += -I../modules
  19. endif
  20. endif
  21. WINE_32BIT_FLAGS = $(32BIT_FLAGS) -fpermissive
  22. WINE_64BIT_FLAGS = $(64BIT_FLAGS) -fpermissive
  23. WINE_BUILD_FLAGS = $(filter-out -flto,$(BUILD_CXX_FLAGS))
  24. WINE_LINK_FLAGS = $(filter-out -flto -static-libgcc -static-libstdc++,$(LINK_FLAGS))
  25. WINE_LINK_FLAGS += $(LIBDL_LIBS)
  26. WINE_LINK_FLAGS += -pthread
  27. WINE_LINK_FLAGS += -lpthread
  28. WINE_LINK_FLAGS += -lstdc++
  29. ifneq ($(MACOS),true)
  30. WINE_32BIT_FLAGS += -I/usr/include/wine/wine/windows
  31. WINE_32BIT_FLAGS += -I/usr/include/wine-development/windows
  32. WINE_32BIT_FLAGS += -I/opt/wine-devel/include/wine/windows
  33. WINE_32BIT_FLAGS += -L/usr/lib32/wine
  34. WINE_32BIT_FLAGS += -L/usr/lib/wine
  35. WINE_32BIT_FLAGS += -L/usr/lib/i386-linux-gnu/wine
  36. WINE_32BIT_FLAGS += -L/usr/lib/i386-linux-gnu/wine-development
  37. WINE_32BIT_FLAGS += -L/usr/lib/i386-linux-gnu/wine-development/i386-unix
  38. WINE_32BIT_FLAGS += -L/opt/wine-stable/lib
  39. WINE_32BIT_FLAGS += -L/opt/wine-stable/lib/wine
  40. WINE_32BIT_FLAGS += -L/opt/wine-stable/lib/wine/i386-unix
  41. WINE_32BIT_FLAGS += -L/opt/wine-staging/lib
  42. WINE_32BIT_FLAGS += -L/opt/wine-staging/lib/wine
  43. WINE_32BIT_FLAGS += -L/opt/wine-staging/lib/wine/i386-unix
  44. WINE_64BIT_FLAGS += -I/usr/include/wine/wine/windows
  45. WINE_64BIT_FLAGS += -I/usr/include/wine-development/windows
  46. WINE_64BIT_FLAGS += -I/opt/wine-devel/include/wine/windows
  47. WINE_64BIT_FLAGS += -L/usr/lib64/wine
  48. WINE_64BIT_FLAGS += -L/usr/lib/x86_64-linux-gnu/wine
  49. WINE_64BIT_FLAGS += -L/usr/lib/x86_64-linux-gnu/wine-development
  50. WINE_64BIT_FLAGS += -L/usr/lib/x86_64-linux-gnu/wine-development/x86_64-unix
  51. WINE_64BIT_FLAGS += -L/opt/wine-stable/lib64
  52. WINE_64BIT_FLAGS += -L/opt/wine-stable/lib64/wine
  53. WINE_64BIT_FLAGS += -L/opt/wine-stable/lib64/wine/x86_64-unix
  54. WINE_64BIT_FLAGS += -L/opt/wine-staging/lib64
  55. WINE_64BIT_FLAGS += -L/opt/wine-staging/lib64/wine
  56. WINE_64BIT_FLAGS += -L/opt/wine-staging/lib64/wine/x86_64-unix
  57. WINE_LINK_FLAGS += -lrt
  58. endif
  59. # ---------------------------------------------------------------------------------------------------------------------
  60. OBJS = $(OBJDIR)/JackBridge1.cpp.o $(OBJDIR)/JackBridge2.cpp.o
  61. OBJS_min = $(OBJDIR)/JackBridge2.cpp.o
  62. OBJS_arm32 = $(OBJDIR)/JackBridge1.cpp.arm32.o $(OBJDIR)/JackBridge2.cpp.arm32.o
  63. OBJS_posix32 = $(OBJDIR)/JackBridge1.cpp.posix32.o $(OBJDIR)/JackBridge2.cpp.posix32.o
  64. OBJS_posix64 = $(OBJDIR)/JackBridge1.cpp.posix64.o $(OBJDIR)/JackBridge2.cpp.posix64.o
  65. OBJS_win32 = $(OBJDIR)/JackBridge1.cpp.win32.o $(OBJDIR)/JackBridge2.cpp.win32.o
  66. OBJS_win64 = $(OBJDIR)/JackBridge1.cpp.win64.o $(OBJDIR)/JackBridge2.cpp.win64.o
  67. OBJS_wine32 = $(OBJDIR)/JackBridge1.cpp.wine32.o $(OBJDIR)/JackBridge2.cpp.wine32.o $(OBJDIR)/JackBridge3.cpp.wine32.o
  68. OBJS_wine64 = $(OBJDIR)/JackBridge1.cpp.wine64.o $(OBJDIR)/JackBridge2.cpp.wine64.o $(OBJDIR)/JackBridge3.cpp.wine64.o
  69. OBJS_posix32e = $(OBJDIR)/JackBridgeExport.cpp.posix32e.o
  70. OBJS_posix64e = $(OBJDIR)/JackBridgeExport.cpp.posix64e.o
  71. OBJS_win64e = $(OBJDIR)/JackBridgeExport.cpp.win64e.o
  72. OBJS_win32e = $(OBJDIR)/JackBridgeExport.cpp.win32e.o
  73. # ---------------------------------------------------------------------------------------------------------------------
  74. all: $(MODULEDIR)/$(MODULENAME).a
  75. min: $(MODULEDIR)/$(MODULENAME).min.a
  76. ifeq ($(WINDOWS),true)
  77. posix32:
  78. posix64:
  79. posix32e:
  80. posix64e:
  81. win32: $(MODULEDIR)/$(MODULENAME).win32.a
  82. win64: $(MODULEDIR)/$(MODULENAME).win64.a
  83. win32e: $(MODULEDIR)/$(MODULENAME).win32e.a
  84. win64e: $(MODULEDIR)/$(MODULENAME).win64e.a
  85. wine32:
  86. wine64:
  87. else
  88. arm32: $(MODULEDIR)/$(MODULENAME).arm32.a
  89. posix32: $(MODULEDIR)/$(MODULENAME).posix32.a
  90. posix64: $(MODULEDIR)/$(MODULENAME).posix64.a
  91. posix32e: $(MODULEDIR)/$(MODULENAME).posix32e.a
  92. posix64e: $(MODULEDIR)/$(MODULENAME).posix64e.a
  93. win32:
  94. win64:
  95. win32e:
  96. win64e:
  97. wine32: $(MODULEDIR)/$(MODULENAME)-wine32.dll$(LIB_EXT)
  98. wine64: $(MODULEDIR)/$(MODULENAME)-wine64.dll$(LIB_EXT)
  99. endif
  100. # ---------------------------------------------------------------------------------------------------------------------
  101. clean:
  102. rm -f $(OBJDIR)/*.o $(MODULEDIR)/$(MODULENAME)*.*
  103. debug:
  104. $(MAKE) DEBUG=true
  105. # ---------------------------------------------------------------------------------------------------------------------
  106. $(MODULEDIR)/$(MODULENAME).a: $(OBJS)
  107. -@mkdir -p $(MODULEDIR)
  108. @echo "Creating $(MODULENAME).a"
  109. $(SILENT)rm -f $@
  110. $(SILENT)$(AR) crs $@ $^
  111. $(MODULEDIR)/$(MODULENAME).min.a: $(OBJS_min)
  112. -@mkdir -p $(MODULEDIR)
  113. @echo "Creating $(MODULENAME).min.a"
  114. $(SILENT)rm -f $@
  115. $(SILENT)$(AR) crs $@ $^
  116. $(MODULEDIR)/$(MODULENAME).arm32.a: $(OBJS_arm32)
  117. -@mkdir -p $(MODULEDIR)
  118. @echo "Creating $(MODULENAME).arm32.a"
  119. $(SILENT)rm -f $@
  120. $(SILENT)$(AR) crs $@ $^
  121. $(MODULEDIR)/$(MODULENAME).posix32.a: $(OBJS_posix32)
  122. -@mkdir -p $(MODULEDIR)
  123. @echo "Creating $(MODULENAME).posix32.a"
  124. $(SILENT)rm -f $@
  125. $(SILENT)$(AR) crs $@ $^
  126. $(MODULEDIR)/$(MODULENAME).posix64.a: $(OBJS_posix64)
  127. -@mkdir -p $(MODULEDIR)
  128. @echo "Creating $(MODULENAME).posix64.a"
  129. $(SILENT)rm -f $@
  130. $(SILENT)$(AR) crs $@ $^
  131. $(MODULEDIR)/$(MODULENAME).win32.a: $(OBJS_win32)
  132. -@mkdir -p $(MODULEDIR)
  133. @echo "Creating $(MODULENAME).win32.a"
  134. $(SILENT)rm -f $@
  135. $(SILENT)$(AR) crs $@ $^
  136. $(MODULEDIR)/$(MODULENAME).win64.a: $(OBJS_win64)
  137. -@mkdir -p $(MODULEDIR)
  138. @echo "Creating $(MODULENAME).win64.a"
  139. $(SILENT)rm -f $@
  140. $(SILENT)$(AR) crs $@ $^
  141. # ---------------------------------------------------------------------------------------------------------------------
  142. $(MODULEDIR)/$(MODULENAME).posix32e.a: $(OBJS_posix32e)
  143. -@mkdir -p $(MODULEDIR)
  144. @echo "Creating $(MODULENAME).posix32e.a"
  145. $(SILENT)rm -f $@
  146. $(SILENT)$(AR) crs $@ $^
  147. $(MODULEDIR)/$(MODULENAME).posix64e.a: $(OBJS_posix64e)
  148. -@mkdir -p $(MODULEDIR)
  149. @echo "Creating $(MODULENAME).posix64e.a"
  150. $(SILENT)rm -f $@
  151. $(SILENT)$(AR) crs $@ $^
  152. $(MODULEDIR)/$(MODULENAME).win32e.a: $(OBJS_win32e)
  153. -@mkdir -p $(MODULEDIR)
  154. @echo "Creating $(MODULENAME).win32e.a"
  155. $(SILENT)rm -f $@
  156. $(SILENT)$(AR) crs $@ $^
  157. $(MODULEDIR)/$(MODULENAME).win64e.a: $(OBJS_win64e)
  158. -@mkdir -p $(MODULEDIR)
  159. @echo "Creating $(MODULENAME).win64e.a"
  160. $(SILENT)rm -f $@
  161. $(SILENT)$(AR) crs $@ $^
  162. # ---------------------------------------------------------------------------------------------------------------------
  163. $(MODULEDIR)/$(MODULENAME)-wine32.dll$(LIB_EXT): $(OBJS_wine32) JackBridgeExport.def
  164. -@mkdir -p $(MODULEDIR)
  165. @echo "Linking $(MODULENAME)-wine32.dll$(LIB_EXT)"
  166. $(SILENT)$(WINECC) $^ $(WINE_32BIT_FLAGS) $(WINE_LINK_FLAGS) $(SHARED) -o $@
  167. $(MODULEDIR)/$(MODULENAME)-wine64.dll$(LIB_EXT): $(OBJS_wine64) JackBridgeExport.def
  168. -@mkdir -p $(MODULEDIR)
  169. @echo "Linking $(MODULENAME)-wine64.dll$(LIB_EXT)"
  170. $(SILENT)$(WINECC) $^ $(WINE_64BIT_FLAGS) $(WINE_LINK_FLAGS) $(SHARED) -o $@
  171. # ---------------------------------------------------------------------------------------------------------------------
  172. $(OBJDIR)/JackBridge1.cpp.o: JackBridge1.cpp
  173. -@mkdir -p $(OBJDIR)
  174. @echo "Compiling JackBridge1.cpp"
  175. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
  176. $(OBJDIR)/JackBridge2.cpp.o: JackBridge2.cpp
  177. -@mkdir -p $(OBJDIR)
  178. @echo "Compiling JackBridge2.cpp"
  179. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
  180. # ---------------------------------------------------------------------------------------------------------------------
  181. $(OBJDIR)/JackBridgeExport.cpp.%32e.o: JackBridgeExport.cpp
  182. -@mkdir -p $(OBJDIR)
  183. @echo "Compiling $<"
  184. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(32BIT_FLAGS) -fpermissive -c -o $@
  185. $(OBJDIR)/JackBridgeExport.cpp.%64e.o: JackBridgeExport.cpp
  186. -@mkdir -p $(OBJDIR)
  187. @echo "Compiling $<"
  188. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(64BIT_FLAGS) -fpermissive -c -o $@
  189. # ---------------------------------------------------------------------------------------------------------------------
  190. $(OBJDIR)/%.cpp.arm32.o: %.cpp
  191. -@mkdir -p $(OBJDIR)
  192. @echo "Compiling $< (arm32)"
  193. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(ARM32_FLAGS) -c -o $@
  194. $(OBJDIR)/%.cpp.posix32.o: %.cpp
  195. -@mkdir -p $(OBJDIR)
  196. @echo "Compiling $< (posix32)"
  197. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(32BIT_FLAGS) -c -o $@
  198. $(OBJDIR)/%.cpp.posix64.o: %.cpp
  199. -@mkdir -p $(OBJDIR)
  200. @echo "Compiling $< (posix64)"
  201. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(64BIT_FLAGS) -c -o $@
  202. $(OBJDIR)/%.cpp.win32.o: %.cpp
  203. -@mkdir -p $(OBJDIR)
  204. @echo "Compiling $< (win32)"
  205. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(32BIT_FLAGS) -c -o $@
  206. $(OBJDIR)/%.cpp.win64.o: %.cpp
  207. -@mkdir -p $(OBJDIR)
  208. @echo "Compiling $< (win64)"
  209. $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(64BIT_FLAGS) -c -o $@
  210. $(OBJDIR)/%.cpp.wine32.o: %.cpp
  211. -@mkdir -p $(OBJDIR)
  212. @echo "Compiling $< (wine32)"
  213. $(SILENT)$(WINECC) $< $(WINE_32BIT_FLAGS) $(WINE_BUILD_FLAGS) -c -o $@
  214. $(OBJDIR)/%.cpp.wine64.o: %.cpp
  215. -@mkdir -p $(OBJDIR)
  216. @echo "Compiling $< (wine64)"
  217. $(SILENT)$(WINECC) $< $(WINE_64BIT_FLAGS) $(WINE_BUILD_FLAGS) -c -o $@
  218. # ---------------------------------------------------------------------------------------------------------------------
  219. -include $(OBJS:%.o=%.d)
  220. -include $(OBJS_arm32:%.o=%.d)
  221. -include $(OBJS_posix32:%.o=%.d)
  222. -include $(OBJS_posix32e:%.o=%.d)
  223. -include $(OBJS_posix64:%.o=%.d)
  224. -include $(OBJS_posix64e:%.o=%.d)
  225. -include $(OBJS_win32:%.o=%.d)
  226. -include $(OBJS_win32e:%.o=%.d)
  227. -include $(OBJS_win64:%.o=%.d)
  228. -include $(OBJS_win64e:%.o=%.d)
  229. -include $(OBJS_wine32:%.o=%.d)
  230. -include $(OBJS_wine64:%.o=%.d)
  231. # ---------------------------------------------------------------------------------------------------------------------