interplane.Get Omega
Read in your language

cJSON

[Ported from github.com/DaveGamble/cJSON] Fix: heap-use-after-free in merge_patch when patch is subtree of target (#1065)

Brought by drakestapleton

branch master Branches Tags History

cJSON / tests / unity / examples / example_1 / makefile

71 lines · 2237 bytes Raw Blame History
1# ==========================================
2# Unity Project - A Test Framework for C
3# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
4# [Released under MIT License. Please refer to license.txt for details]
5# ==========================================
6
7#We try to detect the OS we are running on, and adjust commands as needed
8ifeq ($(OS),Windows_NT)
9 ifeq ($(shell uname -s),) # not in a bash-like shell
10 CLEANUP = del /F /Q
11 MKDIR = mkdir
12 else # in a bash-like shell, like msys
13 CLEANUP = rm -f
14 MKDIR = mkdir -p
15 endif
16 TARGET_EXTENSION=.exe
17else
18 CLEANUP = rm -f
19 MKDIR = mkdir -p
20 TARGET_EXTENSION=.out
21endif
22
23C_COMPILER=gcc
24ifeq ($(shell uname -s), Darwin)
25C_COMPILER=clang
26endif
27
28UNITY_ROOT=../..
29
30CFLAGS=-std=c89
31CFLAGS += -Wall
32CFLAGS += -Wextra
33CFLAGS += -Wpointer-arith
34CFLAGS += -Wcast-align
35CFLAGS += -Wwrite-strings
36CFLAGS += -Wswitch-default
37CFLAGS += -Wunreachable-code
38CFLAGS += -Winit-self
39CFLAGS += -Wmissing-field-initializers
40CFLAGS += -Wno-unknown-pragmas
41CFLAGS += -Wstrict-prototypes
42CFLAGS += -Wundef
43CFLAGS += -Wold-style-definition
44
45TARGET_BASE1=test1
46TARGET_BASE2=test2
47TARGET1 = $(TARGET_BASE1)$(TARGET_EXTENSION)
48TARGET2 = $(TARGET_BASE2)$(TARGET_EXTENSION)
49SRC_FILES1=$(UNITY_ROOT)/src/unity.c src/ProductionCode.c test/TestProductionCode.c test/test_runners/TestProductionCode_Runner.c
50SRC_FILES2=$(UNITY_ROOT)/src/unity.c src/ProductionCode2.c test/TestProductionCode2.c test/test_runners/TestProductionCode2_Runner.c
51INC_DIRS=-Isrc -I$(UNITY_ROOT)/src
52SYMBOLS=
53
54all: clean default
55
56default: $(SRC_FILES1) $(SRC_FILES2)
57 $(C_COMPILER) $(CFLAGS) $(INC_DIRS) $(SYMBOLS) $(SRC_FILES1) -o $(TARGET1)
58 $(C_COMPILER) $(CFLAGS) $(INC_DIRS) $(SYMBOLS) $(SRC_FILES2) -o $(TARGET2)
59 - ./$(TARGET1)
60 ./$(TARGET2)
61
62test/test_runners/TestProductionCode_Runner.c: test/TestProductionCode.c
63 ruby $(UNITY_ROOT)/auto/generate_test_runner.rb test/TestProductionCode.c test/test_runners/TestProductionCode_Runner.c
64test/test_runners/TestProductionCode2_Runner.c: test/TestProductionCode2.c
65 ruby $(UNITY_ROOT)/auto/generate_test_runner.rb test/TestProductionCode2.c test/test_runners/TestProductionCode2_Runner.c
66
67clean:
68 $(CLEANUP) $(TARGET1) $(TARGET2)
69
70ci: CFLAGS += -Werror
71ci: default