aboutsummaryrefslogtreecommitdiff
path: root/Semestr 4/sieci/pracownia2/franciszek_malinka/makefile
diff options
context:
space:
mode:
authorFranciszek Malinka <franciszek.malinka@gmail.com>2021-05-06 14:28:59 +0200
committerFranciszek Malinka <franciszek.malinka@gmail.com>2021-05-06 14:28:59 +0200
commitf0bd9763ea4be22f0f235c0f3aa6628944a56c7e (patch)
treec12c047b441bdc520740643e549bd90624601fe8 /Semestr 4/sieci/pracownia2/franciszek_malinka/makefile
parentf31c5fa59ee3afafc66bfb53c159eff301b537af (diff)
Aktualizacja
Diffstat (limited to 'Semestr 4/sieci/pracownia2/franciszek_malinka/makefile')
-rw-r--r--Semestr 4/sieci/pracownia2/franciszek_malinka/makefile34
1 files changed, 34 insertions, 0 deletions
diff --git a/Semestr 4/sieci/pracownia2/franciszek_malinka/makefile b/Semestr 4/sieci/pracownia2/franciszek_malinka/makefile
new file mode 100644
index 0000000..bf6a327
--- /dev/null
+++ b/Semestr 4/sieci/pracownia2/franciszek_malinka/makefile
@@ -0,0 +1,34 @@
+CC := gcc
+CFLAGS := -O2 -std=gnu17 -Wall -Wall -Wno-unused-result
+TARGET := router
+TEST := test
+DEPS := config.h
+
+ODIR := obj
+_OBJ := router.o utils.o linked_list.o network_addr.o dist_vector.o
+OBJ := $(patsubst %,$(ODIR)/%,$(_OBJ))
+
+_TEST_OBJ := test.o linked_list.o
+TEST_OBJ := $(patsubst %,$(ODIR)/%,$(_TEST_OBJ))
+
+
+all: $(TARGET)
+test: $(TEST)
+
+$(ODIR)/%.o: %.c $(DEPS)
+ $(CC) $(CFLAGS) -c -o $@ $<
+
+$(TARGET): $(OBJ)
+ $(CC) -o $@ $^ $(CFLAGS)
+
+$(TEST): $(TEST_OBJ)
+ $(CC) -o $@ $^ $(CFLAGS)
+
+clean:
+ rm -rf $(TARGET)
+ rm -rf test
+
+distclean:
+ rm -rf $(TARGET)
+ rm -rf test
+ rm -rf $(ODIR)/*.o