blob: 136c6a8afb9cffa7952087f4f7163c7c98ed5448 [file] [log] [blame]
Brad Bishop9df0e162017-04-22 14:19:45 -04001AM_DEFAULT_SOURCE_EXT = .cpp
2AM_CPPFLAGS = -iquote ${top_srcdir}
3
Patrick Venture71779ab2019-03-28 11:22:15 -07004bin_PROGRAMS = \
Brad Bishop9df0e162017-04-22 14:19:45 -04005 phosphor-fan-presence-tach
6
Matt Spinler00db9502021-02-04 16:43:31 -06007systemdsystemunit_DATA=
8
9if WANT_JSON
Matthew Barth8bf1c422021-08-05 11:30:09 -050010CONFIGSDIR = "${pkgdatadir}/presence/"
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 Spinler00db9502021-02-04 16:43:31 -060025systemdsystemunit_DATA += \
26 service_files/json/phosphor-fan-presence-tach@.service
27else
28systemdsystemunit_DATA += \
29 service_files/yaml/phosphor-fan-presence-tach@.service
30endif
31
Brad Bishop9df0e162017-04-22 14:19:45 -040032phosphor_fan_presence_tach_SOURCES = \
Brad Bishop00b52082017-07-25 19:52:22 -040033 anyof.cpp \
Matt Spinlere8122392020-09-24 13:22:18 -050034 error_reporter.cpp \
Brad Bishopbfb81602017-06-14 21:14:32 -040035 fallback.cpp \
Brad Bishop825e31e2017-06-14 16:38:22 -040036 fan.cpp \
Matt Spinler76e73c22021-04-21 11:03:05 -050037 get_power_state.cpp \
Brad Bishop5c589482017-06-14 22:32:20 -040038 gpio.cpp \
Matt Spinler635de8c2020-09-24 13:51:40 -050039 logging.cpp \
Brad Bishop61749512017-07-25 19:02:15 -040040 psensor.cpp \
Brad Bishopdd62e362017-06-14 16:54:03 -040041 tach.cpp \
Matthew Barthfd05d642019-11-14 15:01:57 -060042 tach_detect.cpp \
Jolie Ku1a568652020-08-24 16:32:15 +080043 json_parser.cpp
Brad Bishop9df0e162017-04-22 14:19:45 -040044
45phosphor_fan_presence_tach_LDADD = \
Brad Bishop9df0e162017-04-22 14:19:45 -040046 $(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) \
Brad Bishop8a502f52017-06-14 23:46:15 -040049 ${PHOSPHOR_DBUS_INTERFACES_LIBS} \
Matthew Barthf3e70472019-12-03 13:33:20 -060050 $(LIBEVDEV_LIBS) \
Matthew Barth1826c732020-08-28 08:40:59 -050051 $(STDPLUS_LIBS) \
52 $(FMT_LIBS)
53
Brad Bishop9df0e162017-04-22 14:19:45 -040054phosphor_fan_presence_tach_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) \
Brad Bishop8a502f52017-06-14 23:46:15 -040058 ${PHOSPHOR_DBUS_INTERFACES_CFLAGS} \
Andrew Geisslerecd4bc72018-08-27 10:52:23 -070059 $(LIBEVDEV_CFLAGS) \
Matthew Barthf3e70472019-12-03 13:33:20 -060060 -flto \
61 $(STDPLUS_CFLAGS)
Brad Bishop9df0e162017-04-22 14:19:45 -040062
Matthew Barthcc194802020-01-09 13:55:34 -060063if !WANT_JSON
Brad Bishop372b22c2017-07-12 15:57:14 -040064BUILT_SOURCES = generated.hpp
Brad Bishop76596b22017-06-13 14:39:13 -040065TEMPLATES = \
66 templates/generated.mako.hpp
Brad Bishop9df0e162017-04-22 14:19:45 -040067
Brad Bishop76596b22017-06-13 14:39:13 -040068generated.hpp: $(TEMPLATES) ${srcdir}/pfpgen.py $(PRESENCE_CONFIG)
69 $(AM_V_GEN)$(PFPGEN) > $(builddir)/$@
Matthew Barthcc194802020-01-09 13:55:34 -060070endif