-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.am
123 lines (83 loc) · 2.53 KB
/
Makefile.am
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
## Autotools settings
ACLOCAL_AMFLAGS = -I m4
EXTRA_DIST = \
autogen.sh \
src/templates/base.html \
src/static/resources.xml \
src/static/main.css \
src/static/balde-logo.ico \
src/static/balde-logo.png
CLEANFILES =
noinst_LTLIBRARIES = \
libfoo.la
noinst_HEADERS = \
src/foo.h
bin_PROGRAMS = \
balde-website
check_PROGRAMS = \
tests/check_foo
TESTS = \
$(check_PROGRAMS)
## Build rules: convenience library
libfoo_la_SOURCES = \
src/foo.c
libfoo_la_CFLAGS = \
$(BALDE_CFLAGS) \
-I$(top_srcdir)/src
libfoo_la_LIBADD = \
$(BALDE_LIBS)
### Templates (add 2 rules per template, one for .c and one for .h)
src/templates/base.c: $(shell $(BALDE_TEMPLATE_GEN) --generate-dependencies $(top_srcdir)/src/templates/base.html)
$(AM_V_GEN)$(BALDE_TEMPLATE_GEN) $< $@
src/templates/base.h: $(shell $(BALDE_TEMPLATE_GEN) --generate-dependencies $(top_srcdir)/src/templates/base.html)
$(AM_V_GEN)$(BALDE_TEMPLATE_GEN) $< $@
### Static resources
src/static/resources.c: src/static/resources.xml $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies --sourcedir $(top_srcdir)/src/static $(top_srcdir)/src/static/resources.xml)
$(AM_V_GEN)$(GLIB_COMPILE_RESOURCES) --generate --sourcedir $(top_srcdir)/src/static --target $@ $<
src/static/resources.h: src/static/resources.xml $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies --sourcedir $(top_srcdir)/src/static $(top_srcdir)/src/static/resources.xml)
$(AM_V_GEN)$(GLIB_COMPILE_RESOURCES) --generate --sourcedir $(top_srcdir)/src/static --target $@ $<
## Build rules: binary
balde_website_SOURCES = \
src/main.c
nodist_balde_website_SOURCES = \
src/templates/base.c \
src/templates/base.h \
src/static/resources.c \
src/static/resources.h
src/balde_website-main.$(OBJEXT): $(nodist_balde_website_SOURCES)
balde_website_CFLAGS = \
$(BALDE_CFLAGS) \
-I$(top_builddir)/src \
-I$(top_srcdir)/src
balde_website_LDADD = \
libfoo.la \
$(BALDE_LIBS)
## Build rules: tests
tests_check_foo_SOURCES = \
tests/check_foo.c
tests_check_foo_CFLAGS = \
$(BALDE_CFLAGS) \
-I$(top_srcdir)/src
tests_check_foo_LDFLAGS = \
-no-install
tests_check_foo_LDADD = \
libfoo.la \
$(BALDE_LIBS)
## Helpers: Local clean
clean-local:
rm -f src/{templates,static}/*.{c,h}
## Helpers: Valgrind runners
if USE_VALGRIND
valgrind: all
$(MAKE) check TESTS_ENVIRONMENT=" \
G_SLICE=always-malloc \
G_DEBUG=gc-friendly \
$(LIBTOOL) \
--mode=execute \
$(VALGRIND) \
--tool=memcheck \
--leak-check=full \
--leak-resolution=high \
--num-callers=20 \
--show-possibly-lost=no"
endif