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=c89
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=test1
4735375f98Sopenharmony_ciTARGET_BASE2=test2
4835375f98Sopenharmony_ciTARGET1 = $(TARGET_BASE1)$(TARGET_EXTENSION)
4935375f98Sopenharmony_ciTARGET2 = $(TARGET_BASE2)$(TARGET_EXTENSION)
5035375f98Sopenharmony_ciSRC_FILES1=$(UNITY_ROOT)/src/unity.c src/ProductionCode.c  test/TestProductionCode.c  test/test_runners/TestProductionCode_Runner.c
5135375f98Sopenharmony_ciSRC_FILES2=$(UNITY_ROOT)/src/unity.c src/ProductionCode2.c test/TestProductionCode2.c test/test_runners/TestProductionCode2_Runner.c
5235375f98Sopenharmony_ciINC_DIRS=-Isrc -I$(UNITY_ROOT)/src
5335375f98Sopenharmony_ciSYMBOLS=
5435375f98Sopenharmony_ci
5535375f98Sopenharmony_ciall: clean default
5635375f98Sopenharmony_ci
5735375f98Sopenharmony_cidefault: $(SRC_FILES1) $(SRC_FILES2)
5835375f98Sopenharmony_ci	$(C_COMPILER) $(CFLAGS) $(INC_DIRS) $(SYMBOLS) $(SRC_FILES1) -o $(TARGET1)
5935375f98Sopenharmony_ci	$(C_COMPILER) $(CFLAGS) $(INC_DIRS) $(SYMBOLS) $(SRC_FILES2) -o $(TARGET2)
6035375f98Sopenharmony_ci	- ./$(TARGET1)
6135375f98Sopenharmony_ci	- ./$(TARGET2)
6235375f98Sopenharmony_ci
6335375f98Sopenharmony_citest/test_runners/TestProductionCode_Runner.c: test/TestProductionCode.c
6435375f98Sopenharmony_ci	ruby $(UNITY_ROOT)/auto/generate_test_runner.rb test/TestProductionCode.c  test/test_runners/TestProductionCode_Runner.c
6535375f98Sopenharmony_citest/test_runners/TestProductionCode2_Runner.c: test/TestProductionCode2.c
6635375f98Sopenharmony_ci	ruby $(UNITY_ROOT)/auto/generate_test_runner.rb test/TestProductionCode2.c test/test_runners/TestProductionCode2_Runner.c
6735375f98Sopenharmony_ci
6835375f98Sopenharmony_ciclean:
6935375f98Sopenharmony_ci	$(CLEANUP) $(TARGET1) $(TARGET2)
7035375f98Sopenharmony_ci
7135375f98Sopenharmony_cici: CFLAGS += -Werror
7235375f98Sopenharmony_cici: default
73