# C compiler
CC := gcc
# C preprocessor flags
CPP := -MMD
# C compiler flags
CFLAGS := -Ivec -std=c11 -g -O1

# -L
#    where to look for libraries
# -lvec
#    link the 'vec' library (look for libvec.o)
# -Wl,-rpath,'$$ORIGIN'
#    look for the library in the ORIGIN (current) directory
LDFLAGS := -Lvec -lvec -Wl,-rpath,'$$ORIGIN/vec'

# change remove command to be more descriptive
RM := rm -vf

# rules that do not depend on a file being created
.PHONY: all clean

# default "make" rule
all : libvec test

# test depends on test.o
test : test.o

# cleans up all created files
clean :
	-@${RM} test
	-@${RM} $(wildcard *.o)
	-@make -C vec clean

# how to make the library
libvec:
	make -C vec
