2020-07-31 16:14:12 +00:00
|
|
|
include ../../../common/unix.mk
|
|
|
|
|
2018-03-10 00:29:27 +00:00
|
|
|
CFLAGS +=
|
2018-05-07 23:21:19 +00:00
|
|
|
CXXFLAGS := $(CFLAGS) -std=gnu++17
|
2018-03-18 12:00:11 +00:00
|
|
|
DEFINES += -DTRACY_NO_STATISTICS
|
2020-06-19 18:07:06 +00:00
|
|
|
INCLUDES := $(shell pkg-config --cflags capstone)
|
2020-07-31 16:14:12 +00:00
|
|
|
LIBS += $(shell pkg-config --libs capstone) -lpthread
|
2018-06-27 18:31:17 +00:00
|
|
|
PROJECT := capture
|
|
|
|
IMAGE := $(PROJECT)-$(BUILD)
|
2018-03-10 00:29:27 +00:00
|
|
|
|
|
|
|
FILTER :=
|
|
|
|
|
2018-06-27 18:31:17 +00:00
|
|
|
BASE := $(shell egrep 'ClCompile.*cpp"' ../win32/$(PROJECT).vcxproj | sed -e 's/.*\"\(.*\)\".*/\1/' | sed -e 's@\\@/@g')
|
|
|
|
BASE2 := $(shell egrep 'ClCompile.*c"' ../win32/$(PROJECT).vcxproj | sed -e 's/.*\"\(.*\)\".*/\1/' | sed -e 's@\\@/@g')
|
2018-03-10 00:29:27 +00:00
|
|
|
|
|
|
|
SRC := $(filter-out $(FILTER),$(BASE))
|
|
|
|
SRC2 := $(filter-out $(FILTER),$(BASE2))
|
|
|
|
|
2018-06-27 18:31:17 +00:00
|
|
|
OBJDIRBASE := obj/$(BUILD)
|
|
|
|
OBJDIR := $(OBJDIRBASE)/o/o/o
|
|
|
|
|
|
|
|
OBJ := $(addprefix $(OBJDIR)/,$(SRC:%.cpp=%.o))
|
|
|
|
OBJ2 := $(addprefix $(OBJDIR)/,$(SRC2:%.c=%.o))
|
2018-03-10 00:29:27 +00:00
|
|
|
|
|
|
|
all: $(IMAGE)
|
|
|
|
|
2018-06-27 18:31:17 +00:00
|
|
|
$(OBJDIR)/%.o: %.cpp
|
2018-03-10 00:29:27 +00:00
|
|
|
$(CXX) -c $(INCLUDES) $(CXXFLAGS) $(DEFINES) $< -o $@
|
|
|
|
|
2018-06-27 18:31:17 +00:00
|
|
|
$(OBJDIR)/%.d : %.cpp
|
2018-03-10 00:29:27 +00:00
|
|
|
@echo Resolving dependencies of $<
|
|
|
|
@mkdir -p $(@D)
|
|
|
|
@$(CXX) -MM $(INCLUDES) $(CXXFLAGS) $(DEFINES) $< > $@.$$$$; \
|
2018-06-27 18:31:17 +00:00
|
|
|
sed 's,.*\.o[ :]*,$(OBJDIR)/$(<:.cpp=.o) $@ : ,g' < $@.$$$$ > $@; \
|
2018-03-10 00:29:27 +00:00
|
|
|
rm -f $@.$$$$
|
|
|
|
|
2018-06-27 18:31:17 +00:00
|
|
|
$(OBJDIR)/%.o: %.c
|
2018-03-10 00:29:27 +00:00
|
|
|
$(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
|
|
|
|
|
2018-06-27 18:31:17 +00:00
|
|
|
$(OBJDIR)/%.d : %.c
|
2018-03-10 00:29:27 +00:00
|
|
|
@echo Resolving dependencies of $<
|
|
|
|
@mkdir -p $(@D)
|
|
|
|
@$(CC) -MM $(INCLUDES) $(CFLAGS) $(DEFINES) $< > $@.$$$$; \
|
2018-06-27 18:31:17 +00:00
|
|
|
sed 's,.*\.o[ :]*,$(OBJDIR)/$(<:.c=.o) $@ : ,g' < $@.$$$$ > $@; \
|
2018-03-10 00:29:27 +00:00
|
|
|
rm -f $@.$$$$
|
|
|
|
|
|
|
|
$(IMAGE): $(OBJ) $(OBJ2)
|
|
|
|
$(CXX) $(CXXFLAGS) $(DEFINES) $(OBJ) $(OBJ2) $(LIBS) -o $@
|
|
|
|
|
|
|
|
ifneq "$(MAKECMDGOALS)" "clean"
|
2020-02-08 19:03:38 +00:00
|
|
|
-include $(addprefix $(OBJDIR)/,$(SRC:.cpp=.d)) $(addprefix $(OBJDIR)/,$(SRC2:.c=.d))
|
2018-03-10 00:29:27 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
clean:
|
2018-06-27 18:31:17 +00:00
|
|
|
rm -rf $(OBJDIRBASE) $(IMAGE)*
|
2018-03-10 00:29:27 +00:00
|
|
|
|
|
|
|
.PHONY: clean all
|