1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright 2016, Olivier MATZ <zer0@droids-corp.org>
5 include $(ECOLI)/mk/ecoli-pre.mk
7 # output path with trailing slash
11 CFLAGS = -g -O0 -Wall -Werror -W -Wextra -fPIC -Wmissing-prototypes
12 CFLAGS += -Ilibecoli -Ilibecoli_yaml -Ilibecoli_editline
17 # rm -rf build; rm -rf result; make && ./build/test
18 # lcov -d build -c -t build/test -o test.info && genhtml -o result test.info
22 srcs += ecoli_assert.c
23 srcs += ecoli_complete.c
24 srcs += ecoli_config.c
25 srcs += ecoli_keyval.c
28 srcs += ecoli_malloc.c
29 srcs += ecoli_murmurhash.c
30 srcs += ecoli_strvec.c
33 srcs += ecoli_node_any.c
34 srcs += ecoli_node_cmd.c
35 srcs += ecoli_node_empty.c
36 srcs += ecoli_node_expr.c
37 srcs += ecoli_node_expr_test.c
38 srcs += ecoli_node_dynamic.c
39 srcs += ecoli_node_file.c
40 srcs += ecoli_node_helper.c
41 srcs += ecoli_node_int.c
42 srcs += ecoli_node_many.c
43 srcs += ecoli_node_none.c
44 srcs += ecoli_node_once.c
45 srcs += ecoli_node_option.c
46 srcs += ecoli_node_or.c
47 srcs += ecoli_node_re.c
48 srcs += ecoli_node_re_lex.c
49 srcs += ecoli_node_seq.c
50 srcs += ecoli_node_sh_lex.c
51 srcs += ecoli_node_space.c
52 srcs += ecoli_node_str.c
53 srcs += ecoli_node_subset.c
55 srcs += ecoli_string.c
59 shlib-y-$(O)libecoli.so := $(addprefix libecoli/,$(srcs))
61 cflags-$(O)libecoli_yaml.so = -Ilibecoli_yaml
62 shlib-y-$(O)libecoli_yaml.so := libecoli_yaml/ecoli_yaml.c
64 cflags-$(O)libecoli_editline.so = -Ilibecoli_editline
65 shlib-y-$(O)libecoli_editline.so := libecoli_editline/ecoli_editline.c
68 ldflags-$(O)test = -rdynamic
69 exe-y-$(O)test = $(addprefix libecoli/,$(srcs)) test/test.c
72 ldflags-$(O)readline = -lreadline -ltermcap
73 exe-y-$(O)readline = $(addprefix libecoli/,$(srcs)) \
74 examples/readline/main.c
76 ldflags-$(O)parse-yaml = -lyaml -ledit
77 exe-y-$(O)parse-yaml = $(addprefix libecoli/,$(srcs)) \
78 libecoli_yaml/ecoli_yaml.c libecoli_editline/ecoli_editline.c\
79 examples/yaml/parse-yaml.c
81 include $(ECOLI)/mk/ecoli-post.mk