zoukankan      html  css  js  c++  java
  • 测试工程编译脚本编写

    1.编写Makefile主文件
    #project include config #
    include Makefile.common.variables

    LINKING=$(CC) $(CFLAGS) $(LIBS) -lpthread -o $@ $(notdir $^) -L../lib/ -lpcre
    VPATH = ../
    INCLUDES= -I../ -I../include

    DEFS = -DNO_SOUND -DNO_ACC_BACKUP -DISDTLIB
    LIBS = -L../lib

    CFLAGS = $(CFLAGS1) $(DEFS) $(INCLUDES)

    # here list all the source files
    SOURCES = mynet.cpp
    TEST_SOURCES = server.cpp

    OBJECT = $(SOURCES:%.cpp=%.o)
    ALL_OBJS = $(notdir $(OBJECT))
    TEST_OBJS = server.o


    # here list all the target binary files
    build:testServer

    # here list all the linking dependencies
    testServer: $(OBJECT) $(TEST_OBJS)
    $(LINKING)

    clean: ; rm -f *.o testServer
    -include Makefile.dep

    .PHONY : clean all dep
    %.o:%.cpp
    @echo Compile c++ file $<, `more $<|wc -l` lines ....
    $(CC) -c $(CFLAGS) $<
    %.o:%.c
    @echo Compile c file $<, `more $<|wc -l` lines ....
    $(CC) -c $(CFLAGS) $<

    2.编写include文件Makefile.common.variable

    #CFLAGS1 = -g -Wall -Wno-deprecated
    #CFLAGS1 = -O2 -Wall -Wno-deprecated -fPIC
    CFLAGS1 = -std=c++11 -O2 -g -Wall -Wno-deprecated -fPIC
    CFLAGS1 += -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES
    CXXFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES
    #CFLAGS1 = -O2 -Wall -Wno-deprecated -fPIC
    #CC = gcc
    CC = g++

    IPPROUT = ./lib

    3.在安装GCC的linux机器上编译

    make

  • 相关阅读:
    ASP.NET WebApi 中使用swagger 构建在线帮助文档
    TortoiseSVN 分支创建与合并
    C# 图片处理
    使用Vue构建单页应用一
    使用nuget 打包并上传 nuget.org
    SignalR 教程二 服务端广播
    SignalR 教程一
    Visual Studio 中常用的快捷键
    EF for Mysql
    Advanced Plugin Concepts
  • 原文地址:https://www.cnblogs.com/cyblogs/p/12189125.html
Copyright © 2011-2022 走看看