# library name
LIB_NAME := vec

# sources for our library
LIB_SRCS := vecadd.c vecdot.c

# object files are .c replaced with .o
LIB_OBJS := $(LIB_SRCS:.c=.o)

# shared object filename to generate
LIBRARY_SO := lib${LIB_NAME}.so

# rule for our library (libvec depends on libvec.so)
libvec : ${LIBRARY_SO}

# rule for building our shared object file
${LIBRARY_SO} : ${LIB_OBJS}
	${CC} -shared $^ -o $@

clean :
	-@${RM} $(wildcard *.o)
	-@${RM} libvec.so
