# 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 *.cpp) OBJS := $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(SOURCE)))
# Target you can change test to what you want. TARGET := demo
# Compile and lib parameter. CC := gcc LIBS := -lpthread -lm LDFLAGS := DEFINES := # The *.o save in include directory. INCLUDE := -I ./include CFLAGS := -Wall $(DEFINES) $(INCLUDE) CXXFLAGS:= $(CFLAGS) -DHAVE_CONFIG_H