diff options
author | Lei YU <mine260309@gmail.com> | 2017-07-14 11:07:37 +0800 |
---|---|---|
committer | Lei YU <mine260309@gmail.com> | 2017-08-28 10:31:42 +0800 |
commit | 6c56a4a82863859d0d593621dc86f2a576440e77 (patch) | |
tree | 2a5fb6a3f016ce8be0cbfd6449837c571349cfeb /Makefile.am | |
parent | 0ab90ca75b825db8e2427ea62ea3ee212c9accbb (diff) | |
download | openpower-occ-control-6c56a4a82863859d0d593621dc86f2a576440e77.tar.gz openpower-occ-control-6c56a4a82863859d0d593621dc86f2a576440e77.zip |
Add unit tests for utils and refactor Makefiles
1. Add unit tests for utils;
2. Put the common code shared by app and utest into a library, and link the
library to app and utest.
This eliminates the duplicated compiled objects.
3. Update .gitignore
Change-Id: I05ee93c2b23748a1e038eeec3534d49b94911366
Signed-off-by: Lei YU <mine260309@gmail.com>
Diffstat (limited to 'Makefile.am')
-rw-r--r-- | Makefile.am | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/Makefile.am b/Makefile.am index d71d6e5..0a2d05a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -8,19 +8,26 @@ noinst_HEADERS = \ occ_finder.hpp \ utils.hpp +noinst_LTLIBRARIES = libocc_control.la + sbin_PROGRAMS = openpower-occ-control + openpower_occ_control_SOURCES = \ + app.cpp + +libocc_control_la_SOURCES = \ occ_pass_through.cpp \ occ_status.cpp \ occ_device.cpp \ occ_errors.cpp \ - app.cpp \ powercap.cpp \ org/open_power/OCC/Device/error.cpp \ occ_finder.cpp \ i2c_occ.cpp \ utils.cpp +openpower_occ_control_LDADD = libocc_control.la -lstdc++fs + BUILT_SOURCES = org/open_power/OCC/Device/error.hpp \ org/open_power/OCC/Device/error.cpp \ occ_sensor.hpp @@ -35,19 +42,27 @@ EXTRA_DIST = $(REQ_MAKO_FILE) $(REQ_PY_SCRIPT) occ_sensor.hpp: ${REQ_PY_SCRIPT} ${REQ_MAKO_FILE} $(AM_V_GEN) ${PYTHON} ${REQ_PY_SCRIPT} -i ${YAML_PATH} > $@ -openpower_occ_control_LDFLAGS = \ + +generic_ld_flags = \ $(SDBUSPLUS_LIBS) \ $(PHOSPHOR_LOGGING_LIBS) \ $(OPENPOWER_DBUS_INTERFACES_LIBS) \ - $(PHOSPHOR_DBUS_INTERFACES_LIBS) \ - -lstdc++fs + $(PHOSPHOR_DBUS_INTERFACES_LIBS) -openpower_occ_control_CXXFLAGS = +generic_cxx_flags = \ $(SDBUSPLUS_CFLAGS) \ $(PHOSPHOR_LOGGING_CFLAGS) \ $(OPENPOWER_DBUS_INTERFACES_CFLAGS) \ $(PHOSPHOR_DBUS_INTERFACES_CFLAGS) +libocc_control_la_CXXFLAGS = $(generic_cxx_flags) + +libocc_control_la_LDFLAGS = $(generic_ld_flags) + +openpower_occ_control_CXXFLAGS = $(generic_cxx_flags) + +openpower_occ_control_LDFLAGS = $(generic_ld_flags) + org/open_power/OCC/Device/error.hpp: ${top_srcdir}/org/open_power/OCC/Device.errors.yaml @mkdir -p `dirname $@` $(SDBUSPLUSPLUS) -r $(top_srcdir) error exception-header org.open_power.OCC.Device > $@ |