From 964a9bf46a1b36e81984df98f81171c81ed399a0 Mon Sep 17 00:00:00 2001 From: Greg Williams Date: Mon, 13 Apr 2015 13:54:06 -0400 Subject: [PATCH] Applied -DTEST to compilation of test and test support files in order to apply test build-specific stuff, if needed. --- scripts/create_makefile.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/create_makefile.rb b/scripts/create_makefile.rb index 0cc4429..e6dbdd3 100644 --- a/scripts/create_makefile.rb +++ b/scripts/create_makefile.rb @@ -34,6 +34,7 @@ File.open(TEST_MAKEFILE, "w") do |mkfile| mkfile.puts "BUILD_DIR ?= ./build" mkfile.puts "SRC_DIR ?= ./src" mkfile.puts "TEST_DIR ?= ./test" + mkfile.puts "TEST_CFLAGS ?= -DTEST" mkfile.puts "CMOCK_DIR ?= #{CMOCK_DIR}" mkfile.puts "UNITY_DIR ?= #{UNITY_DIR}" mkfile.puts "TEST_BUILD_DIR ?= ${BUILD_DIR}/test" @@ -80,7 +81,7 @@ File.open(TEST_MAKEFILE, "w") do |mkfile| # Build runner mkfile.puts "#{runner_obj}: #{runner_source}" - mkfile.puts "\t${CC} -o $@ -c $< -I #{SRC_DIR} -I #{MOCKS_DIR} -I #{UNITY_SRC} -I #{CMOCK_SRC}" + mkfile.puts "\t${CC} -o $@ -c $< ${TEST_CFLAGS} -I #{SRC_DIR} -I #{MOCKS_DIR} -I #{UNITY_SRC} -I #{CMOCK_SRC}" mkfile.puts "" # Collect mocks to generate @@ -113,7 +114,7 @@ File.open(TEST_MAKEFILE, "w") do |mkfile| # Build test suite mkfile.puts "#{test_obj}: #{test} #{module_obj} #{mock_objs.join(' ')}" - mkfile.puts "\t${CC} -o $@ -c $< -I #{SRC_DIR} -I #{UNITY_SRC} -I #{CMOCK_SRC} -I #{MOCKS_DIR}" + mkfile.puts "\t${CC} -o $@ -c $< ${TEST_CFLAGS} -I #{SRC_DIR} -I #{UNITY_SRC} -I #{CMOCK_SRC} -I #{MOCKS_DIR}" mkfile.puts "" # Build test suite executable @@ -142,7 +143,7 @@ File.open(TEST_MAKEFILE, "w") do |mkfile| mkfile.puts "" mkfile.puts "#{mock_obj}: #{mock_src} #{mock_header}" - mkfile.puts "\t${CC} -o $@ -c $< -I #{MOCKS_DIR} -I #{SRC_DIR} -I #{UNITY_SRC} -I #{CMOCK_SRC}" + mkfile.puts "\t${CC} -o $@ -c $< ${TEST_CFLAGS} -I #{MOCKS_DIR} -I #{SRC_DIR} -I #{UNITY_SRC} -I #{CMOCK_SRC}" mkfile.puts "" end