0 Star 3 Fork 5

linxyruffy / ft_event

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
makefile 709 Bytes
一键复制 编辑 Web IDE 原始数据 按行查看 历史
linxyruffy 提交于 2017-01-23 18:09 . add main.c
CC := gcc
CXX := g++
BASEDIR = $(shell pwd)
MAXDEPTH = 1
#list all source files include *.cpp *.cc *.c
ALL_SRC := $(shell find -E $(BASEDIR) -maxdepth $(MAXDEPTH) -regex ".*\.(cpp|c|cc)")
#replace *.cpp -> *.o, *.c -> *.o *.cc -> *.o
OBJS := $(patsubst %.c,%.o,$(ALL_SRC))
OBJS += $(patsubst %.cpp,%.o,$(ALL_SRC))
OBJS += $(patsubst %.cc,%.o,$(ALL_SRC))
#filter all *.o
OBJS := $(filter %.o, $(OBJS))
CFLAGS=-m64 -Wall -g -fPIC
INC := -I $(BASEDIR)
TARGET=test
$(TARGET): $(OBJS)
$(CXX) -o $@ $(INC) $(CFLAGS) $^
%.o: %.cpp
$(CXX) $(CFLAGS) $(INC) -c -o $@ $<
%.o: %.c
$(CC) $(CFLAGS) $(INC) -c -o $@ $<
%.o: %.cc
$(CC) $(CFLAGS) $(INC) -c -o $@ $<
clean:
rm -f $(OBJS)
rm -f $(TARGET)
C
1
https://gitee.com/linxyruffy/ft_event.git
git@gitee.com:linxyruffy/ft_event.git
linxyruffy
ft_event
ft_event
master

搜索帮助

14c37bed 8189591 565d56ea 8189591