mirror of
https://github.com/opus-tango/DSA-reference.git
synced 2026-03-20 03:55:22 +00:00
start directory structure and add starter files for c b tree
This commit is contained in:
43
data-structures/trees/binary-tree/c/Makefile
Normal file
43
data-structures/trees/binary-tree/c/Makefile
Normal file
@@ -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
|
||||||
6
data-structures/trees/binary-tree/c/main.c
Normal file
6
data-structures/trees/binary-tree/c/main.c
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
printf("Hello, World!\n");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user