From 108b33d32288219b69c2b0eb4fa054e7cd1b18a0 Mon Sep 17 00:00:00 2001
From: Florian Burgener <florian.brgnr@gmail.com>
Date: Thu, 20 Jan 2022 23:42:47 +0100
Subject: [PATCH] Initial structure + update .gitignore

---
 .gitignore   |  8 ++++----
 ex1/Makefile | 20 ++++++++++++++++++++
 ex1/ex1.c    | 45 +++++++++++++++++++++++++++++++++++++++++++++
 ex2/Makefile | 20 ++++++++++++++++++++
 ex2/ex2.c    | 45 +++++++++++++++++++++++++++++++++++++++++++++
 ex3/Makefile | 20 ++++++++++++++++++++
 ex3/ex3.c    | 45 +++++++++++++++++++++++++++++++++++++++++++++
 ex4/Makefile | 20 ++++++++++++++++++++
 ex4/ex4.c    | 45 +++++++++++++++++++++++++++++++++++++++++++++
 9 files changed, 264 insertions(+), 4 deletions(-)
 create mode 100644 ex1/Makefile
 create mode 100644 ex1/ex1.c
 create mode 100644 ex2/Makefile
 create mode 100644 ex2/ex2.c
 create mode 100644 ex3/Makefile
 create mode 100644 ex3/ex3.c
 create mode 100644 ex4/Makefile
 create mode 100644 ex4/ex4.c

diff --git a/.gitignore b/.gitignore
index efb9a2f..12e9fce 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,5 @@
 *.o
-ex1
-ex2
-ex3
-ex4
+ex1/ex1
+ex2/ex2
+ex3/ex3
+ex4/ex4
diff --git a/ex1/Makefile b/ex1/Makefile
new file mode 100644
index 0000000..a4ec1c0
--- /dev/null
+++ b/ex1/Makefile
@@ -0,0 +1,20 @@
+TARGET = ex1
+LIBS = -lm
+CC = gcc
+CFLAGS = -g -Wall -Wextra -pedantic -fsanitize=address -fsanitize=leak
+
+.PHONY: default clean
+
+default: $(TARGET)
+
+ex1.o: ex1.c
+	$(CC) $(CFLAGS) -c $< -o $@
+
+run: $(TARGET)
+	./$<
+
+$(TARGET): ex1.o
+	$(CC) ex1.o $(CFLAGS) $(LIBS) -o $@
+
+clean:
+	rm -f *.o $(TARGET)
diff --git a/ex1/ex1.c b/ex1/ex1.c
new file mode 100644
index 0000000..a741ddf
--- /dev/null
+++ b/ex1/ex1.c
@@ -0,0 +1,45 @@
+/**
+ * @file ex1.c
+ * @author Florian Burgener
+ * @brief Exercice 1
+ * @version 1.0
+ * @date 2022-01-25
+ * 
+ * @copyright Copyright (c) 2021
+ * 
+ */
+
+#include <math.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+int main() {
+    // int32_t values_length = 5;
+    // double values[values_length];
+
+    // for (int32_t i = 0; i < values_length; i += 1) {
+    //     double value;
+    //     scanf("%lf", &value);
+    //     values[i] = value;
+    // }
+
+    // int32_t values_length = 5;
+    // int32_t values[values_length];
+
+    // for (int32_t i = 0; i < values_length; i += 1) {
+    //     int32_t value;
+    //     scanf("%d", &value);
+    //     values[i] = value;
+    // }
+
+    // char a[100];
+    // int32_t b;
+    // scanf("%s %d", a, &b);
+    // printf("%s %d\n", a, b);
+
+	printf("ex1\n");
+    return EXIT_SUCCESS;
+}
diff --git a/ex2/Makefile b/ex2/Makefile
new file mode 100644
index 0000000..6e37b9d
--- /dev/null
+++ b/ex2/Makefile
@@ -0,0 +1,20 @@
+TARGET = ex2
+LIBS = -lm
+CC = gcc
+CFLAGS = -g -Wall -Wextra -pedantic -fsanitize=address -fsanitize=leak
+
+.PHONY: default clean
+
+default: $(TARGET)
+
+ex2.o: ex2.c
+	$(CC) $(CFLAGS) -c $< -o $@
+
+run: $(TARGET)
+	./$<
+
+$(TARGET): ex2.o
+	$(CC) ex2.o $(CFLAGS) $(LIBS) -o $@
+
+clean:
+	rm -f *.o $(TARGET)
diff --git a/ex2/ex2.c b/ex2/ex2.c
new file mode 100644
index 0000000..51b4542
--- /dev/null
+++ b/ex2/ex2.c
@@ -0,0 +1,45 @@
+/**
+ * @file ex2.c
+ * @author Florian Burgener
+ * @brief Exercice 2
+ * @version 1.0
+ * @date 2022-01-25
+ * 
+ * @copyright Copyright (c) 2021
+ * 
+ */
+
+#include <math.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+int main() {
+    // int32_t values_length = 5;
+    // double values[values_length];
+
+    // for (int32_t i = 0; i < values_length; i += 1) {
+    //     double value;
+    //     scanf("%lf", &value);
+    //     values[i] = value;
+    // }
+
+    // int32_t values_length = 5;
+    // int32_t values[values_length];
+
+    // for (int32_t i = 0; i < values_length; i += 1) {
+    //     int32_t value;
+    //     scanf("%d", &value);
+    //     values[i] = value;
+    // }
+
+    // char a[100];
+    // int32_t b;
+    // scanf("%s %d", a, &b);
+    // printf("%s %d\n", a, b);
+
+	printf("ex2\n");
+    return EXIT_SUCCESS;
+}
diff --git a/ex3/Makefile b/ex3/Makefile
new file mode 100644
index 0000000..3c4cc6b
--- /dev/null
+++ b/ex3/Makefile
@@ -0,0 +1,20 @@
+TARGET = ex3
+LIBS = -lm
+CC = gcc
+CFLAGS = -g -Wall -Wextra -pedantic -fsanitize=address -fsanitize=leak
+
+.PHONY: default clean
+
+default: $(TARGET)
+
+ex3.o: ex3.c
+	$(CC) $(CFLAGS) -c $< -o $@
+
+run: $(TARGET)
+	./$<
+
+$(TARGET): ex3.o
+	$(CC) ex3.o $(CFLAGS) $(LIBS) -o $@
+
+clean:
+	rm -f *.o $(TARGET)
diff --git a/ex3/ex3.c b/ex3/ex3.c
new file mode 100644
index 0000000..c09663f
--- /dev/null
+++ b/ex3/ex3.c
@@ -0,0 +1,45 @@
+/**
+ * @file ex3.c
+ * @author Florian Burgener
+ * @brief Exercice 3
+ * @version 1.0
+ * @date 2022-01-25
+ * 
+ * @copyright Copyright (c) 2021
+ * 
+ */
+
+#include <math.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+int main() {
+    // int32_t values_length = 5;
+    // double values[values_length];
+
+    // for (int32_t i = 0; i < values_length; i += 1) {
+    //     double value;
+    //     scanf("%lf", &value);
+    //     values[i] = value;
+    // }
+
+    // int32_t values_length = 5;
+    // int32_t values[values_length];
+
+    // for (int32_t i = 0; i < values_length; i += 1) {
+    //     int32_t value;
+    //     scanf("%d", &value);
+    //     values[i] = value;
+    // }
+
+    // char a[100];
+    // int32_t b;
+    // scanf("%s %d", a, &b);
+    // printf("%s %d\n", a, b);
+
+	printf("ex3\n");
+    return EXIT_SUCCESS;
+}
diff --git a/ex4/Makefile b/ex4/Makefile
new file mode 100644
index 0000000..0085fc3
--- /dev/null
+++ b/ex4/Makefile
@@ -0,0 +1,20 @@
+TARGET = ex4
+LIBS = -lm
+CC = gcc
+CFLAGS = -g -Wall -Wextra -pedantic -fsanitize=address -fsanitize=leak
+
+.PHONY: default clean
+
+default: $(TARGET)
+
+ex4.o: ex4.c
+	$(CC) $(CFLAGS) -c $< -o $@
+
+run: $(TARGET)
+	./$<
+
+$(TARGET): ex4.o
+	$(CC) ex4.o $(CFLAGS) $(LIBS) -o $@
+
+clean:
+	rm -f *.o $(TARGET)
diff --git a/ex4/ex4.c b/ex4/ex4.c
new file mode 100644
index 0000000..900c833
--- /dev/null
+++ b/ex4/ex4.c
@@ -0,0 +1,45 @@
+/**
+ * @file ex4.c
+ * @author Florian Burgener
+ * @brief Exercice 4
+ * @version 1.0
+ * @date 2022-01-25
+ * 
+ * @copyright Copyright (c) 2021
+ * 
+ */
+
+#include <math.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+int main() {
+    // int32_t values_length = 5;
+    // double values[values_length];
+
+    // for (int32_t i = 0; i < values_length; i += 1) {
+    //     double value;
+    //     scanf("%lf", &value);
+    //     values[i] = value;
+    // }
+
+    // int32_t values_length = 5;
+    // int32_t values[values_length];
+
+    // for (int32_t i = 0; i < values_length; i += 1) {
+    //     int32_t value;
+    //     scanf("%d", &value);
+    //     values[i] = value;
+    // }
+
+    // char a[100];
+    // int32_t b;
+    // scanf("%s %d", a, &b);
+    // printf("%s %d\n", a, b);
+
+	printf("ex4\n");
+    return EXIT_SUCCESS;
+}
-- 
GitLab