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.

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