Giter VIP home page Giter VIP logo

color-compile's Introduction

color-compile

Show compile message with color when show up error/warning/note using gcc/g++/make

(1) compile ("\make" means using system make, not alias)

$ \make

(2) install (need root permission)

$ \make install

// copy exec program to /usr/local/bin/

// alias gcc/g++/make in corresponding shell config file (like ~/.bashrc)

(3) test

// open a new terminal

$ make TEST (== gcc test.c -Wall)

Note:

(1) If your gcc version >= 4.9.0, you can use -fdiagnostics-color=auto argument to show compiling color(It's similar to color-compile).

(2) If you want to uninstall or reinstall, please remove alias added in ~/.bashrc at the end of line manually.

(3) If you want to add new compile tool, you can add it at Makefile, like echo 'alias arm-linux-gcc="color_compile arm-linux-gcc"' >> $(ALIAS_FILE) or change ~/.bashrc directly.

(4) If you want to change the color of color-compile showed, you can change out_color_info.c, there are some macro define color.

result:

before using color-compile before using color-compile

after using color-compile after using color-compile

Author: Alan Wang [email protected]

Started: Dec. 20, 2014

Licence: Apache Licene 2.0

中文说明:

(1) 编译 (进到项目根目录,"\make" 是使用系统make,而不是alias别名)

$ \make

(2) 安装 (需要超级权限)

$ \make install

(这一步做了两件事,一是把主程序拷贝到 /usr/local/bin/ 下,二是添加了 gcc/g++/make 的别名到对应的 shell 配置文件的末尾,例如 ~/.bashrc)

(3) 测试 (新打开一个终端)

$ make TEST  (== gcc test.c -Wall)

注意事项:

(1) 如果你的 gcc 版本 >= 4.9.0,可以直接使用 -fdiagnostics-color=auto 参数,显示效果和 color-compile 类似

(2) 如果你需要卸载或者重装,请删除 ~/.bashrc 末尾处的gcc/g++/make 别名,以免影响之后的使用。

(3) 如果你需要添加新的编译工具,可以修改Makefile 的 install: 处,以 arm-linux-gcc 为例,echo 'alias arm-linux-gcc="color_compile arm-linux-gcc"' >> $(ALIAS_FILE),或者直接修改 ~/.bashrc 都行。

(4) 如果你需要更改显示的颜色,直接修改 out_color_info.c 源码就行,其中有一些颜色定义的宏。

color-compile's People

Contributors

chinaran avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.