From 82e930d4b5eb3956508b22b69cb46c17c203f81a Mon Sep 17 00:00:00 2001 From: Orestis <orestis.malaspinas@pm.me> Date: Wed, 9 Mar 2022 23:55:48 +0100 Subject: [PATCH] added makefile for avl --- source_codes/arbres_AVL/.gitignore | 4 ++++ source_codes/arbres_AVL/Makefile | 25 +++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 source_codes/arbres_AVL/.gitignore create mode 100644 source_codes/arbres_AVL/Makefile diff --git a/source_codes/arbres_AVL/.gitignore b/source_codes/arbres_AVL/.gitignore new file mode 100644 index 0000000..f8a1ca8 --- /dev/null +++ b/source_codes/arbres_AVL/.gitignore @@ -0,0 +1,4 @@ +bin_tree.o +avl.o +main +main.o diff --git a/source_codes/arbres_AVL/Makefile b/source_codes/arbres_AVL/Makefile new file mode 100644 index 0000000..88318d0 --- /dev/null +++ b/source_codes/arbres_AVL/Makefile @@ -0,0 +1,25 @@ +CC:=gcc +# SAN:=-fsanitize=address +CFLAGS:=-Wall -Wextra -pedantic -g $(SAN) +LDFLAGS:=-lm $(SAN) +SOURCES := $(wildcard *.c) +OBJECTS := $(patsubst %.c, %.o, $(SOURCES)) + +all: main $(OBJECTS) + +main: main.c bin_tree.o avl.o + $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) + @echo $@ >> .gitignore + +%.o: %.c + $(CC) $(CFLAGS) -c $< -o $@ + @echo $@ >> .gitignore + +bin_tree.o: bin_tree.h +avl.o: avl.h + +.PHONY: clean all + +clean: + rm -f *.o main .gitignore + -- GitLab