Added initial make build support into new scripts/ folder.

Moved temp sensor example into examples/temp_sensor.
Added basic make example in examples/make_example.
This commit is contained in:
Greg Williams
2015-04-07 13:37:51 -04:00
parent 78beb078c1
commit a86c281824
92 changed files with 302 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
CC ?= gcc
BUILD_DIR ?= ./build
SRC_DIR ?= ./src
TEST_DIR ?= ./test
#UNITY_DIR ?= ../../vendor/cmock/vendor/unity
#CMOCK_DIR ?= ../..
TEST_BUILD_DIR ?= ${BUILD_DIR}/test
TEST_MAKEFILE = ${TEST_BUILD_DIR}/MakefileTestSupport
OBJ ?= ${BUILD_DIR}/obj
OBJ_DIR = ${OBJ}
default: all
all: setup test ${BUILD_DIR}/main run
setup:
mkdir -p ${BUILD_DIR}
mkdir -p ${OBJ}
ruby ../../scripts/create_makefile.rb
clean:
rm -rf ${BUILD_DIR}
${BUILD_DIR}/main: ${SRC_DIR}/main.c ${SRC_DIR}/foo.c
${CC} $< -o $@
run:
./build/main
test: setup
-include ${TEST_MAKEFILE}