First commit, configured makefile

This commit is contained in:
Ricardo
2022-05-28 07:18:15 +00:00
parent f20bec9f11
commit bb401cf087
6 changed files with 74 additions and 0 deletions

4
.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
# Object file
*.out

51
Makefile Normal file
View File

@@ -0,0 +1,51 @@
# GNU/Linux specific Make directives.
# Declare tools.
SHELL = /bin/sh
CC = clang++
LD = clang++
ECHO = @echo
CFLAGS = -std=c++17 -Wall -Wextra -Wno-unused-variable -Wno-unused-parameter
LDFLAGS = -lncurses
EXECUTABLE = Sparks
SOURCES = main.cpp functions.cpp
OBJECTS = $(SOURCES:.cpp=.out)
CLEANFILES = *.out
# To get a fully verbose make output do declare 'AT' at the command line like so: 'make AT='.
# By default AT is undefined and thus assigned the string '@' which suppresses output from commands.
AT ?= @
# Colors and efects
#######################################
NORMAL = \033[m
FG_DKGREEN = \033[32;7m
FG_REDFULL = \033[31;7m
FG_YELLOW = \033[33;7m
FG_BLUE = \033[34;7m
##########################################
.SUFFIXES: .cpp .out
.PHONY: clean
# Compile
all: $(EXECUTABLE)
.cpp.out:
$(ECHO) "[$(FG_BLUE)COMPILING$(NORMAL)] $@"
$(AT) $(CC) $(CFLAGS) -o $*.out -c $<
$(EXECUTABLE): $(OBJECTS)
$(ECHO) "[$(FG_YELLOW)LINKING$(NORMAL)] $(EXECUTABLE)"
$(AT) $(LD) $(LDFLAGS) $(OBJECTS) -o $(EXECUTABLE)
$(ECHO) "[$(FG_DKGREEN)SUCCESS$(NORMAL)] Run ./$(EXECUTABLE) to start your application, Enjoy :)"
clean:
$(ECHO) "[$(FG_REDFULL)CLEANED$(NORMAL)] $(CLEANFILES)"
$(AT) rm -rf $(CLEANFILES)

BIN
Sparks Normal file

Binary file not shown.

0
functions.cpp Normal file
View File

10
include/main.h Normal file
View File

@@ -0,0 +1,10 @@
#ifndef __CHCOUNT_H__
#define __CHCOUNT_H__
#include <iostream>
#include <ncurses.h>
#endif

9
main.cpp Normal file
View File

@@ -0,0 +1,9 @@
#include "include/main.h"
int main () {
std::cout << "Greetings, Aliens!!!!" << std::endl;
}