prog: Session.o Value.o terminal.o main.o Rectangle.o Component.o Button.o
	g++ -g -Wall terminal.o Session.o Value.o Rectangle.o Component.o Button.o main.o -o prog
terminal.o: terminal.cpp terminal.h
	g++ -c -Wall terminal.cpp
Session.o: Session.cpp terminal.h Content.h
	g++ -c -Wall Session.cpp
Rectangle.o: Rectangle.cpp Rectangle.h
	g++ -c -Wall Rectangle.cpp
Component.o: Component.cpp Component.h
	g++ -c -Wall Component.cpp
Button.o: Button.cpp Button.h
	g++ -c -Wall Button.cpp
Value.o: Value.cpp Value.h
	g++ -c -Wall Value.cpp
main.o: main.cpp terminal.h
	g++ -c -Wall main.cpp

CPP=g++
CFLAGS=-g -c -MMD
LDFLAGS=-g
SOURCES=terminal.cpp Rectangle.cpp Component.cpp Button.cpp Session.cpp Value.cpp main.cpp
OBJECTS=$(SOURCES:.cpp=.o)
DEPS=$(SOURCES:.cpp=.d)

main: $(OBJECTS)
	$(CPP) $(LDFLAGS) $(OBJECTS) -o $@
.cpp.o:
	$(CPP) $(CFLAGS) $<
-include $(DEPS)

clean:
	rm *.o *.d

