blob: 0a120e4cc5bf0e74494f5a394b9cf7282efdc2e0 [file] [log] [blame]
Matthew Barth3cff7ed2016-07-27 14:50:51 -05001AM_DEFAULT_SOURCE_EXT = .cpp
2
William A. Kennington III194375f2018-12-14 02:14:33 -08003AM_CPPFLAGS = -I$(abs_srcdir) -I$(abs_srcdir)/include
4export AM_CPPFLAGS
5
William A. Kennington III5023aa92019-04-04 18:00:09 -07006if AUTOCONF_CODE_COVERAGE_2019_01_06
7include $(top_srcdir)/aminclude_static.am
8clean-local: code-coverage-clean
9distclean-local: code-coverage-dist-clean
10else
11@CODE_COVERAGE_RULES@
12endif
13
William A. Kennington III785fb072018-12-10 15:27:20 -080014providersdir = ${libdir}/ipmid-providers
15providers_LTLIBRARIES =
16
Vernon Mauerye9f88572020-01-30 16:11:34 -080017if FEATURE_IPMI_WHITELIST
18IPMI_WHITELIST_SOURCE = ipmiwhitelist.cpp
19else
20IPMI_WHITELIST_SOURCE =
21endif
22
Patrick Venture1c8ee492019-03-28 11:43:45 -070023bin_PROGRAMS = \
Patrick Williams686df742016-09-02 17:52:59 -050024 ipmid
Matthew Barth3cff7ed2016-07-27 14:50:51 -050025
26ipmid_SOURCES = \
Vernon Mauery240b1862018-10-08 12:05:16 -070027 ipmid-new.cpp \
Vishwanatha Subbannaac149a92017-07-11 18:16:50 +053028 settings.cpp \
Vernon Mauery6a98fe72019-03-11 15:57:48 -070029 host-cmd-manager.cpp
Vernon Mauery240b1862018-10-08 12:05:16 -070030
Vernon Mauery02484842018-07-24 09:15:38 -070031libipmi20_BUILT_LIST = \
Tom Josepha9fbff42018-01-22 14:59:09 +053032 sensor-gen.cpp \
Tom Josephe19540e2019-02-04 14:06:58 +053033 inventory-sensor-gen.cpp \
Patrick Venture1ad9da82019-08-19 12:25:54 -070034 fru-read-gen.cpp
Tom Josepha9fbff42018-01-22 14:59:09 +053035
Marri Devender Raoa62bacc2017-06-04 23:40:16 -050036BUILT_SOURCES = \
Vernon Mauerye9f88572020-01-30 16:11:34 -080037 $(IPMI_WHITELIST_SOURCE) \
Patrick Venturec64f8022018-11-14 19:31:15 -080038 $(libipmi20_BUILT_LIST)
Marri Devender Raoa62bacc2017-06-04 23:40:16 -050039
Ratan Gupta28c2e732017-03-04 08:53:52 +053040CLEANFILES = $(BUILT_SOURCES)
Patrick Williams686df742016-09-02 17:52:59 -050041
Vernon Mauery1e3455a2018-11-30 13:10:54 -080042COMMON_CXX = \
43 -flto \
44 -Wno-psabi \
45 $(SYSTEMD_CFLAGS) \
46 $(libmapper_CFLAGS) \
47 $(SDBUSPLUS_CFLAGS) \
48 $(PHOSPHOR_LOGGING_CFLAGS) \
49 $(PHOSPHOR_DBUS_INTERFACES_CFLAGS) \
Patrick Venturec64f8022018-11-14 19:31:15 -080050 -DBOOST_ERROR_CODE_HEADER_ONLY \
51 -DBOOST_SYSTEM_NO_DEPRECATED \
Vernon Mauerye7329c72018-10-08 12:05:16 -070052 -DBOOST_COROUTINES_NO_DEPRECATION_WARNING \
53 -DBOOST_ASIO_DISABLE_THREADS \
Patrick Venturec64f8022018-11-14 19:31:15 -080054 -DBOOST_ALL_NO_LIB
55
Vernon Mauery1e3455a2018-11-30 13:10:54 -080056ipmid_CXXFLAGS = $(COMMON_CXX)
William A. Kennington III194375f2018-12-14 02:14:33 -080057ipmid_LDADD = \
58 libipmid/libipmid.la \
Vernon Mauery240b1862018-10-08 12:05:16 -070059 user_channel/libchannellayer.la \
William A. Kennington III194375f2018-12-14 02:14:33 -080060 libipmid-host/libipmid-host.la
Deepak Kodihalli18aa0442017-07-21 07:07:09 -050061ipmid_LDFLAGS = \
62 $(SYSTEMD_LIBS) \
63 $(libmapper_LIBS) \
64 $(LIBADD_DLOPEN) \
65 $(PHOSPHOR_LOGGING_LIBS) \
66 $(PHOSPHOR_DBUS_INTERFACES_LIBS) \
Richard Marian Thomaiyar4654d992018-04-19 05:38:37 +053067 $(CRYPTO_LIBS) \
Vernon Mauery240b1862018-10-08 12:05:16 -070068 -lboost_coroutine \
Vernon Mauery28565ac2018-08-01 09:16:56 -070069 -lstdc++fs \
Deepak Kodihalli18aa0442017-07-21 07:07:09 -050070 -export-dynamic
Vishwanatha Subbannaac149a92017-07-11 18:16:50 +053071
Patrick Williams686df742016-09-02 17:52:59 -050072# TODO: Rather than use -export-dynamic, we should use -export-symbol to have a
73# selective list of symbols.
74
Patrick Williams686df742016-09-02 17:52:59 -050075ipmiwhitelist.cpp: ${srcdir}/generate_whitelist.sh $(WHITELIST_CONF)
Patrick Williams37af7332016-09-02 21:21:42 -050076 $(SHELL) $^ > $@
Patrick Williams686df742016-09-02 17:52:59 -050077
Vernon Mauery5f7ac712019-04-30 11:19:08 -070078sensor-gen.cpp: scripts/writesensor.mako.cpp scripts/sensor_gen.py @SENSOR_YAML_GEN@
Ratan Gupta28c2e732017-03-04 08:53:52 +053079 $(AM_V_GEN)@SENSORGEN@ -o $(top_builddir) generate-cpp
80
Vernon Mauery5f7ac712019-04-30 11:19:08 -070081inventory-sensor-gen.cpp: scripts/inventorysensor.mako.cpp scripts/inventory-sensor.py @INVSENSOR_YAML_GEN@
Tom Josephd5899e72017-05-05 11:20:34 +053082 $(AM_V_GEN)@INVSENSORGEN@ -o $(top_builddir) generate-cpp
83
Vernon Mauery5f7ac712019-04-30 11:19:08 -070084fru-read-gen.cpp: scripts/readfru.mako.cpp scripts/fru_gen.py @FRU_YAML_GEN@
Marri Devender Raoa62bacc2017-06-04 23:40:16 -050085 $(AM_V_GEN)@FRUGEN@ -o $(top_builddir) generate-cpp
86
William A. Kennington III785fb072018-12-10 15:27:20 -080087providers_LTLIBRARIES += libipmi20.la
Johnathan Manteyb87034e2019-09-16 10:50:50 -070088if FEATURE_TRANSPORT_OEM
89libipmi20_la_TRANSPORTOEM = transporthandler_oem.cpp
90else
91libipmi20_la_TRANSPORTOEM =
92endif
93
Vernon Mauery02484842018-07-24 09:15:38 -070094libipmi20_la_SOURCES = \
Patrick Venture5794fcf2017-10-26 11:11:14 -070095 app/channel.cpp \
Patrick Venture5e6ac712017-10-25 12:16:19 -070096 app/watchdog.cpp \
William A. Kennington III52575252018-02-09 15:54:56 -080097 app/watchdog_service.cpp \
Matthew Barth3cff7ed2016-07-27 14:50:51 -050098 apphandler.cpp \
Xo Wang069db2f2017-08-09 15:31:33 -070099 sys_info_param.cpp \
Willy Tu3660b192021-08-10 02:36:19 +0000100 sensorhandler.cpp \
Patrick Venture02e32372019-08-16 10:50:18 -0700101 entity_map_json.cpp \
Willy Tu3660b192021-08-10 02:36:19 +0000102 storagehandler.cpp \
Matthew Barth3cff7ed2016-07-27 14:50:51 -0500103 chassishandler.cpp \
104 dcmihandler.cpp \
105 ipmisensor.cpp \
106 storageaddsel.cpp \
107 transporthandler.cpp \
108 globalhandler.cpp \
Ratan Gupta28c2e732017-03-04 08:53:52 +0530109 groupext.cpp \
Marri Devender Rao7d9157e2017-07-01 16:11:40 -0500110 selutility.cpp \
Marri Devender Rao0acf0572017-07-03 12:25:47 -0500111 ipmi_fru_info_area.cpp \
Dhruvaraj Subhashchandrane0af7202017-07-12 06:35:20 -0500112 read_fru_data.cpp \
Tom Josepha9fbff42018-01-22 14:59:09 +0530113 sensordatahandler.cpp \
Vernon Mauery1bb0c7f2018-12-21 10:59:19 -0800114 user_channel/channelcommands.cpp \
Johnathan Manteyb87034e2019-09-16 10:50:50 -0700115 $(libipmi20_la_TRANSPORTOEM) \
Vernon Mauery02484842018-07-24 09:15:38 -0700116 $(libipmi20_BUILT_LIST)
Ratan Gupta28c2e732017-03-04 08:53:52 +0530117
Emily Shafferc07e72c2018-06-18 10:37:31 -0700118check_PROGRAMS =
119XFAIL_TESTS =
120
121TESTS = $(check_PROGRAMS)
122
William A. Kennington III194375f2018-12-14 02:14:33 -0800123libipmi20_la_LIBADD = \
124 libipmid/libipmid.la \
Vernon Mauery1bb0c7f2018-12-21 10:59:19 -0800125 user_channel/libchannellayer.la
Patrick Venturec64f8022018-11-14 19:31:15 -0800126libipmi20_la_LDFLAGS = \
127 $(SYSTEMD_LIBS) \
128 $(libmapper_LIBS) \
129 $(PHOSPHOR_LOGGING_LIBS) \
130 $(PHOSPHOR_DBUS_INTERFACES_LIBS) \
131 -lstdc++fs \
Vernon Mauery240b1862018-10-08 12:05:16 -0700132 -lboost_coroutine \
Patrick Venturec64f8022018-11-14 19:31:15 -0800133 -version-info 0:0:0 -shared
Vernon Mauery1e3455a2018-11-30 13:10:54 -0800134libipmi20_la_CXXFLAGS = $(COMMON_CXX)
Matthew Barth3cff7ed2016-07-27 14:50:51 -0500135
ofery61d8dcc2019-06-10 16:02:37 -0700136if FEATURE_LIBUSERLAYER
William A. Kennington III343d0612018-12-10 15:56:24 -0800137providers_LTLIBRARIES += libusercmds.la
William A. Kennington III194375f2018-12-14 02:14:33 -0800138libusercmds_la_LIBADD = \
139 libipmid/libipmid.la \
Richard Marian Thomaiyara4e09e42019-03-02 20:08:32 +0530140 user_channel/libuserlayer.la \
141 user_channel/libchannellayer.la
William A. Kennington III343d0612018-12-10 15:56:24 -0800142libusercmds_la_SOURCES = \
Vernon Mauery1bb0c7f2018-12-21 10:59:19 -0800143 user_channel/usercommands.cpp
William A. Kennington III343d0612018-12-10 15:56:24 -0800144libusercmds_la_LDFLAGS = \
145 $(PHOSPHOR_LOGGING_LIBS) \
Suryakanth Sekar90b00c72019-01-16 10:37:57 +0530146 $(libmapper_LIBS) \
William A. Kennington III343d0612018-12-10 15:56:24 -0800147 -version-info 0:0:0 -shared
Vernon Mauery1bb0c7f2018-12-21 10:59:19 -0800148libusercmds_la_CXXFLAGS = $(COMMON_CXX)
ofery61d8dcc2019-06-10 16:02:37 -0700149endif
William A. Kennington III343d0612018-12-10 15:56:24 -0800150
William A. Kennington III785fb072018-12-10 15:27:20 -0800151providers_LTLIBRARIES += libsysintfcmds.la
William A. Kennington III194375f2018-12-14 02:14:33 -0800152libsysintfcmds_la_LIBADD = \
153 libipmid/libipmid.la \
154 libipmid-host/libipmid-host.la
Tom9e5232e2016-11-07 12:14:51 +0530155libsysintfcmds_la_SOURCES = \
Andrew Geissler12866372017-03-21 22:58:28 -0500156 systemintfcmds.cpp \
Vishwanatha Subbanna3eb117a2017-07-12 16:13:49 +0530157 host-interface.cpp
Patrick Venturec64f8022018-11-14 19:31:15 -0800158libsysintfcmds_la_LDFLAGS = \
159 $(SYSTEMD_LIBS) \
160 $(libmapper_LIBS) \
161 $(PHOSPHOR_DBUS_INTERFACES_LIBS) \
162 $(PHOSPHOR_LOGGING_LIBS) \
163 $(SDBUSPLUS_LIBS) \
164 -version-info 0:0:0 -shared
Vernon Mauery1e3455a2018-11-30 13:10:54 -0800165libsysintfcmds_la_CXXFLAGS = $(COMMON_CXX)
Andrew Geisslerdd2c6fd2017-03-16 15:53:20 -0500166
Willy Tude54f482021-01-26 15:59:09 -0800167if FEATURE_DYNAMIC_SENSORS
168providers_LTLIBRARIES += libdynamiccmds.la
169libdynamiccmds_la_LIBADD = \
170 libipmid/libipmid.la
Scron Chang2703b022021-07-06 15:47:45 +0800171if FEATURE_HYBRID_SENSORS
172libdynamiccmds_la_LIBADD += libipmi20.la
173endif
Willy Tude54f482021-01-26 15:59:09 -0800174libdynamiccmds_la_SOURCES = \
175 dbus-sdr/sensorcommands.cpp \
176 dbus-sdr/storagecommands.cpp \
177 dbus-sdr/sdrutils.cpp \
178 dbus-sdr/sensorutils.cpp
179libdynamiccmds_la_LDFLAGS = \
180 $(PHOSPHOR_LOGGING_LIBS) \
181 $(libmapper_LIBS) \
182 -version-info 0:0:0 -shared
183libdynamiccmds_la_CXXFLAGS = $(COMMON_CXX)
184endif
185
Vernon Mauerye9f88572020-01-30 16:11:34 -0800186if FEATURE_IPMI_WHITELIST
Vernon Mauery783dc072018-10-08 12:05:20 -0700187libwhitelistdir = ${libdir}/ipmid-providers
188libwhitelist_LTLIBRARIES = libwhitelist.la
189libwhitelist_la_SOURCES = \
190 whitelist-filter.cpp
191libwhitelist_la_LDFLAGS = \
192 $(SYSTEMD_LIBS) \
193 $(libmapper_LIBS) \
194 $(PHOSPHOR_LOGGING_LIBS) \
195 $(PHOSPHOR_DBUS_INTERFACES_LIBS) \
196 -version-info 0:0:0 -shared
197libwhitelist_la_CXXFLAGS = $(COMMON_CXX)
198nodist_libwhitelist_la_SOURCES = ipmiwhitelist.cpp
Vernon Mauerye9f88572020-01-30 16:11:34 -0800199endif
Vernon Mauery783dc072018-10-08 12:05:20 -0700200
Patrick Williams37af7332016-09-02 21:21:42 -0500201nobase_include_HEADERS = \
AppaRao Puli071f3f22018-05-24 16:45:30 +0530202 user_channel/channel_layer.hpp \
shamim alid2bae682022-01-24 16:48:43 +0530203 user_channel/user_layer.hpp \
204 user_channel/cipher_mgmt.hpp
Matthew Barth3cff7ed2016-07-27 14:50:51 -0500205
Vishwanatha Subbanna506aa0f2017-01-24 14:58:25 +0530206# Forcing the build of self and then subdir
William A. Kennington III194375f2018-12-14 02:14:33 -0800207SUBDIRS = include libipmid libipmid-host user_channel . test softoff