~aritra1911/ansi_anim

c7a732dd5dc4240ab6f9e6eaa9d95dc909e2b679 — Aritra Sarkar 2 years ago 34548c0
Directory Restructuring
3 files changed, 49 insertions(+), 7 deletions(-)

M Makefile
A lib/inc/ansi/colors.h
R main.c => src/main.c
M Makefile => Makefile +16 -7
@@ 1,17 1,26 @@
CFLAGS = -Wall -Wextra -pedantic -std=c99
CC ?= cc

SRCS = main.c
OBJS = $(SRCS:.c=.o)
INC = -Iinc -Ilib/inc
LIB =

CFLAGS = $(INC) -Wall -Wextra -pedantic -std=c99
CPPFLAGS =
LDFLAGS =

SRCS = src/main.c
OBJS = $(SRCS:src/%.c=obj/%.o)

.PHONY: all clean

all: anim
all: bin/anim

anim: $(OBJS)
bin/anim: $(OBJS)
	@mkdir -p bin
	$(CC) $(LDFLAGS) -o $@ $^

%.o: %.c
obj/%.o: src/%.c
	@mkdir -p obj
	$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<

clean:
	rm -f $(OBJS) anim
	rm -rf obj bin

A lib/inc/ansi/colors.h => lib/inc/ansi/colors.h +33 -0
@@ 0,0 1,33 @@
#ifndef __COLORS_H_
# define __COLORS_H_

# include <stdint.h>

typedef enum : uint32_t {
    BLACK,      /* 0 */
    RED,        /* 1 */
    GREEN,      /* 2 */
    YELLOW,     /* 3 */
    BLUE,       /* 4 */
    MAGENTA,    /* 5 */
    CYAN,       /* 6 */
    WHITE,      /* 7 */
    DEFAULT,    /* 8 */
} color_t;

typedef enum : uint32_t {
    BACKGROUND      = ( 1 << 0 ),
    BRIGHT          = ( 1 << 1 ),
    FAINT           = ( 1 << 2 ),
    BOLD            = ( 1 << 3 ),
    ITALIC          = ( 1 << 4 ),
    UNDERLINE       = ( 1 << 5 ),
    STRIKETHROUGH   = ( 1 << 6 ),
    BLINKING        = ( 1 << 7 ),
    INVERSE         = ( 1 << 8 ),
    INVISIBLE       = ( 1 << 9 ),
} mode_t;

void set_color();

#endif  /* __COLORS_H_ */

R main.c => src/main.c +0 -0