Fix wine build
[carla.git] / source / interposer / Makefile
blobd47d46d0ad61f0237d6e7d683acab2da67b5ea6e
1 #!/usr/bin/make -f
2 # Makefile for carla-interposer #
3 # ----------------------------- #
4 # Created by falkTX
7 CWD=..
8 include $(CWD)/Makefile.mk
10 # ---------------------------------------------------------------------------------------------------------------------
12 BINDIR := $(CWD)/../bin
14 ifeq ($(DEBUG),true)
15 OBJDIR := $(CWD)/../build/interposer/Debug
16 MODULEDIR := $(CWD)/../build/modules/Debug
17 else
18 OBJDIR := $(CWD)/../build/interposer/Release
19 MODULEDIR := $(CWD)/../build/modules/Release
20 endif
22 # ---------------------------------------------------------------------------------------------------------------------
24 BUILD_CXX_FLAGS += -I$(CWD) -I$(CWD)/backend -I$(CWD)/includes -I$(CWD)/modules -I$(CWD)/utils
26 INTERPOSER_SAFE_LIBS = $(LIBDL_LIBS)
27 INTERPOSER_X11_LIBS = $(X11_LIBS) $(LIBDL_LIBS)
29 # ---------------------------------------------------------------------------------------------------------------------
31 OBJS =
32 TARGETS =
34 ifeq ($(LINUX)$(MACOS),true)
35 OBJS += $(OBJDIR)/interposer-safe.cpp.o
36 OBJS += $(OBJDIR)/interposer-jack-x11.cpp.o
37 TARGETS += $(BINDIR)/libcarla_interposer-safe$(LIB_EXT)
38 TARGETS += $(BINDIR)/libcarla_interposer-jack-x11$(LIB_EXT)
40 ifeq ($(HAVE_X11),true)
41 OBJS += $(OBJDIR)/interposer-x11.cpp.o
42 TARGETS += $(BINDIR)/libcarla_interposer-x11$(LIB_EXT)
43 endif
44 endif
46 # ---------------------------------------------------------------------------------------------------------------------
48 all: $(TARGETS)
50 # ---------------------------------------------------------------------------------------------------------------------
52 clean:
53 rm -f $(OBJDIR)/*.o $(TARGETS)
55 debug:
56 $(MAKE) DEBUG=true
58 # ---------------------------------------------------------------------------------------------------------------------
60 $(BINDIR)/libcarla_interposer-safe$(LIB_EXT): $(OBJDIR)/interposer-safe.cpp.o
61 -@mkdir -p $(BINDIR)
62 @echo "Linking libcarla_interposer-safe$(LIB_EXT)"
63 $(SILENT)$(CXX) $< $(SHARED) $(LINK_FLAGS) $(INTERPOSER_SAFE_LIBS) -o $@
65 $(BINDIR)/libcarla_interposer-x11$(LIB_EXT): $(OBJDIR)/interposer-x11.cpp.o
66 -@mkdir -p $(BINDIR)
67 @echo "Linking libcarla_interposer-x11$(LIB_EXT)"
68 $(SILENT)$(CXX) $< $(SHARED) $(LINK_FLAGS) $(INTERPOSER_X11_LIBS) -o $@
70 $(BINDIR)/libcarla_interposer-jack-x11$(LIB_EXT): $(OBJDIR)/interposer-jack-x11.cpp.o
71 -@mkdir -p $(BINDIR)
72 @echo "Linking libcarla_interposer-jack-x11$(LIB_EXT)"
73 $(SILENT)$(CXX) $< $(SHARED) $(LINK_FLAGS) $(INTERPOSER_X11_LIBS) -o $@
75 # ---------------------------------------------------------------------------------------------------------------------
77 $(OBJDIR)/interposer-safe.cpp.o: interposer-safe.cpp
78 -@mkdir -p $(OBJDIR)
79 @echo "Compiling $<"
80 $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
82 $(OBJDIR)/interposer-x11.cpp.o: interposer-x11.cpp
83 -@mkdir -p $(OBJDIR)
84 @echo "Compiling $<"
85 $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(X11_FLAGS) -c -o $@
87 $(OBJDIR)/interposer-jack-x11.cpp.o: interposer-jack-x11.cpp
88 -@mkdir -p $(OBJDIR)
89 @echo "Compiling $<"
90 $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(X11_FLAGS) -c -o $@
92 # ---------------------------------------------------------------------------------------------------------------------
94 -include $(OBJS:%.o=%.d)
96 # ---------------------------------------------------------------------------------------------------------------------