| TARGET = high_freq_sensor_tool_c_wrapper |
| CFLAGS += -Wall -O2 -std=c++11 -pthread |
| |
| INCLUDES := ./ |
| |
| C_FILES := main.c |
| LIBFLAGS := -llog -lhfmanager |
| |
| C_FILES := $(patsubst ./%,%,$(C_FILES)) |
| C_OBJS := $(sort $(C_FILES:%.c=%.o)) |
| |
| CPP_FILES := $(patsubst ./%,%,$(CPP_FILES)) |
| CPP_OBJS := $(sort $(CPP_FILES:%.cpp=%.o)) |
| |
| TMP_OBJS += $(CPP_OBJS) |
| TMP_OBJS += $(C_OBJS) |
| OBJS += $(sort $(TMP_OBJS)) |
| |
| INCLUDES := $(patsubst %,-I%,$(patsubst -I%,%,$(INCLUDES))) |
| |
| ${TARGET}: ${OBJS} |
| ${CXX} ${CFLAGS} ${LDFLAGS} ${INCLUDES} -o $@ $^ -Wl,--start-group ${LIBFLAGS} -Wl,--end-group |
| ${CPP_OBJS}: %.o: %.cpp |
| @mkdir -p $(dir $@) |
| ${CXX} ${CFLAGS} ${LDFLAGS} ${INCLUDES} -c $^ -o $@ |
| ${C_OBJS}: %.o: %.c |
| @mkdir -p $(dir $@) |
| ${CXX} ${CFLAGS} ${LDFLAGS} ${INCLUDES} -c $^ -o $@ |
| |
| .PHONY: clean |
| clean: |
| @rm -rf ${TARGET} ${OBJS} |
| @echo Clean done |