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.

260 lines
8.7KB

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