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.

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