blob: 1084eec46724175cb163d7c0255bd725ae80ac2a [file] [log] [blame]
Jeremy Kerr4cdc2002019-02-07 16:49:12 +08001
2CC = gcc
3AR = ar
4CFLAGS = -Wall -Wextra -Werror -ggdb
5CPPFLAGS = -DMCTP_LOG_STDERR -DMCTP_FILEIO -I$(LIBMCTP_DIR)
6
7LIBMCTP_DIR=./
8
9include Makefile.inc
10
11all: $(LIBMCTP)
12
13libmctp.a:
14 $(AR) rcsTPD $@ $^
15
Jeremy Kerrbd4e3622019-03-13 15:20:42 +080016utils/%: utils/%.o libmctp.a
Jeremy Kerr4cdc2002019-02-07 16:49:12 +080017 $(LINK.o) -o $@ $^
18
Jeremy Kerr18925112019-03-13 15:43:08 +080019test_util_objs = tests/test-utils.o
20
Jeremy Kerrba076942019-03-13 16:20:34 +080021tests = test_eid test_seq
Jeremy Kerr18925112019-03-13 15:43:08 +080022
23test_targets = $(tests:%=tests/%)
24
25$(test_targets): $(test_util_objs) libmctp.a
26
27$(test_targets): %: %.o
28 $(LINK.o) -o $@ $^
29
30check: $(test_targets)
31 for t in $(test_targets); do echo $$t; $$t || exit 1; done
32
33.PHONY: check
34
Jeremy Kerr4cdc2002019-02-07 16:49:12 +080035clean:
36 rm -f $(LIBMCTP)
37 rm -f $(LIBMCTP_OBJS)
38 rm -f tests/*.o