当前位置:编程学习 > 网站相关 >>

两个Makefile规则

一,

#LIB
all:dir $(TARGET) mv
dir:
  mkdir -p build
$(TARGET):$(OBJS)
  $(CC)  $(CFLAGS) $(H_USER_DEFS) $(H_INCLUDE_PATH) $(H_LIB_PATH) $(H_USER_LIBRARIES) $?  -o $@
.SUFFIXES:.o.cpp   www.zzzyk.com
.cpp.o:
  $(CC) ${CFLAGS} $(H_USER_DEFS) $(H_INCLUDE_PATH) $(H_LIB_PATH) $(H_USER_LIBRARIES) -c $<
mv:
  mv *.o  ./build
  mv $(TARGET) ./build

 

 

#LIB
all:dir $(OBJS) $(TARGET)
dir:
 mkdir -p build
$(OBJS):%.o:%.cpp
 $(CC)  $(CFLAGS) $(H_USER_DEFS) $(H_INCLUDE_PATH) $(H_LIB_PATH) $(H_USER_LIBRARIES) -c $?  -o $@
$(TARGET):$(OBJS)
 $(CC)  $(CFLAGS) $(H_USER_DEFS) $(H_INCLUDE_PATH) $(H_LIB_PATH) $(H_USER_LIBRARIES) $?  -o $@

补充:综合编程 , 其他综合 ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,