diff --git a/.gitignore b/.gitignore index b00ed42..ba93b02 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ *.tar.xz src/*.o src/tio +src/tionc Makefile.in Makefile aclocal.m4 @@ -22,3 +23,4 @@ src/include/stamp-h1 *.swp /tio-* /src/bash-completion/tio +\#* diff --git a/src/Makefile.am b/src/Makefile.am index 046c599..1e76394 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,6 +1,6 @@ AM_CPPFLAGS = -I$(srcdir)/include AM_CFLAGS = -Wall -bin_PROGRAMS = tio +bin_PROGRAMS = tio tionc tio_SOURCES = tty.c \ options.c \ time.c \ @@ -14,8 +14,24 @@ tio_SOURCES = tty.c \ include/tio/log.h \ include/tio/error.h +tionc_SOURCES = tty.c \ + options.c \ + time.c \ + main.c \ + log.c \ + error.c \ + include/tio/tty.h \ + include/tio/options.h \ + include/tio/time.h \ + include/tio/print.h \ + include/tio/log.h \ + include/tio/error.h + +tionc_CFLAGS = -D TIO_NOCOLOR + if ADD_SETSPEED2 tio_SOURCES += setspeed2.c +tionc_SOURCES += setspeed2.c endif if ENABLE_BASH_COMPLETION diff --git a/src/include/tio/print.h b/src/include/tio/print.h index 99729e7..5177d32 100644 --- a/src/include/tio/print.h +++ b/src/include/tio/print.h @@ -22,6 +22,17 @@ #ifndef PRINT_H #define PRINT_H +#ifdef TIO_NOCOLOR +#define ANSI_COLOR_GRAY "" +#define ANSI_COLOR_RED "" +#define ANSI_COLOR_GREEN "" +#define ANSI_COLOR_YELLOW "" +#define ANSI_COLOR_BLUE "" +#define ANSI_COLOR_PINK "" +#define ANSI_COLOR_CYAN "" +#define ANSI_COLOR_WHITE "" +#define ANSI_COLOR_RESET "" +#else #define ANSI_COLOR_GRAY "\x1b[1;30m" #define ANSI_COLOR_RED "\x1b[1;31m" #define ANSI_COLOR_GREEN "\x1b[1;32m" @@ -31,6 +42,7 @@ #define ANSI_COLOR_CYAN "\x1b[1;36m" #define ANSI_COLOR_WHITE "\x1b[1;37m" #define ANSI_COLOR_RESET "\x1b[0m" +#endif #define color_printf(format, args...) \ { \