+##################################################
+#Desc: Missing CLib Generator
+#Author: Mihrtec LLC
+#Date: 2016
+##################################################
+#Included from buildc.make
+#Defines vars for automatically downloading,
+#compiling, and linking GNU-like C libraries
+##################################################
+
+#Missing libraries will be downloaded
+#to MLSRCDIR and installed at MLLIBDIR
+MLDIR := /usr/local
+MLSRCDIR := $(MLDIR)/src
+#If we aren't compiling for our own environment,
+#we need to create a directory for that type of
+#transpiled library
+ARCHLOCAL := $(shell uname -m | grep "$(CARCH)")
+MLLIBDIR := $(if $(ARCHLOCAL),$(MLDIR)/lib,$(MLDIR)/lib$(CARCH))
+
+#Modify the dependency generator to find the right directory for
+#missing lib includes (they are in MLDIR/src/libname/libname)
+CDEPSCOMMAND += $(patsubst %, | sed -e 's@ \(%\)/@$(MLSRCDIR)/\1/\1/@',$(MISSINGLIBS))
+
+#Automake vars for building libs
+AMGEN ?= ./autogen.sh
+AMCONF ?= ./configure
+AMMAKE ?= make
+
+#Import the headers for each missing library (XTDIR/LIBNAME)
+CFLAGS += -L$(MLLIBDIR) $(patsubst %,-I$(MLSRCDIR)/%,$(MISSINGLIBS))
+
+#Notify user of libraries that are about to be built
+$(info Libraries to be built in $(MLLIBDIR):)
+$(info $(patsubst %,lib%.so,$(MISSINGLIBS)))
+STATICLIBS := $(patsubst %,$(MLLIBDIR)/lib%.so,$(MISSINGLIBS))
+
+#Ensure that C files depend on the creation of these static libs
+CDEPS += $(STATICLIBS)
+