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.

220 lines
7.5KB

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