aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFranciszek Malinka <franciszek.malinka@gmail.com>2021-04-19 09:42:11 +0200
committerFranciszek Malinka <franciszek.malinka@gmail.com>2021-04-19 09:42:11 +0200
commit7bb11482a54c78123f11d81c698a9b48ef48d5d9 (patch)
tree4aab0dcf1e0fc86c801bba0d356472817b57aabb
parent1078d2387db43d0c7e982d1ba3340dc67fe0fed9 (diff)
makefile
-rw-r--r--.gitignore1
-rw-r--r--Semestr 4/sieci/pracownia2/router/makefile36
2 files changed, 37 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 9497fb8..e621aa3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,6 +3,7 @@
# Unignore all with extensions
!*.*
+!makefile
# Unignore all dirs
!*/
diff --git a/Semestr 4/sieci/pracownia2/router/makefile b/Semestr 4/sieci/pracownia2/router/makefile
new file mode 100644
index 0000000..be41840
--- /dev/null
+++ b/Semestr 4/sieci/pracownia2/router/makefile
@@ -0,0 +1,36 @@
+CC := gcc
+CFLAGS := -Og -std=gnu17 -Wall -Wall -fsanitize=address -fsanitize=undefined
+TARGET := router
+
+all: $(TARGET)
+test: test
+
+utils.o: utils.c
+ $(CC) $(CFLAGS) -c utils.c
+
+network_addr.o: network_addr.c
+ $(CC) $(CFLAGS) -c network_addr.c
+
+router.o: router.c
+ $(CC) $(CFLAGS) -c $(TARGET).c
+
+linked_list.o: linked_list.c
+ $(CC) $(CFLAGS) -c linked_list.c
+
+router: utils.o network_addr.o linked_list.o router.o
+ $(CC) $(CFLAGS) -o $(TARGET) $(TARGET).o network_addr.o utils.o linked_list.o
+
+test.o: test.c
+ $(CC) $(CFLAGS) -c test.c
+
+test: linked_list.o test.o
+ $(CC) $(CFLAGS) -o test test.o linked_list.o
+
+clean:
+ rm -rf $(TARGET)
+ rm -rf test
+
+distclean:
+ rm -rf $(TARGET)
+ rm -rf test
+ rm -rf *.o