2 # Makefile for carla-discovery #
3 # ---------------------------- #
8 MODULENAME
=carla-discovery
9 include $(CWD
)/Makefile.mk
11 # ---------------------------------------------------------------------------------------------------------------------
13 BINDIR
:= $(CWD
)/..
/bin
16 OBJDIR
:= $(CWD
)/..
/build
/discovery
/Debug
17 MODULEDIR
:= $(CWD
)/..
/build
/modules
/Debug
19 OBJDIR
:= $(CWD
)/..
/build
/discovery
/Release
20 MODULEDIR
:= $(CWD
)/..
/build
/modules
/Release
23 # ---------------------------------------------------------------------------------------------------------------------
25 BUILD_CXX_FLAGS
+= -I
$(CWD
)/backend
-I
$(CWD
)/includes
-I
$(CWD
)/modules
-I
$(CWD
)/utils
28 BUILD_CXX_FLAGS
+= -ObjC
++
31 ifeq ($(WINDOWS
),true
)
32 LINK_FLAGS
+= -lole32
-lws2_32
-mwindows
36 LINK_FLAGS
+= -lpthread
38 BUILD_CXX_FLAGS
+= -pthread
39 LINK_FLAGS
+= -pthread
42 32BIT_FLAGS
+= -DBUILD_BRIDGE
-DBUILD_BRIDGE_ALTERNATIVE_ARCH
43 64BIT_FLAGS
+= -DBUILD_BRIDGE
-DBUILD_BRIDGE_ALTERNATIVE_ARCH
44 ARM32_FLAGS
+= -DBUILD_BRIDGE
-DBUILD_BRIDGE_ALTERNATIVE_ARCH
46 # ---------------------------------------------------------------------------------------------------------------------
51 ifeq ($(HAVE_FLUIDSYNTH
),true
)
52 NATIVE_BUILD_FLAGS
+= $(FLUIDSYNTH_FLAGS
)
53 NATIVE_LINK_FLAGS
+= $(FLUIDSYNTH_LIBS
)
56 ifeq ($(HAVE_YSFX
),true
)
57 NATIVE_BUILD_FLAGS
+= $(YSFX_FLAGS
)
60 # ---------------------------------------------------------------------------------------------------------------------
62 LIBS_native
= $(MODULEDIR
)/lilv.a
63 LIBS_arm32
= $(MODULEDIR
)/lilv.arm32.a
64 LIBS_posix32
= $(MODULEDIR
)/lilv.posix32.a
65 LIBS_posix64
= $(MODULEDIR
)/lilv.posix64.a
66 LIBS_win32
= $(MODULEDIR
)/lilv.win32.a
67 LIBS_win64
= $(MODULEDIR
)/lilv.win64.a
68 LINK_FLAGS
+= $(LILV_LIBS
)
70 LIBS_native
+= $(MODULEDIR
)/water.files.a
71 LIBS_arm32
+= $(MODULEDIR
)/water.files.arm32.a
72 LIBS_posix32
+= $(MODULEDIR
)/water.posix32.a
73 LIBS_posix64
+= $(MODULEDIR
)/water.posix64.a
74 LIBS_win32
+= $(MODULEDIR
)/water.win32.a
75 LIBS_win64
+= $(MODULEDIR
)/water.win64.a
76 LINK_FLAGS
+= $(WATER_LIBS
)
77 LINK_FLAGS
+= $(LIBDL_LIBS
)
79 ifeq ($(HAVE_YSFX
),true
)
80 LIBS_native
+= $(MODULEDIR
)/ysfx.a
81 LINK_FLAGS
+= $(YSFX_GRAPHICS_LIBS
)
84 ifeq ($(BUILDING_FOR_WINE
),true
)
85 LIBS_win32
+= $(MODULEDIR
)/jackbridge.win32e.a
86 LIBS_win64
+= $(MODULEDIR
)/jackbridge.win64e.a
89 # ---------------------------------------------------------------------------------------------------------------------
91 OBJS_native
= $(OBJDIR
)/$(MODULENAME
).
cpp.o
92 OBJS_arm32
= $(OBJDIR
)/$(MODULENAME
).
cpp.arm32.o
93 OBJS_posix32
= $(OBJDIR
)/$(MODULENAME
).
cpp.posix32.o
94 OBJS_posix64
= $(OBJDIR
)/$(MODULENAME
).
cpp.posix64.o
95 OBJS_win32
= $(OBJDIR
)/$(MODULENAME
).
cpp.win32.o
96 OBJS_win64
= $(OBJDIR
)/$(MODULENAME
).
cpp.win64.o
98 # ---------------------------------------------------------------------------------------------------------------------
102 # ---------------------------------------------------------------------------------------------------------------------
105 rm -f
$(OBJDIR
)/*.o
$(BINDIR
)/$(MODULENAME
)-*
110 # ---------------------------------------------------------------------------------------------------------------------
112 native
: $(BINDIR
)/$(MODULENAME
)-native
$(APP_EXT
)
113 arm32
: $(BINDIR
)/$(MODULENAME
)-arm32
114 posix32
: $(BINDIR
)/$(MODULENAME
)-posix32
115 posix64
: $(BINDIR
)/$(MODULENAME
)-posix64
116 win32
: $(BINDIR
)/$(MODULENAME
)-win32.exe
117 win64
: $(BINDIR
)/$(MODULENAME
)-win64.exe
119 # ---------------------------------------------------------------------------------------------------------------------
121 $(BINDIR
)/$(MODULENAME
)-native
$(APP_EXT
): $(OBJS_native
) $(LIBS_native
)
123 @echo
"Linking $(MODULENAME)-native$(APP_EXT)"
124 $(SILENT
)$(CXX
) $(OBJS_native
) $(LIBS_START
) $(LIBS_native
) $(LIBS_END
) $(LINK_FLAGS
) $(NATIVE_LINK_FLAGS
) -o
$@
126 $(BINDIR
)/$(MODULENAME
)-arm32
: $(OBJS_arm32
) $(LIBS_arm32
)
128 @echo
"Linking $(MODULENAME)-posix32"
129 $(SILENT
)$(CXX
) $(OBJS_arm32
) $(LIBS_START
) $(LIBS_arm32
) $(LIBS_END
) $(LINK_FLAGS
) $(ARM32_FLAGS
) -o
$@
131 $(BINDIR
)/$(MODULENAME
)-posix32
: $(OBJS_posix32
) $(LIBS_posix32
)
133 @echo
"Linking $(MODULENAME)-posix32"
134 $(SILENT
)$(CXX
) $(OBJS_posix32
) $(LIBS_START
) $(LIBS_posix32
) $(LIBS_END
) $(LINK_FLAGS
) $(32BIT_FLAGS
) -o
$@
136 $(BINDIR
)/$(MODULENAME
)-posix64
: $(OBJS_posix64
) $(LIBS_posix64
)
138 @echo
"Linking $(MODULENAME)-posix64"
139 $(SILENT
)$(CXX
) $(OBJS_posix64
) $(LIBS_START
) $(LIBS_posix64
) $(LIBS_END
) $(LINK_FLAGS
) $(64BIT_FLAGS
) -o
$@
141 $(BINDIR
)/$(MODULENAME
)-win32.exe
: $(OBJS_win32
) $(LIBS_win32
)
143 @echo
"Linking $(MODULENAME)-win32.exe"
144 $(SILENT
)$(CXX
) $(OBJS_win32
) $(LIBS_START
) $(LIBS_win32
) $(LIBS_END
) $(LINK_FLAGS
) $(32BIT_FLAGS
) -o
$@
146 $(BINDIR
)/$(MODULENAME
)-win64.exe
: $(OBJS_win64
) $(LIBS_win64
)
148 @echo
"Linking $(MODULENAME)-win64.exe"
149 $(SILENT
)$(CXX
) $(OBJS_win64
) $(LIBS_START
) $(LIBS_win64
) $(LIBS_END
) $(LINK_FLAGS
) $(64BIT_FLAGS
) -o
$@
151 # ---------------------------------------------------------------------------------------------------------------------
153 $(OBJDIR
)/$(MODULENAME
).
cpp.o
: $(MODULENAME
).
cpp
156 $(SILENT
)$(CXX
) $< $(BUILD_CXX_FLAGS
) $(NATIVE_BUILD_FLAGS
) -c
-o
$@
158 $(OBJDIR
)/$(MODULENAME
).
cpp.
%32.o
: $(MODULENAME
).
cpp
160 @echo
"Compiling $< (32bit)"
161 $(SILENT
)$(CXX
) $< $(BUILD_CXX_FLAGS
) $(32BIT_FLAGS
) -c
-o
$@
163 $(OBJDIR
)/$(MODULENAME
).
cpp.
%64.o
: $(MODULENAME
).
cpp
165 @echo
"Compiling $< (64bit)"
166 $(SILENT
)$(CXX
) $< $(BUILD_CXX_FLAGS
) $(64BIT_FLAGS
) -c
-o
$@
168 $(OBJDIR
)/$(MODULENAME
).
cpp.arm32.o
: $(MODULENAME
).
cpp
170 @echo
"Compiling $< (ARM32)"
171 $(SILENT
)$(CXX
) $< $(BUILD_CXX_FLAGS
) $(ARM32_FLAGS
) -c
-o
$@
173 # ---------------------------------------------------------------------------------------------------------------------
175 -include $(OBJS_native
:%.o
=%.d
)
176 -include $(OBJS_arm32
:%.o
=%.d
)
177 -include $(OBJS_posix32
:%.o
=%.d
)
178 -include $(OBJS_posix64
:%.o
=%.d
)
179 -include $(OBJS_win32
:%.o
=%.d
)
180 -include $(OBJS_win64
:%.o
=%.d
)
182 # ---------------------------------------------------------------------------------------------------------------------