• XXX


    #=========================================================================
    #
    #    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
    #--------------------------------------------
    
    
    #----------- COMPILING INFOMATION-------------
    CC     = gcc
    EXE     = ROCKY
    CDUBG     =
    CFLAGS    = -Wall -g -o
    # CFLAS    = -Wall -Wextra -O2 
    LIBS    =
    ALLFILES= $(wildcard $(LSRC)/*.c)
    
    # OBJS
    OBJS = $(ALLFILES:%.c=%.o)
    
    #----------------------------------------------
    
    
    #PHONY 
    all:    dirs $(EXE) info
    
    info:
        -@echo $(EXE) $(VERSION) IS BUILDING...
    
    ${EXE}: $(OBJS)
        $(CC) $(CFLAGS) $@ $(OBJS)        
        
    dirs:
        -@mkdir -p $(LBIN) $(LOBJ) 
    
    clean:
        -@rm $(PACKAGE)
        -@rm -rf $(LBIN) $(LOBJ)
        -@rm  $(LSRC)/*.o
    
    
    $(OBJS):%.o:%.c
        $(CC) -c $< -o $@
    
    .PHONY:    clean  
    View Code
    /*========================================================================
    
        
    
    *========================================================================*/
    
    #include <getopt.h>
    #include <stdio.h>
    #include <stdlib.h>
    #include "argument.h"
    
    void args_handle(int argc, char* argv[])
    {
    
        static struct option rocky_opt[]={
            {"help",    no_argument,    NULL,    'h'},
            {"license",    no_argument,    NULL,    'l'}
        };
    
        int option_index=0;
        int c=0;    
    
        while(c!= EOF)
        {
            c = getopt_long(argc, argv, "hl", rocky_opt, &option_index);
            switch(c)
            {
                case 'h':
                    printf("help info");
                    exit(EXIT_SUCCESS);
                break;
                case 'l':
                    printf("liecense info");
                    exit(EXIT_SUCCESS);
                break;
                default:
                    printf("default");
                    exit(EXIT_SUCCESS);
                break;
            }
        }
        
    }
    View Code
  • 相关阅读:
    boost::asio发送与传输相关的几个函数,备忘
    当ASIO::ASYNC_READ与SOCKET的ASYNC_READ_SOME的区别
    boost::asio keepalive
    boost asio ——深入框架
    Boost.Asio和ACE之间关于Socket编程的比较
    OCP-1Z0-052-V8.02-15题
    JavaScript对象和数组
    Oracle 11g New 使用RMAN 增强功能
    Flex中集合的类型
    Flex中基于列表的一系列MX组件及相互关系
  • 原文地址:https://www.cnblogs.com/unixshell/p/3337161.html
Copyright © 2020-2023  润新知