blob: 5d7d1e62fa9d26bba5af9e41ccef5ad73ca98b49 [file] [log] [blame]
Matt Spinlere73446e2017-04-10 13:55:52 -05001AM_DEFAULT_SOURCE_EXT = .cpp
Matthew Barth54b5a242021-05-21 11:02:52 -05002AM_CPPFLAGS = -iquote ${top_srcdir} \
3 -I${srcdir}/json \
4 -I${srcdir}/json/actions \
5 -I${srcdir}/json/triggers
Matt Spinlere73446e2017-04-10 13:55:52 -05006
Matthew Barth058180f2021-06-16 11:41:58 -05007systemdsystemunit_DATA=
8
9if WANT_JSON_CONTROL
Matthew Barthceb75d72021-08-18 15:18:43 -050010CONFIGSDIR = "${pkgdatadir}/control/"
11CONFIGSLOC = "${srcdir}/config_files/$(MACHINE)/"
12
13EXTRA_DIST = $(CONFIGSLOC)
14
15# No $(MACHINE) given results in installing entire config_files contents
16install-data-hook:
17 for config in `cd $(CONFIGSLOC) && find * -type f`; do \
18 $(MKDIR_P) "$(DESTDIR)$(CONFIGSDIR)`dirname $${config}`"; \
19 $(INSTALL_DATA) "$(CONFIGSLOC)$${config}" "$(DESTDIR)$(CONFIGSDIR)`dirname $${config}`"; \
20 done
21
22uninstall-hook:
23 rm -rf "$(DESTDIR)$(CONFIGSDIR)"
24
Matthew Barth058180f2021-06-16 11:41:58 -050025systemdsystemunit_DATA += \
26 service_files/json/phosphor-fan-control@.service
27else
28systemdsystemunit_DATA += \
29 service_files/yaml/phosphor-fan-control@.service \
30 service_files/yaml/phosphor-fan-control-init@.service
31endif
32
Patrick Venture71779ab2019-03-28 11:22:15 -070033bin_PROGRAMS = \
Mike Capps385b1982021-06-28 10:40:42 -040034 phosphor-fan-control \
35 fanctl
Matt Spinlere73446e2017-04-10 13:55:52 -050036
37phosphor_fan_control_SOURCES = \
Matthew Barthf8ae7a52021-03-05 10:23:43 -060038 main.cpp
Matt Spinlere73446e2017-04-10 13:55:52 -050039
Brad Bishop10484012017-04-24 22:59:18 -040040phosphor_fan_control_LDADD = \
Matthew Barth93af4192019-01-18 09:30:57 -060041 -lstdc++fs \
Brad Bishop10484012017-04-24 22:59:18 -040042 $(SDBUSPLUS_LIBS) \
William A. Kennington III1cfc2f12018-10-19 17:29:46 -070043 $(SDEVENTPLUS_LIBS) \
Dinesh Chinari618027a2017-06-26 23:26:50 -050044 $(PHOSPHOR_LOGGING_LIBS) \
Matthew Barth1826c732020-08-28 08:40:59 -050045 ${PHOSPHOR_DBUS_INTERFACES_LIBS} \
46 $(FMT_LIBS)
Brad Bishop10484012017-04-24 22:59:18 -040047
48phosphor_fan_control_CXXFLAGS = \
49 $(SDBUSPLUS_CFLAGS) \
William A. Kennington III1cfc2f12018-10-19 17:29:46 -070050 $(SDEVENTPLUS_CFLAGS) \
Dinesh Chinari618027a2017-06-26 23:26:50 -050051 $(PHOSPHOR_LOGGING_CFLAGS) \
Andrew Geisslerecd4bc72018-08-27 10:52:23 -070052 ${PHOSPHOR_DBUS_INTERFACES_CFLAGS} \
53 -flto
Matt Spinler77d32d12017-04-12 09:51:41 -050054
Mike Capps385b1982021-06-28 10:40:42 -040055fanctl_SOURCES = \
56 fanctl.cpp
57
Mike Capps385b1982021-06-28 10:40:42 -040058fanctl_LDADD = \
59 $(SDBUSPLUS_LIBS) \
60 $(FMT_LIBS)
61
Mike Capps16aab352021-06-30 10:17:21 -040062fanctl_CXXFLAGS = \
63 $(SDBUSPLUS_CFLAGS) \
64 -flto
Mike Capps385b1982021-06-28 10:40:42 -040065
66
Matthew Barth8e1b3822020-11-12 11:57:23 -060067if WANT_JSON_CONTROL
Matthew Barthe6704b92020-10-20 16:14:08 -050068phosphor_fan_control_SOURCES += \
Matthew Barthe6704b92020-10-20 16:14:08 -050069 json/manager.cpp \
70 json/profile.cpp \
71 json/fan.cpp \
72 json/zone.cpp \
Matthew Barthbc89a8a2021-05-25 15:42:58 -050073 json/dbus_zone.cpp \
Matthew Barthe6704b92020-10-20 16:14:08 -050074 json/group.cpp \
Matthew Barth0c4b1572020-10-22 14:39:46 -050075 json/event.cpp \
Matthew Barthbaeeb8f2021-05-13 16:03:54 -050076 json/triggers/timer.cpp \
77 json/triggers/signal.cpp \
Matthew Barthe8441c62021-05-13 16:50:56 -050078 json/triggers/init.cpp \
Matt Spinlerd0ba86a2021-11-09 10:09:13 -060079 json/triggers/parameter.cpp \
Matthew Barth07fecfc2021-01-29 09:04:43 -060080 json/actions/default_floor.cpp \
Matthew Barth070ee3c2021-01-29 09:58:16 -060081 json/actions/request_target_base.cpp \
Matthew Barth89c2fa12021-02-04 14:50:40 -060082 json/actions/missing_owner_target.cpp \
Matthew Barthdc776c82021-02-25 16:06:16 -060083 json/actions/count_state_target.cpp \
Mike Capps59af8ca2021-10-07 15:42:28 -040084 json/actions/override_fan_target.cpp \
Matthew Barth45c44ea2021-03-03 13:16:14 -060085 json/actions/net_target_increase.cpp \
Matthew Barthcb112a32021-06-30 14:23:36 -050086 json/actions/net_target_decrease.cpp \
Matt Spinler848799f2021-07-01 12:43:07 -060087 json/actions/timer_based_actions.cpp \
Matt Spinlerc09b8c82021-08-05 16:29:47 -050088 json/actions/mapped_floor.cpp \
Matt Spinler81bc8802021-08-06 09:25:45 -050089 json/actions/set_parameter_from_group_max.cpp \
Matt Spinler65dfe1e2021-10-26 15:56:01 -050090 json/actions/count_state_floor.cpp \
Matt Spinler41e76f82021-10-14 16:00:13 -050091 json/actions/get_managed_objects.cpp \
Matt Spinlerd4c7fb72021-11-09 16:03:50 -060092 json/actions/pcie_card_floors.cpp \
Matt Spinler13270962021-10-04 14:49:33 -050093 json/utils/flight_recorder.cpp \
Matt Spinlere9d33b62021-11-09 13:27:26 -060094 json/utils/modifier.cpp \
95 json/utils/pcie_card_metadata.cpp
Matthew Barthd87f89f2020-07-30 10:41:32 -050096else
Matthew Barthf8ae7a52021-03-05 10:23:43 -060097phosphor_fan_control_SOURCES += \
98 argument.cpp \
99 fan.cpp \
100 manager.cpp \
101 utility.cpp \
102 preconditions.cpp \
103 actions.cpp \
104 triggers.cpp \
105 zone.cpp
Matt Spinler77d32d12017-04-12 09:51:41 -0500106BUILT_SOURCES = fan_zone_defs.cpp
Matthew Barthd87f89f2020-07-30 10:41:32 -0500107nodist_phosphor_fan_control_SOURCES = \
108 fan_zone_defs.cpp
Matt Spinler77d32d12017-04-12 09:51:41 -0500109
110fan_zone_defs.cpp: ${srcdir}/gen-fan-zone-defs.py
Matthew Barth8c8f53d2020-02-18 09:40:13 -0600111 $(AM_V_GEN)$(GEN_FAN_ZONE_DEFS) > ${builddir}/$@
Matthew Barthd87f89f2020-07-30 10:41:32 -0500112endif