Makefile 1.4 KB
Newer Older
1
CC = gcc
2
#DEBUG = -O0 -g
3 4
CFLAGS += -std=c99
CFLAGS += -pedantic
5 6 7 8
CFLAGS += -Wall
CFLAGS += -Wextra
CFLAGS += -Werror
CFLAGS += $(DEBUG)
9 10 11 12 13 14 15 16 17
DEFINES = -D UNITY_OUTPUT_CHAR=UnityOutputCharSpy_OutputChar
SRC = ../src/unity_fixture.c \
      ../../../src/unity.c   \
      unity_fixture_Test.c   \
      unity_fixture_TestRunner.c \
      unity_output_Spy.c     \
      main/AllTests.c

INC_DIR = -I../src -I../../../src/
18
TARGET = ../build/fixture_tests.exe
19

20 21
all: default noStdlibMalloc 32bits

22
default: ../build/
23
	$(CC) $(CFLAGS) $(DEFINES) $(SRC) $(INC_DIR) -o $(TARGET)
24 25 26
	@ echo "default build"
	./$(TARGET)

27
32bits: ../build/
28 29
	$(CC) $(CFLAGS) $(DEFINES) $(SRC) $(INC_DIR) -o $(TARGET) -m32
	@ echo "32bits build"
30
	./$(TARGET)
31

32
noStdlibMalloc: ../build/
33 34 35 36 37
	$(CC) $(CFLAGS) $(DEFINES) $(SRC) $(INC_DIR) -o $(TARGET) -D UNITY_EXCLUDE_STDLIB_MALLOC
	@ echo "build with noStdlibMalloc"
	./$(TARGET)

clangEverything:
38
	clang $(CFLAGS) $(DEFINES) $(SRC) $(INC_DIR) -o $(TARGET) -m64 -Weverything
39 40 41

../build :
	mkdir -p ../build
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60

clean:
	rm -f $(TARGET)

# These extended flags DO get included before any target build runs
CFLAGS += -Wbad-function-cast
CFLAGS += -Wcast-qual
#CFLAGS += -Wconversion
CFLAGS += -Wformat=2
CFLAGS += -Wmissing-prototypes
CFLAGS += -Wold-style-definition
CFLAGS += -Wpointer-arith
CFLAGS += -Wshadow
CFLAGS += -Wstrict-overflow=5
CFLAGS += -Wstrict-prototypes
CFLAGS += -Wswitch-default
CFLAGS += -Wundef
CFLAGS += -Wunused
CFLAGS += -fstrict-aliasing