1#
2#  Copyright 2021 Northern.tech AS
3#
4#  This file is part of CFEngine 3 - written and maintained by Northern.tech AS.
5#
6#  This program is free software; you can redistribute it and/or modify it
7#  under the terms of the GNU General Public License as published by the
8#  Free Software Foundation; version 3.
9#
10#  This program is distributed in the hope that it will be useful,
11#  but WITHOUT ANY WARRANTY; without even the implied warranty of
12#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13#  GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program; if not, write to the Free Software
17# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
18#
19# To the extent this program is licensed as part of the Enterprise
20# versions of CFEngine, the applicable Commercial Open Source License
21# (COSL) may apply to this file if you as a licensee so wish it. See
22# included file COSL.txt.
23#
24noinst_LTLIBRARIES = libcf-agent.la
25
26AM_CPPFLAGS = -I$(srcdir)/../libpromises -I$(srcdir)/../libntech/libutils \
27	-I$(srcdir)/../libcfnet \
28	-I$(srcdir)/../cf-check \
29	@CPPFLAGS@ \
30	$(ENTERPRISE_CPPFLAGS) \
31	$(OPENSSL_CPPFLAGS) \
32	$(PCRE_CPPFLAGS) \
33	$(LIBVIRT_CPPFLAGS) \
34	$(POSTGRESQL_CPPFLAGS) \
35	$(MYSQL_CPPFLAGS) \
36	$(LIBXML2_CPPFLAGS) \
37	$(PAM_CPPFLAGS)
38
39AM_CFLAGS = \
40	@CFLAGS@ \
41	$(ENTERPRISE_CFLAGS) \
42	$(OPENSSL_CFLAGS) \
43	$(PCRE_CFLAGS) \
44	$(LIBVIRT_CFLAGS) \
45	$(POSTGRESQL_CFLAGS) \
46	$(MYSQL_CFLAGS) \
47	$(LIBXML2_CFLAGS) \
48	$(PAM_CFLAGS)
49
50AM_LDFLAGS = \
51	@LDFLAGS@ \
52	$(OPENSSL_LDFLAGS) \
53	$(PCRE_LDFLAGS) \
54	$(LIBVIRT_LDFLAGS) \
55	$(POSTGRESQL_LDFLAGS) \
56	$(MYSQL_LDFLAGS) \
57	$(LIBXML2_LDFLAGS) \
58	$(PAM_LDFLAGS)
59
60if FREEBSD
61    AM_LDFLAGS += -lutil
62endif
63
64libcf_agent_la_LIBADD = ../libpromises/libpromises.la \
65	$(OPENSSL_LIBS) \
66	$(PCRE_LIBS) \
67	$(LIBVIRT_LIBS) \
68	$(POSTGRESQL_LIBS) \
69	$(MYSQL_LIBS) \
70	$(LIBXML2_LIBS) \
71	$(PAM_LIBS)
72
73libcf_agent_la_SOURCES = \
74	agent-diagnostics.c agent-diagnostics.h \
75	simulate_mode.c simulate_mode.h \
76	tokyo_check.c tokyo_check.h \
77	abstract_dir.c abstract_dir.h \
78	cf-agent.c \
79	cf-agent-enterprise-stubs.c cf-agent-enterprise-stubs.h \
80	comparray.c comparray.h \
81	acl_posix.c acl_posix.h \
82	cf_sql.c cf_sql.h \
83	files_changes.c files_changes.h \
84	promiser_regex_resolver.c promiser_regex_resolver.h \
85	retcode.c retcode.h \
86	verify_acl.c verify_acl.h \
87	verify_files.c verify_files.h \
88	verify_files_utils.c verify_files_utils.h \
89	verify_files_hashes.c verify_files_hashes.h \
90	verify_storage.c verify_storage.h \
91	verify_exec.c verify_exec.h \
92	verify_methods.c verify_methods.h \
93	verify_databases.c verify_databases.h \
94	verify_processes.c verify_processes.h \
95	verify_services.c verify_services.h \
96	verify_environments.c verify_environments.h \
97	files_edit.c files_edit.h \
98	files_editline.c files_editline.h \
99	files_editxml.c files_editxml.h \
100	files_properties.c files_properties.h \
101	files_select.c files_select.h \
102	vercmp_internal.c vercmp_internal.h \
103	vercmp.c vercmp.h \
104	package_module.c package_module.h \
105	verify_packages.c verify_packages.h \
106	verify_new_packages.c verify_new_packages.h \
107	verify_users.c verify_users.h \
108	cf-agent-windows-functions.h
109
110if !NT
111libcf_agent_la_SOURCES += nfs.c nfs.h
112if HAVE_USERS_PROMISE_DEPS
113libcf_agent_la_SOURCES += verify_users_pam.c
114else
115libcf_agent_la_SOURCES += verify_users_stub.c
116endif
117endif
118
119if HAVE_AVAHI_CLIENT
120if HAVE_AVAHI_COMMON
121libcf_agent_la_SOURCES += \
122	findhub.c findhub_priv.h findhub.h \
123	load_avahi.c load_avahi.h
124endif
125endif
126
127TESTS =
128
129if !NT
130noinst_PROGRAMS = manifest_file
131manifest_file_SOURCES = manifest_file.c
132manifest_file_LDADD = ${top_srcdir}/libntech/libutils/libutils.la \
133					  ../libpromises/libpromises.la \
134                      libcf-agent.la
135TESTS += manifest_file
136endif
137
138if !BUILTIN_EXTENSIONS
139bin_PROGRAMS = cf-agent
140
141# Workaround for automake madness (try removing it if you want to know why).
142cf_agent_CFLAGS = $(AM_CFLAGS)
143
144# Build both a libcf-agent.la library, and a cf-agent executable
145cf_agent_LDADD = libcf-agent.la
146endif
147
148CLEANFILES = *.gcno *.gcda
149
150#
151# Some basic clean ups
152#
153MOSTLYCLEANFILES = *~ *.orig *.rej
154