• 写的一个Makefile


    #=========================================================================
    #
    #       MAKE FILE FOR ROCKY
    #
    #
    #=========================================================================
    SHELL   = /usr/bin/sh
    VERSION = 0.1
    DATE    = `date '+%Y-%m-%d'`
    PACKAGE = ROCKY
    
    #---------------PATH INFO--------------------
    LBIN = bin
    LOBJ = obj
    LSRC = src
    LCLIENT = client
    #--------------------------------------------
    
    
    #----------- COMPILING INFOMATION-------------
    CC      = gcc
    EXE     = ROCKY
    CLIENT  = CLIENT_ROCKY
    CDUBG   =
    CFLAGS  = -Wall -g -o
    # CFLAS = -Wall -Wextra -O2 
    LIBS    = -lncurses -pthread
    
    ALLFILES= $(wildcard $(LSRC)/*.c)
    CLIENT_FILES=$(wildcard $(LCLIENT)/*.c)
    DAEMON  = ROCKY_DAEMON
    # OBJS
    OBJS = $(ALLFILES:%.c=%.o)
    CLIENT_OBJS = $(CLIENT_FILES:%.c=%.o)
    
    #----------------------------------------------
    
    
    #PHONY 
    all:    info dirs $(EXE) $(CLIENT)
    
    info:
            -@echo $(EXE) $(VERSION) IS BUILDING...
    
    ${EXE}: $(OBJS)
            $(CC) $(CFLAGS) $@ $(OBJS) $(LIBS)
    
    $(DAEMON):
            $(CC) $(CFLAGS) $@      
    
    dirs:
            -@mkdir -p $(LBIN) $(LOBJ) 
    
    $(CLIENT):$(CLIENT_OBJS)
            $(CC) $(CFLAGS) $@ $(CLIENT_OBJS)
    
    mv2dir:
            -@mv $(EXE) $(LBIN)
            -@mv $(CLIENT) $(LBIN)
    clean:
            -@rm $(PACKAGE)
            -@rm -rf $(LBIN) $(LOBJ)
            -@rm  $(LSRC)/*.o
            -@rm  $(LCIENT)/*.o
            -@rm $(CLIENT)
    
    
    
    #---objs---
    
    $(OBJS):%.o:%.c
            $(CC) -c $< -o $@
    
    $(CLIENT_OBJS):%.o:%.c
            $(CC) -c $< -o $@
    
    .PHONY: clean
  • 相关阅读:
    SQL ——索引、视图和事务
    流控制语句
    SQL Server 高级编程之T-SQL 编程函数
    SQL高级编程之waitfor
    数据库主键、外键、唯一等约束
    打代码会遇到的单词
    前端词云图
    docker+mysql集群+读写分离+mycat管理+垂直分库+负载均衡
    lvs+keepalived实现Mycat的负载均衡--高可用
    mycat配置数据库集群
  • 原文地址:https://www.cnblogs.com/unixshell/p/3498877.html
Copyright © 2020-2023  润新知