Files
crc/unit-test/Makefile
T
YaofuandGitHub ac358396a2 bugfix: build err for gcc with high version
error: expected '(' for function-style cast or type construction
2024-08-09 16:10:12 +08:00

51 lines
1.0 KiB
Makefile

PROJECT = unittest
CXX=gcc -g -std=c++11
CC=gcc -g
SHARED_FLAG = -fPIC -shared
SRCS = .
SRCS += ./ut
SRCS += ../crc
LIB = -lstdc++ -lpthread
INC = -I.
INC += -I..
OBJDIR = ./obj/
CPP_SRCS = $(foreach d,$(SRCS),$(wildcard $(d)/*.cpp))
C_SRCS = $(foreach d,$(SRCS),$(wildcard $(d)/*.c))
CPP_OBJS = $(patsubst %.cpp, %.o, $(CPP_SRCS))
C_OBJS = $(patsubst %.c, %.o, $(C_SRCS))
OBJS = $(CPP_OBJS)
OBJS += $(C_OBJS)
all : $(PROJECT)
$(PROJECT) : $(OBJS) $(MODULE)
$(CC) -o $@ $(OBJS) $(LIB)
@echo ""
@echo "+--------------------------------------------+"
@echo "| Finish compilation unittest |"
@echo "+--------------------------------------------+"
@echo "| copyright(c)Wang Yaofu voipman@qq.com |"
@echo "+--------------------------------------------+"
clean:
rm -rf *.o *.a *_unittest ../crc/*.o ut/test_harness.o
install :
test -d ../test || mkdir -p ../test
cp unittest ../test
%.o : %.cpp
$(CXX) $(INC) -c $< -o $@
%.o : %.c
$(CC) $(INC) -c $< -o $@
%.o : %.cc
$(CC) $(INC) -c $< -o $@