Makefile 999 字节
Newer Older
1
CC = gcc
2 3 4 5
CFLAGS += -Werror
CFLAGS += -std=c99
CFLAGS += -pedantic
CFLAGS += -Wundef
6 7 8 9 10 11 12 13 14
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/
15
TARGET = ../build/fixture_tests.exe
16

17 18
all: default noStdlibMalloc 32bits

19
default: ../build/
20
	$(CC) $(CFLAGS) $(DEFINES) $(SRC) $(INC_DIR) -o $(TARGET)
21 22 23
	@ echo "default build"
	./$(TARGET)

24
32bits: ../build/
25 26
	$(CC) $(CFLAGS) $(DEFINES) $(SRC) $(INC_DIR) -o $(TARGET) -m32
	@ echo "32bits build"
27
	./$(TARGET)
28

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

clangEverything:
	$(CC) $(CFLAGS) $(DEFINES) $(SRC) $(INC_DIR) -o $(TARGET) -m64 -Weverything # || true #prevents make from failing
36 37 38

../build :
	mkdir -p ../build