From 39e27a03dd8914cd89e678b7793021d04d5e482f Mon Sep 17 00:00:00 2001 From: Emil Williams Date: Fri, 19 Jan 2024 21:04:32 +0000 Subject: [PATCH] add config.h --- bake.c | 24 +++--------------------- config.h | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+), 21 deletions(-) create mode 100644 config.h diff --git a/bake.c b/bake.c index 91ae59c..0eda86a 100644 --- a/bake.c +++ b/bake.c @@ -3,7 +3,7 @@ * * Licensed under the GNU Public License version 3 only, see LICENSE. * - * @BAKE cc -std=c89 -O2 $@ -o $* $+ # @STOP + * @BAKE cc -std=c89 -O2 -I. $@ -o $* $+ # @STOP */ #define _POSIX_C_SOURCE 200809L @@ -22,29 +22,11 @@ #include #include -/* Require space after START */ -#define REQUIRE_SPACE -/* Enable colors */ -#define COLOR - -#ifdef COLOR -#define RED "\e[91m" -#define GREEN "\e[92m" -#define YELLOW "\e[93m" -#define DIM "\e[2m" -#define BOLD "\e[1m" -#define RESET "\e[0m" -#else -#define RED -#define GREEN -#define YELLOW -#define DIM -#define BOLD -#define RESET -#endif +#include "config.h" #define START "@BAKE" #define STOP "@STOP" + #define HELP \ BOLD "target-file" RESET " [arguments ...]\n" \ "Use the format `" BOLD "@BAKE" RESET " cmd ...' within the target-file, this will execute the\n" \ diff --git a/config.h b/config.h new file mode 100644 index 0000000..ac0d3fb --- /dev/null +++ b/config.h @@ -0,0 +1,20 @@ +/* Require space after START */ +#define REQUIRE_SPACE + +#define ENABLE_COLOR + +#ifdef ENABLE_COLOR +# define RED "\e[91m" +# define GREEN "\e[92m" +# define YELLOW "\e[93m" +# define DIM "\e[2m" +# define BOLD "\e[1m" +# define RESET "\e[0m" +#else +# define RED +# define GREEN +# define YELLOW +# define DIM +# define BOLD +# define RESET +#endif