# ==================================================================================
#
# Since I'm implementing an unfamiliar data structure, I figured it was time to try
# writing a different kind of Makefile. :) This Makefile shouldn't need to include
# the same generic crap that all the ones in Zenobit do currently.
# 
# Since, I export ZENOBIT_xxx variables. xxx being the flag (cc, etc).
# Yes, I realize that this program will not need to utilize this level of stuff but,
# I wanted to try it anyways.
#
# ==================================================================================

# Tweakables!
cc= gcc
ld= ld
as= as
make= gmake

# Build tweakables
project= AVL

main= $(project)_main.c
insert= $(project)_insert.c
remove= $(project)_remove.c
rotate_left= $(project)_rotate_left.c
rotate_right= $(project)_rotate_right.c
rebalance_left= $(project)_rebalance_left.c
rebalance_right= $(project)_rebalance_right.c
create_node= $(project)_create_node.c
display_tree= $(project)_display_tree.c
check_tree= $(project)_check_tree.c

project_sources= $(main) $(insert) $(remove) $(rotate_left) $(rotate_right) $(rebalance_left) $(rebalance_right) $(create_node) $(display_tree) $(check_tree)
project_headers= $(project)_structures.h $(project)_functions.h

standard= --std=c99
strict= -Wall -Werror -Wextra -pedantic --pedantic-errors
project_desc= $(project).about

# Export the toolchain calls!
all:	clean project_info $(project)


clean:
	@rm -rf $(project)

# This will list some information about the project being built!
project_info:

# The Project build rules!
$(project):	$(project_sources) $(project_headers)
	@echo -n " - Building ZCApp:$(project) ... "
	@$(cc) $(standard) $(strict) $(project_sources) -o $(project)
	@echo "done"
