2 # Makefile for jackbridge #
3 # ----------------------- #
9 include ..
/modules
/Makefile.mk
11 # ---------------------------------------------------------------------------------------------------------------------
13 BUILD_CXX_FLAGS
+= $(JACKBRIDGE_FLAGS
) -I..
/backend
14 LINK_FLAGS
+= $(JACKBRIDGE_LIBS
)
16 ifeq ($(JACKBRIDGE_DIRECT
),true
)
17 BUILD_CXX_FLAGS
+= $(JACK_FLAGS
) -DJACKBRIDGE_DIRECT
18 LINK_FLAGS
+= $(JACK_LIBS
)
21 ifneq ($(BUILDING_FOR_WINE
),true
)
22 ifeq ($(WINDOWS
),true
)
23 BUILD_CXX_FLAGS
+= -I..
/modules
27 WINE_32BIT_FLAGS
= $(32BIT_FLAGS
) -fpermissive
28 WINE_64BIT_FLAGS
= $(64BIT_FLAGS
) -fpermissive
29 WINE_BUILD_FLAGS
= $(filter-out -flto
,$(BUILD_CXX_FLAGS
))
30 WINE_LINK_FLAGS
= $(filter-out -flto
-static-libgcc
-static-libstdc
++,$(LINK_FLAGS
))
31 WINE_LINK_FLAGS
+= $(LIBDL_LIBS
)
32 WINE_LINK_FLAGS
+= -pthread
33 WINE_LINK_FLAGS
+= -lpthread
34 WINE_LINK_FLAGS
+= -lstdc
++
37 WINE_32BIT_FLAGS
+= -I
/usr
/include/wine
/wine
/windows
38 WINE_32BIT_FLAGS
+= -I
/usr
/include/wine-development
/windows
39 WINE_32BIT_FLAGS
+= -I
/opt
/wine-devel
/include/wine
/windows
40 WINE_32BIT_FLAGS
+= -L
/usr
/lib32
/wine
41 WINE_32BIT_FLAGS
+= -L
/usr
/lib
/wine
42 WINE_32BIT_FLAGS
+= -L
/usr
/lib
/i386-linux-gnu
/wine
43 WINE_32BIT_FLAGS
+= -L
/usr
/lib
/i386-linux-gnu
/wine-development
44 WINE_32BIT_FLAGS
+= -L
/usr
/lib
/i386-linux-gnu
/wine-development
/i386-unix
45 WINE_32BIT_FLAGS
+= -L
/opt
/wine-stable
/lib
46 WINE_32BIT_FLAGS
+= -L
/opt
/wine-stable
/lib
/wine
47 WINE_32BIT_FLAGS
+= -L
/opt
/wine-stable
/lib
/wine
/i386-unix
48 WINE_32BIT_FLAGS
+= -L
/opt
/wine-staging
/lib
49 WINE_32BIT_FLAGS
+= -L
/opt
/wine-staging
/lib
/wine
50 WINE_32BIT_FLAGS
+= -L
/opt
/wine-staging
/lib
/wine
/i386-unix
52 WINE_64BIT_FLAGS
+= -I
/usr
/include/wine
/wine
/windows
53 WINE_64BIT_FLAGS
+= -I
/usr
/include/wine-development
/windows
54 WINE_64BIT_FLAGS
+= -I
/opt
/wine-devel
/include/wine
/windows
55 WINE_64BIT_FLAGS
+= -L
/usr
/lib64
/wine
56 WINE_64BIT_FLAGS
+= -L
/usr
/lib
/x86_64-linux-gnu
/wine
57 WINE_64BIT_FLAGS
+= -L
/usr
/lib
/x86_64-linux-gnu
/wine-development
58 WINE_64BIT_FLAGS
+= -L
/usr
/lib
/x86_64-linux-gnu
/wine-development
/x86_64-unix
59 WINE_64BIT_FLAGS
+= -L
/opt
/wine-stable
/lib64
60 WINE_64BIT_FLAGS
+= -L
/opt
/wine-stable
/lib64
/wine
61 WINE_64BIT_FLAGS
+= -L
/opt
/wine-stable
/lib64
/wine
/x86_64-unix
62 WINE_64BIT_FLAGS
+= -L
/opt
/wine-staging
/lib64
63 WINE_64BIT_FLAGS
+= -L
/opt
/wine-staging
/lib64
/wine
64 WINE_64BIT_FLAGS
+= -L
/opt
/wine-staging
/lib64
/wine
/x86_64-unix
66 WINE_LINK_FLAGS
+= -lrt
69 # ---------------------------------------------------------------------------------------------------------------------
71 OBJS
= $(OBJDIR
)/JackBridge1.
cpp.o
$(OBJDIR
)/JackBridge2.
cpp.o
72 OBJS_min
= $(OBJDIR
)/JackBridge2.
cpp.o
73 OBJS_arm32
= $(OBJDIR
)/JackBridge1.
cpp.arm32.o
$(OBJDIR
)/JackBridge2.
cpp.arm32.o
74 OBJS_posix32
= $(OBJDIR
)/JackBridge1.
cpp.posix32.o
$(OBJDIR
)/JackBridge2.
cpp.posix32.o
75 OBJS_posix64
= $(OBJDIR
)/JackBridge1.
cpp.posix64.o
$(OBJDIR
)/JackBridge2.
cpp.posix64.o
76 OBJS_win32
= $(OBJDIR
)/JackBridge1.
cpp.win32.o
$(OBJDIR
)/JackBridge2.
cpp.win32.o
77 OBJS_win64
= $(OBJDIR
)/JackBridge1.
cpp.win64.o
$(OBJDIR
)/JackBridge2.
cpp.win64.o
78 OBJS_wine32
= $(OBJDIR
)/JackBridge1.
cpp.wine32.o
$(OBJDIR
)/JackBridge2.
cpp.wine32.o
$(OBJDIR
)/JackBridge3.
cpp.wine32.o
79 OBJS_wine64
= $(OBJDIR
)/JackBridge1.
cpp.wine64.o
$(OBJDIR
)/JackBridge2.
cpp.wine64.o
$(OBJDIR
)/JackBridge3.
cpp.wine64.o
81 OBJS_posix32e
= $(OBJDIR
)/JackBridgeExport.
cpp.posix32e.o
82 OBJS_posix64e
= $(OBJDIR
)/JackBridgeExport.
cpp.posix64e.o
83 OBJS_win64e
= $(OBJDIR
)/JackBridgeExport.
cpp.win64e.o
84 OBJS_win32e
= $(OBJDIR
)/JackBridgeExport.
cpp.win32e.o
86 # ---------------------------------------------------------------------------------------------------------------------
88 all: $(MODULEDIR
)/$(MODULENAME
).a
89 min
: $(MODULEDIR
)/$(MODULENAME
).min.a
91 ifeq ($(WINDOWS
),true
)
96 win32
: $(MODULEDIR
)/$(MODULENAME
).win32.a
97 win64
: $(MODULEDIR
)/$(MODULENAME
).win64.a
98 win32e
: $(MODULEDIR
)/$(MODULENAME
).win32e.a
99 win64e
: $(MODULEDIR
)/$(MODULENAME
).win64e.a
103 arm32
: $(MODULEDIR
)/$(MODULENAME
).arm32.a
104 posix32
: $(MODULEDIR
)/$(MODULENAME
).posix32.a
105 posix64
: $(MODULEDIR
)/$(MODULENAME
).posix64.a
106 posix32e
: $(MODULEDIR
)/$(MODULENAME
).posix32e.a
107 posix64e
: $(MODULEDIR
)/$(MODULENAME
).posix64e.a
112 wine32
: $(MODULEDIR
)/$(MODULENAME
)-wine32.dll
$(LIB_EXT
)
113 wine64
: $(MODULEDIR
)/$(MODULENAME
)-wine64.dll
$(LIB_EXT
)
116 # ---------------------------------------------------------------------------------------------------------------------
119 rm -f
$(OBJDIR
)/*.o
$(MODULEDIR
)/$(MODULENAME
)*.
*
124 # ---------------------------------------------------------------------------------------------------------------------
126 $(MODULEDIR
)/$(MODULENAME
).a
: $(OBJS
)
127 -@mkdir
-p
$(MODULEDIR
)
128 @echo
"Creating $(MODULENAME).a"
130 $(SILENT
)$(AR
) crs
$@
$^
132 $(MODULEDIR
)/$(MODULENAME
).min.a
: $(OBJS_min
)
133 -@mkdir
-p
$(MODULEDIR
)
134 @echo
"Creating $(MODULENAME).min.a"
136 $(SILENT
)$(AR
) crs
$@
$^
138 $(MODULEDIR
)/$(MODULENAME
).arm32.a
: $(OBJS_arm32
)
139 -@mkdir
-p
$(MODULEDIR
)
140 @echo
"Creating $(MODULENAME).arm32.a"
142 $(SILENT
)$(AR
) crs
$@
$^
144 $(MODULEDIR
)/$(MODULENAME
).posix32.a
: $(OBJS_posix32
)
145 -@mkdir
-p
$(MODULEDIR
)
146 @echo
"Creating $(MODULENAME).posix32.a"
148 $(SILENT
)$(AR
) crs
$@
$^
150 $(MODULEDIR
)/$(MODULENAME
).posix64.a
: $(OBJS_posix64
)
151 -@mkdir
-p
$(MODULEDIR
)
152 @echo
"Creating $(MODULENAME).posix64.a"
154 $(SILENT
)$(AR
) crs
$@
$^
156 $(MODULEDIR
)/$(MODULENAME
).win32.a
: $(OBJS_win32
)
157 -@mkdir
-p
$(MODULEDIR
)
158 @echo
"Creating $(MODULENAME).win32.a"
160 $(SILENT
)$(AR
) crs
$@
$^
162 $(MODULEDIR
)/$(MODULENAME
).win64.a
: $(OBJS_win64
)
163 -@mkdir
-p
$(MODULEDIR
)
164 @echo
"Creating $(MODULENAME).win64.a"
166 $(SILENT
)$(AR
) crs
$@
$^
168 # ---------------------------------------------------------------------------------------------------------------------
170 $(MODULEDIR
)/$(MODULENAME
).posix32e.a
: $(OBJS_posix32e
)
171 -@mkdir
-p
$(MODULEDIR
)
172 @echo
"Creating $(MODULENAME).posix32e.a"
174 $(SILENT
)$(AR
) crs
$@
$^
176 $(MODULEDIR
)/$(MODULENAME
).posix64e.a
: $(OBJS_posix64e
)
177 -@mkdir
-p
$(MODULEDIR
)
178 @echo
"Creating $(MODULENAME).posix64e.a"
180 $(SILENT
)$(AR
) crs
$@
$^
182 $(MODULEDIR
)/$(MODULENAME
).win32e.a
: $(OBJS_win32e
)
183 -@mkdir
-p
$(MODULEDIR
)
184 @echo
"Creating $(MODULENAME).win32e.a"
186 $(SILENT
)$(AR
) crs
$@
$^
188 $(MODULEDIR
)/$(MODULENAME
).win64e.a
: $(OBJS_win64e
)
189 -@mkdir
-p
$(MODULEDIR
)
190 @echo
"Creating $(MODULENAME).win64e.a"
192 $(SILENT
)$(AR
) crs
$@
$^
194 # ---------------------------------------------------------------------------------------------------------------------
196 $(MODULEDIR
)/$(MODULENAME
)-wine32.dll
$(LIB_EXT
): $(OBJS_wine32
) JackBridgeExport.def
197 -@mkdir
-p
$(MODULEDIR
)
198 @echo
"Linking $(MODULENAME)-wine32.dll$(LIB_EXT)"
199 $(SILENT
)$(WINECC
) $^
$(WINE_32BIT_FLAGS
) $(WINE_LINK_FLAGS
) $(SHARED
) -o
$@
201 $(MODULEDIR
)/$(MODULENAME
)-wine64.dll
$(LIB_EXT
): $(OBJS_wine64
) JackBridgeExport.def
202 -@mkdir
-p
$(MODULEDIR
)
203 @echo
"Linking $(MODULENAME)-wine64.dll$(LIB_EXT)"
204 $(SILENT
)$(WINECC
) $^
$(WINE_64BIT_FLAGS
) $(WINE_LINK_FLAGS
) $(SHARED
) -o
$@
206 # ---------------------------------------------------------------------------------------------------------------------
208 $(OBJDIR
)/JackBridge1.
cpp.o
: JackBridge1.
cpp
210 @echo
"Compiling JackBridge1.cpp"
211 $(SILENT
)$(CXX
) $< $(BUILD_CXX_FLAGS
) -c
-o
$@
213 $(OBJDIR
)/JackBridge2.
cpp.o
: JackBridge2.
cpp
215 @echo
"Compiling JackBridge2.cpp"
216 $(SILENT
)$(CXX
) $< $(BUILD_CXX_FLAGS
) -c
-o
$@
218 # ---------------------------------------------------------------------------------------------------------------------
220 $(OBJDIR
)/JackBridgeExport.
cpp.
%32e.o
: JackBridgeExport.
cpp
223 $(SILENT
)$(CXX
) $< $(BUILD_CXX_FLAGS
) $(32BIT_FLAGS
) -fpermissive
-c
-o
$@
225 $(OBJDIR
)/JackBridgeExport.
cpp.
%64e.o
: JackBridgeExport.
cpp
228 $(SILENT
)$(CXX
) $< $(BUILD_CXX_FLAGS
) $(64BIT_FLAGS
) -fpermissive
-c
-o
$@
230 # ---------------------------------------------------------------------------------------------------------------------
232 $(OBJDIR
)/%.
cpp.arm32.o
: %.
cpp
234 @echo
"Compiling $< (arm32)"
235 $(SILENT
)$(CXX
) $< $(BUILD_CXX_FLAGS
) $(ARM32_FLAGS
) -c
-o
$@
237 $(OBJDIR
)/%.
cpp.posix32.o
: %.
cpp
239 @echo
"Compiling $< (posix32)"
240 $(SILENT
)$(CXX
) $< $(BUILD_CXX_FLAGS
) $(32BIT_FLAGS
) -c
-o
$@
242 $(OBJDIR
)/%.
cpp.posix64.o
: %.
cpp
244 @echo
"Compiling $< (posix64)"
245 $(SILENT
)$(CXX
) $< $(BUILD_CXX_FLAGS
) $(64BIT_FLAGS
) -c
-o
$@
247 $(OBJDIR
)/%.
cpp.win32.o
: %.
cpp
249 @echo
"Compiling $< (win32)"
250 $(SILENT
)$(CXX
) $< $(BUILD_CXX_FLAGS
) $(32BIT_FLAGS
) -c
-o
$@
252 $(OBJDIR
)/%.
cpp.win64.o
: %.
cpp
254 @echo
"Compiling $< (win64)"
255 $(SILENT
)$(CXX
) $< $(BUILD_CXX_FLAGS
) $(64BIT_FLAGS
) -c
-o
$@
257 $(OBJDIR
)/%.
cpp.wine32.o
: %.
cpp
259 @echo
"Compiling $< (wine32)"
260 $(SILENT
)$(WINECC
) $< $(WINE_32BIT_FLAGS
) $(WINE_BUILD_FLAGS
) -c
-o
$@
262 $(OBJDIR
)/%.
cpp.wine64.o
: %.
cpp
264 @echo
"Compiling $< (wine64)"
265 $(SILENT
)$(WINECC
) $< $(WINE_64BIT_FLAGS
) $(WINE_BUILD_FLAGS
) -c
-o
$@
267 # ---------------------------------------------------------------------------------------------------------------------
269 -include $(OBJS
:%.o
=%.d
)
270 -include $(OBJS_arm32
:%.o
=%.d
)
271 -include $(OBJS_posix32
:%.o
=%.d
)
272 -include $(OBJS_posix32e
:%.o
=%.d
)
273 -include $(OBJS_posix64
:%.o
=%.d
)
274 -include $(OBJS_posix64e
:%.o
=%.d
)
275 -include $(OBJS_win32
:%.o
=%.d
)
276 -include $(OBJS_win32e
:%.o
=%.d
)
277 -include $(OBJS_win64
:%.o
=%.d
)
278 -include $(OBJS_win64e
:%.o
=%.d
)
279 -include $(OBJS_wine32
:%.o
=%.d
)
280 -include $(OBJS_wine64
:%.o
=%.d
)
282 # ---------------------------------------------------------------------------------------------------------------------