# Instructions to the compiler and options
CC = g++
RM = rm
CFLAGS = -Wall
# Macro definition
DEFS = -D OS_UNIX
CFLAGS += $(DEFS)
# The target file
TARGET = a.out
# The source file
SRCS = test.cpp
# The header file search path
INC = -I./
# Dependent libraries,Select library file According to the operating system you using
LIBS = -L./lib -l*libraryname* -lpthread
# The target file
OBJS = $(SRCS:.cpp=.o)
# Link for the executable file
$(TARGET):$(OBJS)
$(CC) -o $@ $^ $(LIBS)
clean:
$(RM) -rf $(TARGET) $(OBJS) *~
%.o:%.cpp
$(CC) $(CFLAGS) $(INC) -o $@ -c $<
makefile_base_one
最新推荐文章于 2022-03-27 21:05:03 发布