|
|
@@ -1,40 +1,68 @@ |
|
|
|
#!/usr/bin/make -f |
|
|
|
# Makefile for carla interposer # |
|
|
|
# Makefile for carla-interposer # |
|
|
|
# ----------------------------- # |
|
|
|
# Created by falkTX |
|
|
|
# |
|
|
|
|
|
|
|
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 |
|
|
|
|
|
|
|
# -------------------------------------------------------------- |
|
|
|
# ---------------------------------------------------------------------------------------------------------------------------- |
|
|
|
|
|
|
|
OBJS = $(OBJDIR)/interposer.cpp.o |
|
|
|
|
|
|
|
ifeq ($(LINUX),true) |
|
|
|
TARGETS = ../../bin/libcarla_interposer.so |
|
|
|
TARGETS = $(BINDIR)/libcarla_interposer$(LIB_EXT) |
|
|
|
else |
|
|
|
TARGETS = |
|
|
|
endif |
|
|
|
|
|
|
|
# -------------------------------------------------------------- |
|
|
|
ifeq ($(UNIX),true) |
|
|
|
LINK_FLAGS += -ldl |
|
|
|
endif |
|
|
|
|
|
|
|
# ---------------------------------------------------------------------------------------------------------------------------- |
|
|
|
|
|
|
|
all: $(TARGETS) |
|
|
|
|
|
|
|
# ---------------------------------------------------------------------------------------------------------------------------- |
|
|
|
|
|
|
|
clean: |
|
|
|
$(RM) $(TARGETS) *.o |
|
|
|
rm -f $(OBJDIR)/*.o $(TARGETS) |
|
|
|
|
|
|
|
debug: |
|
|
|
$(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) |
|
|
|
|
|
|
|
# -------------------------------------------------------------- |
|
|
|
# ---------------------------------------------------------------------------------------------------------------------------- |