Browse Source

Fix, makefile for building&clean is working

tags/1.9.6
falkTX 10 years ago
parent
commit
c778b58c79
4 changed files with 52 additions and 21 deletions
  1. +6
    -3
      Makefile
  2. +2
    -2
      source/bridges-plugin/Makefile
  3. +2
    -2
      source/discovery/Makefile
  4. +42
    -14
      source/interposer/Makefile

+ 6
- 3
Makefile View File

@@ -40,8 +40,7 @@ all: BIN RES UI WIDGETS
# ---------------------------------------------------------------------------------------------------------------------------- # ----------------------------------------------------------------------------------------------------------------------------
# Binaries (native) # Binaries (native)


BIN: backend discovery bridges-plugin bridges-ui plugin theme
# interposer
BIN: backend discovery bridges-plugin bridges-ui interposer plugin theme


# ---------------------------------------------------------------------------------------------------------------------------- # ----------------------------------------------------------------------------------------------------------------------------


@@ -137,8 +136,12 @@ bridges-ui: libs
discovery: libs discovery: libs
@$(MAKE) -C source/discovery @$(MAKE) -C source/discovery


interposer: libs
ifeq ($(LINUX),true)
interposer:
@$(MAKE) -C source/interposer @$(MAKE) -C source/interposer
else
interposer:
endif


plugin: backend bridges-plugin bridges-ui discovery plugin: backend bridges-plugin bridges-ui discovery
@$(MAKE) -C source/plugin @$(MAKE) -C source/plugin


+ 2
- 2
source/bridges-plugin/Makefile View File

@@ -126,8 +126,8 @@ endif


# ---------------------------------------------------------------------------------------------------------------------------- # ----------------------------------------------------------------------------------------------------------------------------


NATIVE_BUILD_FLAGS = ""
NATIVE_LINK_FLAGS = ""
NATIVE_BUILD_FLAGS =
NATIVE_LINK_FLAGS =


ifeq ($(HAVE_FLUIDSYNTH),true) ifeq ($(HAVE_FLUIDSYNTH),true)
NATIVE_BUILD_FLAGS += $(FLUIDSYNTH_FLAGS) NATIVE_BUILD_FLAGS += $(FLUIDSYNTH_FLAGS)


+ 2
- 2
source/discovery/Makefile View File

@@ -44,8 +44,8 @@ endif


# ---------------------------------------------------------------------------------------------------------------------------- # ----------------------------------------------------------------------------------------------------------------------------


NATIVE_BUILD_FLAGS = ""
NATIVE_LINK_FLAGS = ""
NATIVE_BUILD_FLAGS =
NATIVE_LINK_FLAGS =


ifeq ($(HAVE_FLUIDSYNTH),true) ifeq ($(HAVE_FLUIDSYNTH),true)
NATIVE_BUILD_FLAGS += $(FLUIDSYNTH_FLAGS) NATIVE_BUILD_FLAGS += $(FLUIDSYNTH_FLAGS)


+ 42
- 14
source/interposer/Makefile View File

@@ -1,40 +1,68 @@
#!/usr/bin/make -f #!/usr/bin/make -f
# Makefile for carla interposer #
# Makefile for carla-interposer #
# ----------------------------- # # ----------------------------- #
# Created by falkTX # Created by falkTX
# #


CWD=.. CWD=..
include ../Makefile.mk
include $(CWD)/Makefile.mk


# --------------------------------------------------------------
# ----------------------------------------------------------------------------------------------------------------------------

BINDIR := $(CWD)/../bin

ifeq ($(DEBUG),true)
OBJDIR := $(CWD)/../build/interposer/Debug
MODULEDIR := $(CWD)/../build/modules/Debug
else
OBJDIR := $(CWD)/../build/interposer/Release
MODULEDIR := $(CWD)/../build/modules/Release
endif

# ----------------------------------------------------------------------------------------------------------------------------


BUILD_CXX_FLAGS += -I$(CWD)/includes -I$(CWD)/modules -I$(CWD)/utils BUILD_CXX_FLAGS += -I$(CWD)/includes -I$(CWD)/modules -I$(CWD)/utils


# --------------------------------------------------------------
# ----------------------------------------------------------------------------------------------------------------------------

OBJS = $(OBJDIR)/interposer.cpp.o


ifeq ($(LINUX),true) ifeq ($(LINUX),true)
TARGETS = ../../bin/libcarla_interposer.so
TARGETS = $(BINDIR)/libcarla_interposer$(LIB_EXT)
else
TARGETS =
endif endif


# --------------------------------------------------------------
ifeq ($(UNIX),true)
LINK_FLAGS += -ldl
endif

# ----------------------------------------------------------------------------------------------------------------------------


all: $(TARGETS) all: $(TARGETS)


# ----------------------------------------------------------------------------------------------------------------------------

clean: clean:
$(RM) $(TARGETS) *.o
rm -f $(OBJDIR)/*.o $(TARGETS)


debug: debug:
$(MAKE) DEBUG=true $(MAKE) DEBUG=true


# --------------------------------------------------------------
# ----------------------------------------------------------------------------------------------------------------------------

$(BINDIR)/libcarla_interposer$(LIB_EXT): $(OBJS)
-@mkdir -p $(BINDIR)
@echo "Linking libcarla_interposer$(LIB_EXT)"
@$(CXX) $< $(SHARED) $(LINK_FLAGS) -o $@


interposer.cpp.o: interposer.cpp
$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
# ----------------------------------------------------------------------------------------------------------------------------


# --------------------------------------------------------------
$(OBJDIR)/%.cpp.o: %.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling $<"
@$(CXX) $< $(BUILD_CXX_FLAGS) -MMD -c -o $@


../../bin/libcarla_interposer.so: interposer.cpp.o
$(CXX) $< $(SHARED) $(LINK_FLAGS) -ldl -o $@
-include $(OBJS:%.o=%.d)


# --------------------------------------------------------------
# ----------------------------------------------------------------------------------------------------------------------------

Loading…
Cancel
Save