add config.h

This commit is contained in:
Emil Williams 2024-01-19 21:04:32 +00:00
parent c9b95a64d2
commit 39e27a03dd
No known key found for this signature in database
GPG Key ID: 5432DB986FDBCF8A
2 changed files with 23 additions and 21 deletions

24
bake.c
View File

@ -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 <sys/stat.h>
#include <unistd.h>
/* 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" \

20
config.h Normal file
View File

@ -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