editted 10/17/2014 I forgot some stuff.
@Hootie81 and @peekay123 thanks for the posts and work. Below is how I implemented local libraries. A big goal for me was to be able to import (clone) the libraries right from the github repositories if they are already in the correct format for a spark library. So this whole process assume the library is compliant with the spark library format. This is really all copied from bootie and peekay (thanks again).
First navigate to the libraries folder in the "core_firmware folder. Then clone the library you want to use.
//clone library into "libraries" directory I was getting the adafruit
//DHT22 library
$ pwd
<your path>/spark/core-firmware/libraries
$ git clone https://github.com/russgrue/Adafruit_DHT_Library.git
Navigate to the “firmware” folder
$ cd Adafruit_DHT_Library/firmware
Now add the build.mk file in the “firmware” folder
$ touch build.mk
edit the build.mk like the following. Anywhere you need stuff like “ADAFRUIT” OR “ADAFRUIT_DHT” you need to change it for your library.
# This file is a makefile included from the top level makefile which
# defines the sources built for the target.
# Define the prefix to this directory.
# Note: The name must be unique within this build and should be
# based on the root of the project
TARGET_ADAFRUIT_DHT_PATH = libraries/Adafruit_DHT_Library/firmware
TARGET_ADAFRRUIT_DHT_SRC_PATH = $(TARGET_ADAFRUIT_DHT_PATH)
# Add include paths.
INCLUDE_DIRS += $(TARGET_ADAFRUIT_DHT_PATH)
# C source files included in this build.
CSRC +=
# C++ source files included in this build.
CPPSRC += $(TARGET_ADAFRRUIT_DHT_SRC_PATH)/Adafruit_DHT.cpp
# ASM source files included in this build.
ASRC +=
Now your almost done.
Note my local source code here <your path>/spark/core-firmware/applications/<project name>/application.cpp
WAS (in the web ide)
// This #include statement was automatically added by the Spark IDE.
#include "Adafruit_DHT/Adafruit_DHT.h"
CHANGE TO (in the local code).
#include "Adafruit_DHT.h"
modify the “makefile” @
<your path>/spark/core-firmware/build/makefile
change around line 87 (see below)
# Find all build.mk makefiles in each source directory in the src tree.
#was SRC_MAKEFILES := $(call rwildcard,$(SRC_PATH)src,build.mk) #was
SRC_MAKEFILES := $(call rwildcard,$(SRC_PATH),build.mk) # is
in make file (around line 99) add: (third line down)
# Include directories for optional "libraries" (eg. Serial2.h)
INCLUDE_DIRS += $(LIB_CORE_LIBRARIES_PATH)Serial2 #already there
INCLUDE_DIRS += $(LIB_CORE_LIBRARIES_PATH)Adafruit_DHT_Library/firmware
Navigate to “build” directory
<your path>/spark/core-firmware/build
make the program and load it
$ make APP=<project name>TARGET=core-firmware
$ dfu-util -d 1234:4567 -a 0 -s 0x08005000:leave -D core-firmware.bin
Maybe that we help someone. I know it will help me when I forget how to do this (so like sometime tomorrow).