From 49cc8790ddce0cf9c11b6b5229164a093e3ac8d7 Mon Sep 17 00:00:00 2001
From: EdouardParis <mail@edouard.paris>
Date: Mon, 30 May 2016 16:53:36 +0200
Subject: [PATCH] add Makefile

---
 src/Makefile       | 13 +++++++++++++
 src/algo_ex1.h     |  2 +-
 src/question_3.cpp |  2 +-
 3 files changed, 15 insertions(+), 2 deletions(-)
 create mode 100644 src/Makefile

diff --git a/src/Makefile b/src/Makefile
new file mode 100644
index 0000000..9c49f97
--- /dev/null
+++ b/src/Makefile
@@ -0,0 +1,13 @@
+all: question_3
+
+question_3: question_3.o algo_ex1.o
+		g++ -o question_3 question_3.o algo_ex1.o
+
+algo_ex1.o: algo_ex1.h
+		g++ -Wall -Wextra -lgmpxx -lgmp algo_ex1.cpp -o algo_ex1.o
+
+question_3.o: question_3.cpp algo_ex1.h
+		g++ -Wall -Wextra -lgmpxx -lgmp question_3.cpp -o question_3.o 
+
+clean:
+		rm -rf *.o
diff --git a/src/algo_ex1.h b/src/algo_ex1.h
index a9a13a6..5509736 100644
--- a/src/algo_ex1.h
+++ b/src/algo_ex1.h
@@ -1,4 +1,4 @@
 #include <ctime>
 #include <gmpxx.h>
 
-time_t sqrt(mpz_class const& a, mpz_class & res); 
+time_t algo_sqrt(mpz_class const& a, mpz_class & res); 
diff --git a/src/question_3.cpp b/src/question_3.cpp
index 615e5e8..7f1c5a7 100644
--- a/src/question_3.cpp
+++ b/src/question_3.cpp
@@ -18,7 +18,7 @@ int main(int argc, char** argv) {
   mpz_class res;
   time_t t;
 
-  t = sqrt(a, res);
+  t = algo_sqrt(a, res);
   
   std::cout << res << "\t" << t << std::endl;
   return 0;
-- 
GitLab