两个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
.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 $@

你可能感兴趣的:(两个Makefile规则)