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.

276 lines
9.6KB

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