From d428d579569ac0689e295559eb6cf20c2be55c6c Mon Sep 17 00:00:00 2001 From: Katarzyna Chroma Date: Mon, 14 Jan 2019 18:39:26 +0100 Subject: [PATCH 1/2] Makefile added --- Makefile | 8 ++++++++ Circle.hpp => includes/Circle.hpp | 0 Rectangle.hpp => includes/Rectangle.hpp | 0 Shape.hpp => includes/Shape.hpp | 0 Square.hpp => includes/Square.hpp | 0 5 files changed, 8 insertions(+) create mode 100644 Makefile rename Circle.hpp => includes/Circle.hpp (100%) rename Rectangle.hpp => includes/Rectangle.hpp (100%) rename Shape.hpp => includes/Shape.hpp (100%) rename Square.hpp => includes/Square.hpp (100%) diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..233e71c --- /dev/null +++ b/Makefile @@ -0,0 +1,8 @@ +.PHONY: all +all: debug release + +debug: *.cpp includes/*.hpp + g++ *.cpp -std=c++17 -Wall -Wextra -Wpedantic -Werror -g -o debug -Iincludes + +release: *.cpp includes/*.hpp + g++ *.cpp -std=c++17 -Wall -Wextra -Wpedantic -Werror -O3 -o release -Iincludes diff --git a/Circle.hpp b/includes/Circle.hpp similarity index 100% rename from Circle.hpp rename to includes/Circle.hpp diff --git a/Rectangle.hpp b/includes/Rectangle.hpp similarity index 100% rename from Rectangle.hpp rename to includes/Rectangle.hpp diff --git a/Shape.hpp b/includes/Shape.hpp similarity index 100% rename from Shape.hpp rename to includes/Shape.hpp diff --git a/Square.hpp b/includes/Square.hpp similarity index 100% rename from Square.hpp rename to includes/Square.hpp From 96bbc28d0cf38b02a116121f69d129e9a741c1c1 Mon Sep 17 00:00:00 2001 From: Katarzyna Chroma Date: Sat, 19 Jan 2019 19:15:02 +0100 Subject: [PATCH 2/2] Makefile homework --- Makefile | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 233e71c..f466a2e 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,21 @@ +CXX=g++ +CXXFLAGS= -std=c++17 -Wall -Wpedantic -Wextra +SOURCES= *.cpp +OBJECTS = $(SOURCES:.cpp) +INCLUDES= includes/*.hpp +include_dirs= -Iincludes +all_target= debug release + .PHONY: all -all: debug release + all: $(all_target) + +debug: $(SOURCES) $(INCLUDES) + $(CXX) $< $(CXXFLAGS) -g -o nazwa $(include_dir) + +release: $(SOURCES) $(INCLUDES) + $(CXX) $< $(CXXFLAGS) -O3 -o nazwa $(include_dir) -debug: *.cpp includes/*.hpp - g++ *.cpp -std=c++17 -Wall -Wextra -Wpedantic -Werror -g -o debug -Iincludes -release: *.cpp includes/*.hpp - g++ *.cpp -std=c++17 -Wall -Wextra -Wpedantic -Werror -O3 -o release -Iincludes +.PHONY: clean +clean: + rm $(all_target)