ECHO = @echo
CP=@cp
GCC = g++
RM = @rm -f
CCFLAGS = -c -O3 -g -std=c++20 -pedantic -Wall 
SRC = $(wildcard *.cpp) 
BIN = ../bin
EXE = deployer
OBJECTS = $(patsubst %.cpp,$(BIN)/%.o,$(SRC))
LIBRARIES = -lstdc++fs 

$(EXE) : $(OBJECTS)
	$(ECHO) "-Linking $(EXE)-"
	$(GCC) -o $@ $^ $(LIBRARIES)
	$(CP) $(EXE) ../testenv
	$(CP) $(EXE) ../bin
$(BIN)/%.o:%.cpp
	$(ECHO) "-Compilation $<- "
	$(GCC) $(CCFLAGS) -o $@ $<

.PHONY: clean 
clean:
	$(ECHO) "-Cleaning-"
	$(RM) $(OBJECTS) $(EXE)
