blob: b815fcd4b2c31a25dbf952955349d1ae9735a671 [file] [log] [blame]
Matt Spinlere567dd22017-04-27 12:27:17 -05001AM_DEFAULT_SOURCE_EXT = .cpp
2AM_CPPFLAGS = -iquote ${top_srcdir}
3
Patrick Venture71779ab2019-03-28 11:22:15 -07004bin_PROGRAMS = \
Matt Spinlere567dd22017-04-27 12:27:17 -05005 phosphor-fan-monitor
6
Matt Spinler7df2d9f2021-02-04 16:44:25 -06007systemdsystemunit_DATA=
8
9if WANT_JSON
Matthew Bartha5c62742021-08-18 14:12:09 -050010CONFIGSDIR = "${pkgdatadir}/monitor/"
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
Matt Spinler7df2d9f2021-02-04 16:44:25 -060025systemdsystemunit_DATA += \
26 service_files/json/phosphor-fan-monitor@.service
27else
28systemdsystemunit_DATA += \
29 service_files/yaml/phosphor-fan-monitor@.service \
30 service_files/yaml/phosphor-fan-monitor-init@.service
31endif
32
Matt Spinlere567dd22017-04-27 12:27:17 -050033phosphor_fan_monitor_SOURCES = \
Matthew Barth6ad28432017-08-22 11:18:19 -050034 argument.cpp \
Matt Spinlerabf8da32017-04-27 14:08:45 -050035 fan.cpp \
Matt Spinlerf13b42e2020-10-26 15:29:49 -050036 fan_error.cpp \
Matt Spinlerbb449c12021-06-14 11:45:28 -060037 ../hwmon_ffdc.cpp \
Matt Spinler69b0cf02020-10-14 10:59:03 -050038 power_interface.cpp \
39 logging.cpp \
Matt Spinlerabf8da32017-04-27 14:08:45 -050040 main.cpp \
Matthew Barth81748b12018-05-02 16:03:48 -050041 tach_sensor.cpp \
Matthew Barthc95c5272020-06-15 19:51:13 -050042 conditions.cpp \
43 system.cpp
Matt Spinlere567dd22017-04-27 12:27:17 -050044
45phosphor_fan_monitor_LDADD = \
Matt Spinlere567dd22017-04-27 12:27:17 -050046 $(SDBUSPLUS_LIBS) \
William A. Kennington III1cfc2f12018-10-19 17:29:46 -070047 $(SDEVENTPLUS_LIBS) \
Dinesh Chinari618027a2017-06-26 23:26:50 -050048 $(PHOSPHOR_LOGGING_LIBS) \
Matthew Barth4d982852017-11-17 09:37:13 -060049 ${PHOSPHOR_DBUS_INTERFACES_LIBS} \
Matthew Barthd06905c2020-06-12 08:13:06 -050050 -lstdc++fs \
Matthew Barth1826c732020-08-28 08:40:59 -050051 $(STDPLUS_LIBS) \
52 $(FMT_LIBS)
Matt Spinlere567dd22017-04-27 12:27:17 -050053
54phosphor_fan_monitor_CXXFLAGS = \
55 $(SDBUSPLUS_CFLAGS) \
William A. Kennington III1cfc2f12018-10-19 17:29:46 -070056 $(SDEVENTPLUS_CFLAGS) \
Dinesh Chinari618027a2017-06-26 23:26:50 -050057 $(PHOSPHOR_LOGGING_CFLAGS) \
Andrew Geisslerecd4bc72018-08-27 10:52:23 -070058 ${PHOSPHOR_DBUS_INTERFACES_CFLAGS} \
Matthew Barthd06905c2020-06-12 08:13:06 -050059 -flto \
60 $(STDPLUS_CFLAGS)
Matt Spinlere567dd22017-04-27 12:27:17 -050061
Matthew Barthbedefd82020-06-02 15:39:56 -050062if WANT_JSON
63phosphor_fan_monitor_SOURCES += json_parser.cpp
64else
65BUILT_SOURCES = fan_monitor_defs.cpp
66nodist_phosphor_fan_monitor_SOURCES = \
67 fan_monitor_defs.cpp
68
Matt Spinler14321842017-04-28 15:27:43 -050069fan_monitor_defs.cpp: ${srcdir}/gen-fan-monitor-defs.py
Matthew Barth8c8f53d2020-02-18 09:40:13 -060070 $(AM_V_GEN)$(GEN_FAN_MONITOR_DEFS) > ${builddir}/$@
Matthew Barthbedefd82020-06-02 15:39:56 -050071endif
Matt Spinler00237432020-10-14 10:36:41 -050072
73SUBDIRS = test