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++
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)

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) {
*univers = new Univers(m, n);

View file

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