Browse Source

New : Makefile and empty program [0.0.0]

master
gbrochar 1 year ago
parent
commit
69756e36d1
6 changed files with 92 additions and 0 deletions
  1. +2
    -0
      .gitignore
  2. +58
    -0
      Makefile
  3. +1
    -0
      README.md
  4. +14
    -0
      inc/macros.h
  5. +9
    -0
      inc/ncurses.h
  6. +8
    -0
      src/main.c

+ 2
- 0
.gitignore View File

@@ -1,3 +1,5 @@
# Binary name
ncurses
# ---> C
# Prerequisites
*.d


+ 58
- 0
Makefile View File

@@ -0,0 +1,58 @@
NAME = ncurses

SRC_FILE = \
main.c \

OBJ_FILE = $(SRC_FILE:.c=.o)

INC_FILE = \
ncurses.h \
macros.h \

SRC_DIR = src/
OBJ_DIR = obj/
INC_DIR = inc/

SRC = $(addprefix $(SRC_DIR), $(SRC_FILE))
OBJ = $(addprefix $(OBJ_DIR), $(OBJ_FILE))
INC = $(addprefix $(INC_DIR), $(INC_FILE))

LIB =

CC = gcc

CFLAGS = -Wall -Werror -Wextra

RED = \033[31m
GREEN = \033[32m
YELLOW = \033[33m
BLUE = \033[34m
CYAN = \033[36m
WHITE = \033[0m

all: $(NAME)

$(NAME): $(OBJ) $(INC)
@$(CC) $(CFLAGS) -c $(SRC) -I $(INC_DIR)
@mv $(OBJ_FILE) $(OBJ_DIR)
@$(CC) $(CFLAGS) $(OBJ) -o $(NAME) $(LIB)
@echo -e "$(GREEN)[OK]$(WHITE) $(NAME)"

$(OBJ_DIR)%.o: $(SRC_DIR)%.c inc/
@if [ ! -d ./obj ]; then \
mkdir -p ./obj; \
fi;
@$(CC) $(CFLAGS) -I $(INC_DIR) -o $@ -c $<
@echo -e "$(CYAN)[CC]$(WHITE) $<"

clean:
@rm -rf $(OBJ_DIR)
@echo -e "$(RED)[REMOVED]$(WHITE) obj files"

fclean: clean
@rm -f $(NAME)
@echo -e "$(RED)[REMOVED]$(WHITE) $(NAME)"

re: fclean all

.PHONY: all clean fclean re

+ 1
- 0
README.md View File

@@ -1,2 +1,3 @@
# ncurses

ncurses experiment project.

+ 14
- 0
inc/macros.h View File

@@ -0,0 +1,14 @@
#ifndef __MACROS__
#define __MACROS__


#define FAILURE -1
#define SUCCESS 0
#define FALSE 0
#define NO 0
#define TRUE 1
#define YES 1


#endif

+ 9
- 0
inc/ncurses.h View File

@@ -0,0 +1,9 @@
#ifndef __NCURSES__
#define __NCURSES__


#include "macros.h"


#endif

+ 8
- 0
src/main.c View File

@@ -0,0 +1,8 @@
#include "ncurses.h"

int main(int argc, char **argv)
{
(void)argc;
(void)argv;
return (SUCCESS);
}

Loading…
Cancel
Save