关于RoboCup2D Agent2D底层makefile文件简化重写

 
      >: 版本1.0,不是很完美,有写小问题、、、
        >: 将整个工程划分为几部分:player( 关于player的编译链接生成binary)、coach( 关于coach的编译链接生成binary )、trainer( 关于trainer的编译链接生成binary)、binary( 放可执行文件及脚本 )、src( 源文件 )、整体的makefile
     
    >: 整体makefile:

#######################################################
          Values
#######################################################

PLAYER  = player
COACH = coach
TRAINER = trainer

########################################################
          Make
########################################################

all: player_  coach_  trainer_     
                                                                             
player_:
      cd${PLAYER}; make -j3 all
     
coach_:
      cd ${COACH};make -j3 all
     
trainer_:
      cd${TRAINER}; make -j3 all


#######################################################
          Clean
######################################################

clean: clean_player clean_coach clean_trainer

.PHONY: clean

clean_player:
      cd${PLAYER}; make clean
     
clean_coach:
      cd ${COACH};make clean
     
clean_trainer:
      cd${TRAINER}; make clean
     
       
        >:player中的makefile

-include ../makefile.init

RM := rm -rf


-includesources.mk     
-include src/subdir.mk
-include objects.mk


ifneq($(MAKECMDGOALS),clean)            # if输入的命令不是make clean

ifneq ($(strip$(C++_DEPS)),)                        # if$(C++_DEPS) 不是空值
-include$(C++_DEPS)                                    # 那么就自动包含$(C++_DEPS)
endif                                                                 

ifneq ($(strip$(C_DEPS)),)                              # 否则if$(C_DEPS)不是空值
-include$(C_DEPS)                                          #就自动包含$(C_DEPS)
endif

ifneq ($(strip$(CC_DEPS)),)                        #下面都是对于其他的判断、、、
-include $(CC_DEPS)
endif

ifneq ($(strip$(CPP_DEPS)),)                        #src/subdir.mk里面有定义
-include$(CPP_DEPS)                                    #就是所有的.d文件
endif

ifneq ($(strip $(CXX_DEPS)),)
-include $(CXX_DEPS)
endif

ifneq ($(strip $(C_UPPER_DEPS)),)
-include $(C_UPPER_DEPS)
endif

endif
#################################

-include ../makefile.defs

all:      YuShanBASE

YuShanBASE: $(OBJS) $(USER_OBJS)
      #g++ -o"YuShanBASE" $(OBJS) $(USER_OBJS) $(LIBS)
      g++ -W -Wall-g -O2  -L/usr/lib64 -o "YuShanBASE" $(OBJS)$(LIBS)


clean:
      -$(RM)$(OBJS)$(C++_DEPS)$(C_DEPS)$(CC_DEPS)$(CPP_DEPS)$(EXECUTABLES)$(CXX_DEPS)$(C_UPPER_DEPS)YuShanBASE
      -@echo ''
     
.PHONY: all clean dependents
.SECONDARY:

-include ../makefile.targets


          >:coach中的makefile

-include ../makefile.init

RM := rm -rf


-includesources.mk     
-include src/subdir.mk
-include libs.mk


ifneq($(MAKECMDGOALS),clean)            # if输入的命令不是make clean

ifneq ($(strip$(C++_DEPS)),)                        # if$(C++_DEPS) 不是空值
-include$(C++_DEPS)                                    # 那么就自动包含$(C++_DEPS)
endif                                                                 

ifneq ($(strip$(C_DEPS)),)                              # 否则if$(C_DEPS)不是空值
-include$(C_DEPS)                                          #就自动包含$(C_DEPS)
endif

ifneq ($(strip$(CC_DEPS)),)                        #下面都是对于其他的判断、、、
-include $(CC_DEPS)
endif

ifneq ($(strip$(CPP_DEPS)),)                        #src/subdir.mk里面有定义
-include$(CPP_DEPS)                                    #就是所有的.d文件
endif

ifneq ($(strip $(CXX_DEPS)),)
-include $(CXX_DEPS)
endif

ifneq ($(strip $(C_UPPER_DEPS)),)
-include $(C_UPPER_DEPS)
endif

endif
#################################

-include ../makefile.defs

all:      YuShanBASE_coach

YuShanBASE_coach: $(OBJS) $(USER_OBJS)
      g++ -W -Wall-g -O2  -L/usr/lib64 -o "YuShanBASE_coach" $(OBJS)$(LIBS)


clean:
      -$(RM)$(OBJS)$(C++_DEPS)$(C_DEPS)$(CC_DEPS)$(CPP_DEPS)$(EXECUTABLES)$(CXX_DEPS)$(C_UPPER_DEPS)YuShanBASE_coach
      -@echo ''
     
.PHONY: all clean dependents
.SECONDARY:

-include ../makefile.targets

            >:trainer的makefile

-include ../makefile.init

RM := rm -rf


-includesources.mk     
-include src/subdir.mk
-include libs.mk


ifneq($(MAKECMDGOALS),clean)            # if输入的命令不是make clean

ifneq ($(strip$(C++_DEPS)),)                        # if$(C++_DEPS) 不是空值
-include$(C++_DEPS)                                    # 那么就自动包含$(C++_DEPS)
endif                                                                 

ifneq ($(strip$(C_DEPS)),)                              # 否则if$(C_DEPS)不是空值
-include$(C_DEPS)                                          #就自动包含$(C_DEPS)
endif

ifneq ($(strip$(CC_DEPS)),)                        #下面都是对于其他的判断、、、
-include $(CC_DEPS)
endif

ifneq ($(strip$(CPP_DEPS)),)                        #src/subdir.mk里面有定义
-include$(CPP_DEPS)                                    #就是所有的.d文件
endif

ifneq ($(strip $(CXX_DEPS)),)
-include $(CXX_DEPS)
endif

ifneq ($(strip $(C_UPPER_DEPS)),)
-include $(C_UPPER_DEPS)
endif

endif
#################################

-include ../makefile.defs

all:      YuShanBASE_trainer

YuShanBASE_trainer: $(OBJS) $(USER_OBJS)
      g++ -W -Wall-g -O2  -L/usr/lib64 -o "YuShanBASE_trainer"$(OBJS) $(LIBS)


clean:
      -$(RM)            $(OBJS)$(C++_DEPS)$(C_DEPS)$(CC_DEPS)$(CPP_DEPS)$(EXECUTABLES)$(CXX_DEPS)$(C_UPPER_DEPS)YuShanBASE_trainer
      -@echo ''
     
.PHONY: all clean dependents
.SECONDARY:

-include ../makefile.targets

参考科大蓝鹰
特别感谢!

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值