-
Notifications
You must be signed in to change notification settings - Fork 21
/
Makefile
39 lines (27 loc) · 1.14 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
SPEC = FIX44
BIN = fullfix-test
.PHONY: release debug release32
release debug release32 : $(BIN)
# specification
# (http://stackoverflow.com/questions/2973445/gnu-makefile-rule-generating-a-few-targets-from-a-single-source-file)
include/$(SPEC).h test/$(SPEC).c : $(SPEC).done
.INTERMEDIATE : $(SPEC).done
$(SPEC).done : test/$(SPEC).xml tools/compile-spec
tools/compile-spec -s test test/$(SPEC).xml
# compilation
CC = gcc -std=c11
release release32 : CFLAGS = -O3 -s -Wall -Wextra -Iinclude -march=native -mtune=native \
-fomit-frame-pointer -Wl,--as-needed -flto -ffunction-sections -fdata-sections -Wl,--gc-sections \
-DNDEBUG -DRELEASE -DUSE_SSE
debug : CFLAGS = -g -Wall -Wextra -Iinclude -march=native -DDEBUG -DUSE_SSE
release32 : CFLAGS += -mx32
SRC = src/parser.c src/scanner.c src/utils.c src/converters.c \
test/main.c test/scanner_test.c test/parser_test.c test/test_utils.c test/utils_test.c \
test/random_test.c test/$(SPEC).c
HEADERS = include/fix.h include/$(SPEC).h src/fix_impl.h test/test_utils.h
$(BIN) : $(SRC) $(HEADERS)
$(CC) -o $@ $(CFLAGS) $(SRC)
# clean-up
.PHONY : clean
clean :
rm -f include/$(SPEC).h test/$(SPEC).c $(BIN)