From 4b6b7dfc8cdae3b448e4fb358c7ea042148666b7 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Sat, 2 Apr 2022 21:07:28 +0200 Subject: [PATCH] =?UTF-8?q?D=C3=A9placement=20des=20.hpp=20dans=20le=20dos?= =?UTF-8?q?sier=20includes=20et=20des=20.cpp=20dans=20le=20dossier=20src,?= =?UTF-8?q?=20refonte=20du=20makefile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 21 +++++++++++---------- univers.hpp => includes/univers.hpp | 0 main.cpp => src/main.cpp | 2 +- univers.cpp => src/univers.cpp | 2 +- 4 files changed, 13 insertions(+), 12 deletions(-) rename univers.hpp => includes/univers.hpp (100%) rename main.cpp => src/main.cpp (97%) rename univers.cpp => src/univers.cpp (99%) diff --git a/Makefile b/Makefile index ee4c199..33e7fb5 100644 --- a/Makefile +++ b/Makefile @@ -1,19 +1,20 @@ -CCPP = g++ -CFLAGS = -I. -Wall -Wextra -O3 --std=c++17 +CXX = g++ +CXXFLAGS = -Wall -Wextra -O3 --std=c++17 +RM = rm -SOURCES = $(shell find . -name '*.cpp') -OBJECTS = $(SOURCES:.cpp=.o) +SOURCES = $(wildcard src/*.cpp) +OBJETS = $(patsubst %.cpp,%.cpp.o,$(notdir $(SOURCES))) -NOM = ecosysteme +EXE = ecosysteme -%.o: %.cpp - $(CCPP) -c -o $@ $< $(CFLAGS) $(CFLAGS2) +%.cpp.o: src/%.cpp + $(CXX) -c -o $@ $< $(CXXFLAGS) -main: $(OBJECTS) - $(CCPP) -o $(NOM) $^ $(CFLAGS) $(CFLAGS2) +main: $(OBJETS) + $(CXX) -o $(EXE) $(OBJETS) all: main clean: - rm *.o $(NOM) + $(RM) $(OBJETS) $(EXE) diff --git a/univers.hpp b/includes/univers.hpp similarity index 100% rename from univers.hpp rename to includes/univers.hpp diff --git a/main.cpp b/src/main.cpp similarity index 97% rename from main.cpp rename to src/main.cpp index ac576d4..3ebe36b 100644 --- a/main.cpp +++ b/src/main.cpp @@ -1,4 +1,4 @@ -#include "univers.hpp" +#include "../includes/univers.hpp" void lancerSimulation(Univers ** univers, int m, int n, int nb_moutons, int nb_loups) { *univers = new Univers(m, n); diff --git a/univers.cpp b/src/univers.cpp similarity index 99% rename from univers.cpp rename to src/univers.cpp index 5ca00bd..422c0bb 100644 --- a/univers.cpp +++ b/src/univers.cpp @@ -1,4 +1,4 @@ -#include "univers.hpp" +#include "../includes/univers.hpp" // -------- Univers --------