1 # copyright 2016 Apache 2 sddekit authors
5 VALFLAGS
= --error-exitcode
=1 --track-origins
=yes
--leak-check
=full
6 CFLAGS
= -std
=c99
-Isrc
8 # various build types {{{
11 else ifeq ($(BUILD
),cov
)
12 CFLAGS
+= -pg
-fprofile-arcs
-ftest-coverage
14 CFLAGS
+= -Wall
-Wextra
-Og
-g
19 c_lib
=$(wildcard src
/*.c
)
20 c_test
=$(wildcard test/test_
*.c
)
21 o_lib
=$(patsubst src
/%.c
,%.o
,$(c_lib
))
22 o_test
=$(patsubst test/%.c
,%.o
,$(c_test
))
25 # platform specific stuff (http://stackoverflow.com/q/19928965) {{{
26 ifeq ($(OS
),Windows_NT
)
44 test: $(o_lib
) $(o_test
)
45 $(CC
) $(CFLAGS
) test/main.c
$^
-o
test$(BUILD
) $(LDFLAGS
)
47 libSDDEKit.
$(DLLEXT
): $(o_lib
)
48 $(CC
) -shared
$^
-o libSDDEKit.
$(DLLEXT
) $(LDFLAGS
)
51 $(RM
) $(o_lib
) $(o_test
) test* *.dat
*.exe
*.
$(DLLEXT
)
58 $(CC
) $(CFLAGS
) -c
$< $(LDFLAGS
)
61 $(CC
) $(CFLAGS
) -c
$< $(LDFLAGS
)
64 $(CC
) $(CFLAGS
) $< $(o_lib
) $(LDFLAGS
)
68 # vim: foldmethod=marker