# Source file. # Automatically finds all.c and.cpp files and defines the target as a.o file with the same name. # The *.c save in src directory. SOURCE := $(wildcard ./src/*.c)$(wildcard ./src/*.cpp) OBJS := $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(SOURCE)))
# Target you can change test to what you want. TARGET := demo
# Compile and lib parameter. # Build c project . # CC := gcc # Build c++ project. CC := g++ LIBS := -lpthread -lm LDFLAGS := DEFINES := # The *.o save in include directory. INCLUDE := -I ./include CFLAGS := -Wall $(DEFINES)$(INCLUDE) -std=c++11 CXXFLAGS:= $(CFLAGS) -DHAVE_CONFIG_H