Déplacement des .hpp dans le dossier includes et des .cpp dans le dossier src, refonte du makefile

This commit is contained in:
Mylloon 2022-04-02 21:07:28 +02:00
parent b32fc34cc4
commit 4b6b7dfc8c
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
4 changed files with 13 additions and 12 deletions

View file

@ -1,19 +1,20 @@
CCPP = g++ CXX = g++
CFLAGS = -I. -Wall -Wextra -O3 --std=c++17 CXXFLAGS = -Wall -Wextra -O3 --std=c++17
RM = rm
SOURCES = $(shell find . -name '*.cpp') SOURCES = $(wildcard src/*.cpp)
OBJECTS = $(SOURCES:.cpp=.o) OBJETS = $(patsubst %.cpp,%.cpp.o,$(notdir $(SOURCES)))
NOM = ecosysteme EXE = ecosysteme
%.o: %.cpp %.cpp.o: src/%.cpp
$(CCPP) -c -o $@ $< $(CFLAGS) $(CFLAGS2) $(CXX) -c -o $@ $< $(CXXFLAGS)
main: $(OBJECTS) main: $(OBJETS)
$(CCPP) -o $(NOM) $^ $(CFLAGS) $(CFLAGS2) $(CXX) -o $(EXE) $(OBJETS)
all: all:
main main
clean: clean:
rm *.o $(NOM) $(RM) $(OBJETS) $(EXE)

View file

@ -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) { void lancerSimulation(Univers ** univers, int m, int n, int nb_moutons, int nb_loups) {
*univers = new Univers(m, n); *univers = new Univers(m, n);

View file

@ -1,4 +1,4 @@
#include "univers.hpp" #include "../includes/univers.hpp"
// -------- Univers -------- // -------- Univers --------