19750e409Sopenharmony_ci# ==========================================
29750e409Sopenharmony_ci#   Unity Project - A Test Framework for C
39750e409Sopenharmony_ci#   Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
49750e409Sopenharmony_ci#   [Released under MIT License. Please refer to license.txt for details]
59750e409Sopenharmony_ci# ==========================================
69750e409Sopenharmony_ci
79750e409Sopenharmony_ci#We try to detect the OS we are running on, and adjust commands as needed
89750e409Sopenharmony_ciifeq ($(OS),Windows_NT)
99750e409Sopenharmony_ci  ifeq ($(shell uname -s),) # not in a bash-like shell
109750e409Sopenharmony_ci	CLEANUP = del /F /Q
119750e409Sopenharmony_ci	MKDIR = mkdir
129750e409Sopenharmony_ci  else # in a bash-like shell, like msys
139750e409Sopenharmony_ci	CLEANUP = rm -f
149750e409Sopenharmony_ci	MKDIR = mkdir -p
159750e409Sopenharmony_ci  endif
169750e409Sopenharmony_ci	TARGET_EXTENSION=.exe
179750e409Sopenharmony_cielse
189750e409Sopenharmony_ci	CLEANUP = rm -f
199750e409Sopenharmony_ci	MKDIR = mkdir -p
209750e409Sopenharmony_ci	TARGET_EXTENSION=.out
219750e409Sopenharmony_ciendif
229750e409Sopenharmony_ci
239750e409Sopenharmony_ciC_COMPILER=gcc
249750e409Sopenharmony_ciifeq ($(shell uname -s), Darwin)
259750e409Sopenharmony_ciC_COMPILER=clang
269750e409Sopenharmony_ciendif
279750e409Sopenharmony_ci
289750e409Sopenharmony_ciUNITY_ROOT=../..
299750e409Sopenharmony_ci
309750e409Sopenharmony_ciCFLAGS=-std=c89
319750e409Sopenharmony_ciCFLAGS += -Wall
329750e409Sopenharmony_ciCFLAGS += -Wextra
339750e409Sopenharmony_ciCFLAGS += -Wpointer-arith
349750e409Sopenharmony_ciCFLAGS += -Wcast-align
359750e409Sopenharmony_ciCFLAGS += -Wwrite-strings
369750e409Sopenharmony_ciCFLAGS += -Wswitch-default
379750e409Sopenharmony_ciCFLAGS += -Wunreachable-code
389750e409Sopenharmony_ciCFLAGS += -Winit-self
399750e409Sopenharmony_ciCFLAGS += -Wmissing-field-initializers
409750e409Sopenharmony_ciCFLAGS += -Wno-unknown-pragmas
419750e409Sopenharmony_ciCFLAGS += -Wstrict-prototypes
429750e409Sopenharmony_ciCFLAGS += -Wundef
439750e409Sopenharmony_ciCFLAGS += -Wold-style-definition
449750e409Sopenharmony_ci
459750e409Sopenharmony_ciTARGET_BASE1=test1
469750e409Sopenharmony_ciTARGET_BASE2=test2
479750e409Sopenharmony_ciTARGET1 = $(TARGET_BASE1)$(TARGET_EXTENSION)
489750e409Sopenharmony_ciTARGET2 = $(TARGET_BASE2)$(TARGET_EXTENSION)
499750e409Sopenharmony_ciSRC_FILES1=$(UNITY_ROOT)/src/unity.c src/ProductionCode.c  test/TestProductionCode.c  test/test_runners/TestProductionCode_Runner.c
509750e409Sopenharmony_ciSRC_FILES2=$(UNITY_ROOT)/src/unity.c src/ProductionCode2.c test/TestProductionCode2.c test/test_runners/TestProductionCode2_Runner.c
519750e409Sopenharmony_ciINC_DIRS=-Isrc -I$(UNITY_ROOT)/src
529750e409Sopenharmony_ciSYMBOLS=
539750e409Sopenharmony_ci
549750e409Sopenharmony_ciall: clean default
559750e409Sopenharmony_ci
569750e409Sopenharmony_cidefault: $(SRC_FILES1) $(SRC_FILES2)
579750e409Sopenharmony_ci	$(C_COMPILER) $(CFLAGS) $(INC_DIRS) $(SYMBOLS) $(SRC_FILES1) -o $(TARGET1)
589750e409Sopenharmony_ci	$(C_COMPILER) $(CFLAGS) $(INC_DIRS) $(SYMBOLS) $(SRC_FILES2) -o $(TARGET2)
599750e409Sopenharmony_ci	- ./$(TARGET1)
609750e409Sopenharmony_ci	./$(TARGET2)
619750e409Sopenharmony_ci
629750e409Sopenharmony_citest/test_runners/TestProductionCode_Runner.c: test/TestProductionCode.c
639750e409Sopenharmony_ci	ruby $(UNITY_ROOT)/auto/generate_test_runner.rb test/TestProductionCode.c  test/test_runners/TestProductionCode_Runner.c
649750e409Sopenharmony_citest/test_runners/TestProductionCode2_Runner.c: test/TestProductionCode2.c
659750e409Sopenharmony_ci	ruby $(UNITY_ROOT)/auto/generate_test_runner.rb test/TestProductionCode2.c test/test_runners/TestProductionCode2_Runner.c
669750e409Sopenharmony_ci
679750e409Sopenharmony_ciclean:
689750e409Sopenharmony_ci	$(CLEANUP) $(TARGET1) $(TARGET2)
699750e409Sopenharmony_ci
709750e409Sopenharmony_cici: CFLAGS += -Werror
719750e409Sopenharmony_cici: default
72