CC = gcc CXX = g++ TARGET = process INSTALLDIR = ~/work/ COMMON_PATH := /home/shengkaishan/tmp INCLUDES := -I$(COMMON_PATH)/libev/include -I./ LIBS := -L$(COMMON_PATH)/libev/lib -lev -lrt -lpthread CFLAGS = CPPFLAGS := -g -std=c++11 CPPFLAGS += #add macro #CPPFLAGS += -D __linux__ ## SRCDIRS := . SRCEXTS := .cpp C_SOURCES = $(wildcard *.c) C_OBJS = $(patsubst %.c, %.o, $(C_SOURCES)) #CPP_SOURCES = $(wildcard *.cpp) CPP_SOURCES = $(foreach d,$(SRCDIRS),$(wildcard $(addprefix $(d)/*,$(SRCEXTS)))) CPP_OBJS = $(patsubst %.cpp, %.o, $(CPP_SOURCES)) all: $(TARGET) $(TARGET): $(CPP_SOURCES) $(CXX) $(CPPFLAGS) $^ -o $(TARGET) $(INCLUDES) $(LIBS) install: mkdir -p $(INSTALLDIR) cp -f $(TARGET) $(INSTALLDIR) ifneq ($(wildcard *.conf), ) cp -f *.conf $(INSTALLDIR) endif clean: rm -f $(CPP_OBJS) $(C_OBJS) rm -f $(TARGET) rebuild: clean all
时间: 2024-10-12 18:09:46