1 ################################################################ 2 # File Name : Makefile 3 # Author : skytrails 4 # Email : [email protected] 5 # Create Time : 2015-09-14 21:58 6 ################################################################ 7 8 CC = g++ 9 RM = rm -f 10 TARGET=appstart.1.0 11 CFLAGS = -O2 -Isrc 12 export OBJSDIR=$(shell pwd)/objs 13 DIRS = src/deamon 14 DIRS += src/ark 15 FILES = $(foreach dir, $(DIRS), $(wildcard $(dir)/*.cpp $(dir)/*.c)) 16 OBJS = $(patsubst src%, objs%, $(patsubst %.cpp, %.o, $(patsubst %.c, %.cpp, $(FILES)))) 17 OBJSDIRS = $(patsubst src%, objs%, $(DIRS)) 18 ALL:$(OBJS) 19 20 $(OBJS):objs/%.o:src/%.cpp 21 mkdir -p $(OBJSDIRS) 22 @echo "OBJSDIRS:"$(OBJSDIRS) 23 @echo "OBJS:"$(OBJS) 24 @echo "FILES:"$(FILES) 25 @echo "$\<:"$< 26 @echo "$\*:"$* 27 $(CC) -c $< -o [email protected] $(CFLAGS) 28 @echo "make:\n" 29 30 run: 31 @echo $(FILES) 32 @echo $(OBJS) 33 @echo [email protected] 34 mkdir -p $(OBJSDIRS) 35 clean: 36 -$(RM) $(OBJS) 37 touch: 38 touch src/ark/als.cpp
时间: 2024-09-28 22:07:46