135375f98Sopenharmony_ci# ========================================== 235375f98Sopenharmony_ci# Unity Project - A Test Framework for C 335375f98Sopenharmony_ci# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams 435375f98Sopenharmony_ci# [Released under MIT License. Please refer to license.txt for details] 535375f98Sopenharmony_ci# ========================================== 635375f98Sopenharmony_ci 735375f98Sopenharmony_ci#We try to detect the OS we are running on, and adjust commands as needed 835375f98Sopenharmony_ciifeq ($(OS),Windows_NT) 935375f98Sopenharmony_ci ifeq ($(shell uname -s),) # not in a bash-like shell 1035375f98Sopenharmony_ci CLEANUP = del /F /Q 1135375f98Sopenharmony_ci MKDIR = mkdir 1235375f98Sopenharmony_ci else # in a bash-like shell, like msys 1335375f98Sopenharmony_ci CLEANUP = rm -f 1435375f98Sopenharmony_ci MKDIR = mkdir -p 1535375f98Sopenharmony_ci endif 1635375f98Sopenharmony_ci TARGET_EXTENSION=.exe 1735375f98Sopenharmony_cielse 1835375f98Sopenharmony_ci CLEANUP = rm -f 1935375f98Sopenharmony_ci MKDIR = mkdir -p 2035375f98Sopenharmony_ci TARGET_EXTENSION=.out 2135375f98Sopenharmony_ciendif 2235375f98Sopenharmony_ci 2335375f98Sopenharmony_ciC_COMPILER=gcc 2435375f98Sopenharmony_ciifeq ($(shell uname -s), Darwin) 2535375f98Sopenharmony_ciC_COMPILER=clang 2635375f98Sopenharmony_ciendif 2735375f98Sopenharmony_ci 2835375f98Sopenharmony_ciUNITY_ROOT=../.. 2935375f98Sopenharmony_ci 3035375f98Sopenharmony_ciCFLAGS=-std=c99 3135375f98Sopenharmony_ciCFLAGS += -Wall 3235375f98Sopenharmony_ciCFLAGS += -Wextra 3335375f98Sopenharmony_ciCFLAGS += -Wpointer-arith 3435375f98Sopenharmony_ciCFLAGS += -Wcast-align 3535375f98Sopenharmony_ciCFLAGS += -Wwrite-strings 3635375f98Sopenharmony_ciCFLAGS += -Wswitch-default 3735375f98Sopenharmony_ciCFLAGS += -Wunreachable-code 3835375f98Sopenharmony_ciCFLAGS += -Winit-self 3935375f98Sopenharmony_ciCFLAGS += -Wmissing-field-initializers 4035375f98Sopenharmony_ciCFLAGS += -Wno-unknown-pragmas 4135375f98Sopenharmony_ciCFLAGS += -Wstrict-prototypes 4235375f98Sopenharmony_ciCFLAGS += -Wundef 4335375f98Sopenharmony_ciCFLAGS += -Wold-style-definition 4435375f98Sopenharmony_ci#CFLAGS += -Wno-misleading-indentation 4535375f98Sopenharmony_ci 4635375f98Sopenharmony_ciTARGET_BASE1=all_tests 4735375f98Sopenharmony_ciTARGET1 = $(TARGET_BASE1)$(TARGET_EXTENSION) 4835375f98Sopenharmony_ciSRC_FILES1=\ 4935375f98Sopenharmony_ci $(UNITY_ROOT)/src/unity.c \ 5035375f98Sopenharmony_ci $(UNITY_ROOT)/extras/fixture/src/unity_fixture.c \ 5135375f98Sopenharmony_ci src/ProductionCode.c \ 5235375f98Sopenharmony_ci src/ProductionCode2.c \ 5335375f98Sopenharmony_ci test/TestProductionCode.c \ 5435375f98Sopenharmony_ci test/TestProductionCode2.c \ 5535375f98Sopenharmony_ci test/test_runners/TestProductionCode_Runner.c \ 5635375f98Sopenharmony_ci test/test_runners/TestProductionCode2_Runner.c \ 5735375f98Sopenharmony_ci test/test_runners/all_tests.c 5835375f98Sopenharmony_ciINC_DIRS=-Isrc -I$(UNITY_ROOT)/src -I$(UNITY_ROOT)/extras/fixture/src 5935375f98Sopenharmony_ciSYMBOLS=-DUNITY_FIXTURE_NO_EXTRAS 6035375f98Sopenharmony_ci 6135375f98Sopenharmony_ciall: clean default 6235375f98Sopenharmony_ci 6335375f98Sopenharmony_cidefault: 6435375f98Sopenharmony_ci $(C_COMPILER) $(CFLAGS) $(INC_DIRS) $(SYMBOLS) $(SRC_FILES1) -o $(TARGET1) 6535375f98Sopenharmony_ci - ./$(TARGET1) -v 6635375f98Sopenharmony_ci 6735375f98Sopenharmony_ciclean: 6835375f98Sopenharmony_ci $(CLEANUP) $(TARGET1) 6935375f98Sopenharmony_ci 7035375f98Sopenharmony_cici: CFLAGS += -Werror 7135375f98Sopenharmony_cici: default 72