From 7b4023a359dd22e55da543f57ff24abba957a62d Mon Sep 17 00:00:00 2001 From: Jakub Zych Date: Sun, 20 Jan 2019 23:46:48 +0100 Subject: [PATCH 1/3] Homework 3 --- Makefile | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..6cf64fb --- /dev/null +++ b/Makefile @@ -0,0 +1,17 @@ +CC=g++ +CFLAGS=-std=c++17 -Wall -Wextra -Wpedantic -Werror +LDFLAGS=-I inc +SOURCES=*.cpp + +.PHONY: all +all: debug release + +debug: $(SOURCES) + $(CC) $(SOURCES) $(CFLAGS) $(LDFLAGS) -g -o $@ + +release: $(SOURCES) + $(CC) $(SOURCES) $(CFLAGS) $(LDFLAGS) -O3 -o $@ + +.PHONY: clean +clean: + rm debug release From b8135545baff7b48f17d0f8b71d7ff4cb1d1d0b2 Mon Sep 17 00:00:00 2001 From: Jakub Zych Date: Mon, 21 Jan 2019 00:38:19 +0100 Subject: [PATCH 2/3] move .hpp files to inc folder --- Circle.hpp => inc/Circle.hpp | 0 Rectangle.hpp => inc/Rectangle.hpp | 0 Shape.hpp => inc/Shape.hpp | 0 Square.hpp => inc/Square.hpp | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename Circle.hpp => inc/Circle.hpp (100%) rename Rectangle.hpp => inc/Rectangle.hpp (100%) rename Shape.hpp => inc/Shape.hpp (100%) rename Square.hpp => inc/Square.hpp (100%) diff --git a/Circle.hpp b/inc/Circle.hpp similarity index 100% rename from Circle.hpp rename to inc/Circle.hpp diff --git a/Rectangle.hpp b/inc/Rectangle.hpp similarity index 100% rename from Rectangle.hpp rename to inc/Rectangle.hpp diff --git a/Shape.hpp b/inc/Shape.hpp similarity index 100% rename from Shape.hpp rename to inc/Shape.hpp diff --git a/Square.hpp b/inc/Square.hpp similarity index 100% rename from Square.hpp rename to inc/Square.hpp From 2f0f9b2c2a69e9375e94aca69ca6e0a3fd6d62c1 Mon Sep 17 00:00:00 2001 From: Jakub Zych Date: Mon, 21 Jan 2019 00:44:46 +0100 Subject: [PATCH 3/3] Homework 3 - improved --- Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 6cf64fb..402060c 100644 --- a/Makefile +++ b/Makefile @@ -1,16 +1,16 @@ -CC=g++ -CFLAGS=-std=c++17 -Wall -Wextra -Wpedantic -Werror -LDFLAGS=-I inc +CXX=g++ +CXXFLAGS=-std=c++17 -Wall -Wextra -Wpedantic -Werror +IFLAGS=-I inc SOURCES=*.cpp .PHONY: all all: debug release debug: $(SOURCES) - $(CC) $(SOURCES) $(CFLAGS) $(LDFLAGS) -g -o $@ + $(CXX) $^ $(CXXFLAGS) $(IFLAGS) -g -o $@ release: $(SOURCES) - $(CC) $(SOURCES) $(CFLAGS) $(LDFLAGS) -O3 -o $@ + $(CXX) $^ $(CXXFLAGS) $(IFLAGS) -O3 -o $@ .PHONY: clean clean: