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.

251 lines
8.2KB

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