Makefile: Fix make distcheck
[platform/upstream/neard.git] / Makefile.am
1
2 AM_MAKEFLAGS = --no-print-directory
3
4 includedir = @includedir@/near
5
6 include_HEADERS = include/types.h include/log.h include/plugin.h \
7                         include/tag.h
8
9 nodist_include_HEADERS = include/version.h
10
11 noinst_HEADERS = include/dbus.h
12
13 local_headers = $(foreach file,$(include_HEADERS) $(nodist_include_HEADERS) \
14                         $(noinst_HEADERS), include/near/$(notdir $(file)))
15
16 gdbus_sources = gdbus/gdbus.h gdbus/mainloop.c gdbus/watch.c \
17                                         gdbus/object.c gdbus/polkit.c
18
19 builtin_modules =
20 builtin_sources =
21 builtin_cflags =
22 builtin_libadd =
23
24 libexec_PROGRAMS = src/neard
25
26 src_neard_SOURCES = $(gdbus_sources) $(gweb_sources) $(builtin_sources) \
27                         src/main.c src/error.c src/near.h src/log.c \
28                         src/dbus.c src/manager.c src/adapter.c src/target.c \
29                         src/tag.c src/plugin.c src/netlink.c
30
31 src_neard_LDADD = $(builtin_libadd) @GLIB_LIBS@ @DBUS_LIBS@ @NETLINK_LIBS@ -lresolv -ldl
32
33 src_neard_LDFLAGS = -Wl,--export-dynamic
34
35 nodist_src_neard_SOURCES = src/builtin.h
36
37 AM_CFLAGS = @GLIB_CFLAGS@ @DBUS_CFLAGS@ @NETLINK_CFLAGS@ $(builtin_cflags) \
38                                         -DNEARD_PLUGIN_BUILTIN \
39                                         -DPLUGINDIR=\""$(plugindir)"\"
40
41 INCLUDES = -I$(builddir)/include -I$(builddir)/src -I$(srcdir)/gdbus
42
43 CLEANFILES = src/builtin.h $(local_headers)
44
45 doc_files = doc/manager-api.txt doc/target-api.txt doc/adapter-api.txt
46
47 EXTRA_DIST = src/genbuiltin $(doc_files)
48
49 test_scripts = test/list-adapters
50
51 if TEST
52 testdir = $(pkglibdir)/test
53 test_SCRIPTS = $(test_scripts)
54 endif
55
56 EXTRA_DIST += $(test_scripts)
57
58 MAINTAINERCLEANFILES = Makefile.in \
59         aclocal.m4 configure config.h.in config.sub config.guess \
60         ltmain.sh depcomp compile missing install-sh mkinstalldirs
61
62 src/plugin.$(OBJEXT): src/builtin.h
63
64 src/builtin.h: src/genbuiltin $(builtin_sources)
65         $(AM_V_GEN)$(srcdir)/src/genbuiltin $(builtin_modules) > $@
66
67 $(src_neard_OBJECTS) $(plugin_objects): $(local_headers)
68
69 include/near/version.h: include/version.h
70         $(AM_V_at)$(MKDIR_P) include/near
71         $(AM_V_GEN)$(LN_S) $(abs_top_builddir)/$< $@
72
73 include/near/%.h: include/%.h
74         $(AM_V_at)$(MKDIR_P) include/near
75         $(AM_V_GEN)$(LN_S) $(abs_top_srcdir)/$< $@
76
77 clean-local:
78         @$(RM) -rf include/near