From 3d7f505e021e9940aa7e7d80bf88a261525fba41 Mon Sep 17 00:00:00 2001 From: Nayan Sawyer <33187059+GShadow5@users.noreply.github.com> Date: Thu, 13 Nov 2025 20:16:58 -0500 Subject: [PATCH] start directory structure and add starter files for c b tree --- data-structures/trees/binary-tree/c/Makefile | 43 ++++++++++++++++++++ data-structures/trees/binary-tree/c/main.c | 6 +++ 2 files changed, 49 insertions(+) create mode 100644 data-structures/trees/binary-tree/c/Makefile create mode 100644 data-structures/trees/binary-tree/c/main.c diff --git a/data-structures/trees/binary-tree/c/Makefile b/data-structures/trees/binary-tree/c/Makefile new file mode 100644 index 0000000..e887b70 --- /dev/null +++ b/data-structures/trees/binary-tree/c/Makefile @@ -0,0 +1,43 @@ +# Compiler and flags +CC = gcc +DEBUG_FLAGS = -g -Wall -Wextra +RELEASE_FLAGS = -Wall -Wextra -DNDEBUG +# LFLAGS = -lpthread + +# Source files +SRCS = main.c + +# Object files definition +OBJS = $(SRCS:.c=.o) + +TARGET = main.out + + +# BUILD STUFF + +# Default to debug +all: debug + +debug: CFLAGS = $(DEBUG_FLAGS) +debug: $(TARGET) + +release: CFLAGS = $(RELEASE_FLAGS) +release: $(TARGET) + +# Link object files +$(TARGET): $(OBJS) + $(CC) -o $(TARGET) $(OBJS) $(LFLAGS) + +# Compile object files +%.o: %.c + $(CC) $(CFLAGS) -c $< -o $@ + +# Object dependencies +%.o: %.c + $(CC) $(CFLAGS) -c $< -o $@ + +clean: + rm -f $(OBJS) + rm -f $(TARGET) + +.PHONY: all debug release clean diff --git a/data-structures/trees/binary-tree/c/main.c b/data-structures/trees/binary-tree/c/main.c new file mode 100644 index 0000000..f26b97c --- /dev/null +++ b/data-structures/trees/binary-tree/c/main.c @@ -0,0 +1,6 @@ +#include + +int main() { + printf("Hello, World!\n"); + return 0; +}