Skip to content

Commit

Permalink
Push
Browse files Browse the repository at this point in the history
  • Loading branch information
clecat committed Mar 4, 2017
1 parent 238ac9c commit 5ed2f90
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 8 deletions.
20 changes: 14 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
NAME = nanotekspice

NAME_L = libnanotekspice.a

CXX = g++

NOW := $(shell date +"%d %h %g:%R")
Expand Down Expand Up @@ -43,32 +45,38 @@ CMD_P = $(SRC_P)commands/
CMD = $(CMD_P)Commands.cpp

SRC_P = src/
SRC = $(SRC_P)main_parser.cpp \
$(CMPT) \
SRC_L = $(SRC_P)core.cpp \
$(PARSER) \
$(CMPT) \
$(CMD) \
$(ERROR)
SRC = $(SRC_P)main.cpp

OBJ = $(SRC:.cpp=.o)

OBJ_L = $(SRC_L:.cpp=.o)

CXXFLAGS += -Wall -Wextra -pedantic -std=c++11 -g

INCLUDE = ./include

RM = rm -vf

LB = ar rc

all: $(NAME)

$(NAME): $(OBJ)
@$(CXX) $(OBJ) -o $(NAME)
$(NAME): $(OBJ_L) $(OBJ)
@$(LB) $(NAME_L) $(OBJ_L)
@$(CXX) $(OBJ) -L. -l$(NAME) -o $(NAME)
@$(ECHO) $(HIGHLIGHTED)"COMPILATION SUCCEEDED ON "$(NOW)$(DEFAULT)

clean:
@$(RM) $(OBJ)
@$(RM) $(OBJ) $(OBJ_L)
@$(ECHO) $(DELETION)"OBJs PROPERLY DELETED"$(DEFAULT)

fclean: clean
@$(RM) $(NAME)
@$(RM) $(NAME) $(NAME_L)
@$(ECHO) $(DELETION)"BINARY PROPERLY DELETED"$(DEFAULT)

re: fclean all
Expand Down
6 changes: 6 additions & 0 deletions include/core.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#ifndef CORE_HPP_
# define CORE_HPP_

int core(int ac, char **av);

#endif
4 changes: 2 additions & 2 deletions src/main_parser.cpp → src/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ void set_inputs(std::map<std::string, nts::IComponent *> chipsets_m, char **arg,
throw ErrorParser("Every inputs werent set", "arguments");
}

int main(int ac, char **av)
int core(int ac, char **av)
{
if (ac < 2)
{
Expand All @@ -78,4 +78,4 @@ int main(int ac, char **av)
return (1);
}
return (0);
}
}
6 changes: 6 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include "core.hpp"

int main(int ac, char **av)
{
return (core(ac, av));
}

0 comments on commit 5ed2f90

Please sign in to comment.