build: Migrate resourcemgr Makefile.am into base Makefile.am.
More work towards #25.
Signed-off-by: Philip Tricca <flihp@twobit.us>
diff --git a/Makefile.am b/Makefile.am
index 15b2999..ccc558a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -26,14 +26,22 @@
# THE POSSIBILITY OF SUCH DAMAGE.
#;**********************************************************************;
-SUBDIRS = resourcemgr test/tpmclient
+SUBDIRS = test/tpmclient
+bin_PROGRAMS = resourcemgr/resourcemgr
noinst_LIBRARIES = common/libcommon.a sysapi/libtpm.a
common_libcommon_a_CFLAGS = -I$(srcdir)/sysapi/include/ \
-I$(srcdir)/tcti/tpmsockets/ -I$(srcdir)/test/tpmclient/
common_libcommon_a_SOURCES = $(COMMON_SRC)
+resourcemgr_resourcemgr_CFLAGS = $(RESOURCEMGR_INC)
+resourcemgr_resourcemgr_CXXFLAGS = $(RESOURCEMGR_INC)
+resourcemgr_resourcemgr_LDADD = $(noinst_LIBRARIES)
+resourcemgr_resourcemgr_LDFLAGS = -lpthread
+resourcemgr_resourcemgr_SOURCES = $(RESOURCEMGR_SRC) $(TPMSOCKETS_SRC) \
+ $(LOCALTPM_SRC) $(COMMON_SRC) $(SYSAPI_INC) common/getcommands.c
+
sysapi_libtpm_a_CFLAGS = -I$(srcdir)/sysapi/include/
sysapi_libtpm_a_SOURCES = $(SYSAPI_SRC) $(SYSAPIUTIL_SRC) $(SYSAPI_INC)
@@ -42,6 +50,14 @@
common/platformcommand.c common/platform.h \
common/syscontext.c common/syscontext.h
+LOCALTPM_SRC = tcti/localtpm/localtpm.c tcti/localtpm/localtpm.h
+RESOURCEMGR_INC = -I$(srcdir)/sysapi/include -I$(srcdir)/common \
+ -I$(srcdir)/tcti/tpmsockets -I$(srcdir)/tcti/localtpm \
+ -I$(srcdir)/resourcemgr -I$(srcdir)/test/tpmclient
+RESOURCEMGR_SRC = resourcemgr/resourcemgr.c resourcemgr/resourcemgr.h
+TPMSOCKETS_SRC = tcti/tpmsockets/tpmsockets.cpp \
+ tcti/tpmsockets/tpmsockets.h
+
SYSAPI_SRC = \
sysapi/sysapi/Tss2_Sys_ECC_Parameters.c \
sysapi/sysapi/Tss2_Sys_NV_Write.c \
diff --git a/configure.ac b/configure.ac
index 3ca3918..d90c670 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5,6 +5,5 @@
AM_INIT_AUTOMAKE([foreign
subdir-objects])
AC_CONFIG_FILES([Makefile
- test/tpmclient/Makefile
- resourcemgr/Makefile])
+ test/tpmclient/Makefile])
AC_OUTPUT
diff --git a/resourcemgr/Makefile.am b/resourcemgr/Makefile.am
deleted file mode 100644
index e4c58f0..0000000
--- a/resourcemgr/Makefile.am
+++ /dev/null
@@ -1,72 +0,0 @@
-#;**********************************************************************;
-#
-# Copyright (c) 2015, Intel Corporation
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# 1. Redistributions of source code must retain the above copyright notice,
-# this list of conditions and the following disclaimer.
-#
-# 2. Redistributions in binary form must reproduce the above copyright notice,
-# this list of conditions and the following disclaimer in the documentation
-# and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
-# THE POSSIBILITY OF SUCH DAMAGE.
-#;**********************************************************************;
-
-RESOURCEMGR_SRC = resourcemgr.c resourcemgr.h
-TPMSOCKETS_SRC = ../tcti/tpmsockets/tpmsockets.cpp \
- ../tcti/tpmsockets/tpmsockets.h
-LOCALTPM_SRC = ../tcti/localtpm/localtpm.c ../tcti/localtpm/localtpm.h
-SYSAPI_INC = \
- ../sysapi/include/tss2_tpm2_types.h \
- ../sysapi/include/tss2_sys_api_part3.h \
- ../sysapi/include/tss2_tcti.h \
- ../sysapi/include/basetypes.h \
- ../sysapi/include/tss2_tcti_util.h \
- ../sysapi/include/tpm20.h \
- ../sysapi/include/tss2_sysapi_util.h \
- ../sysapi/include/implementation.h \
- ../sysapi/include/tss2_common.h \
- ../sysapi/include/endianConv.h \
- ../sysapi/include/tss2_sys_api_marshalUnmarshal.h \
- ../sysapi/include/tss2_sys.h \
- ../syspai/include/tpmb.h
-
-INCLUDE_DIRS = -I$(srcdir)/../sysapi/include -I$(srcdir)/../common \
- -I$(srcdir)/../tcti/tpmsockets -I$(srcdir)/../tcti/localtpm -I$(srcdir) \
- -I$(srcdir)/../test/tpmclient
-
-AM_CFLAGS = $(INCLUDE_DIRS)
-AM_CXXFLAGS = $(INCLUDE_DIRS)
-
-LIBTPM = ../sysapi/libtpm.a
-LIBCMN = ../common/libcommon.a
-LIBS = -lpthread
-
-$(LIBCMN):
- $(MAKE) -C ../ common/libcommon.a
-$(LIBTPM):
- $(MAKE) -C ../ sysapi/libtpm.a
-
-bin_PROGRAMS = resourcemgr
-resourcemgr_LDADD = getcommands.o $(LIBCMN) $(LIBTPM)
-resourcemgr_SOURCES = $(RESOURCEMGR_SRC) $(TPMSOCKETS_SRC) $(LOCALTPM_SRC) \
- $(COMMON_SRC) $(SYSAPI_INC)
-
-# Build special version of getcommands code for test application.
-getcommands.o: ../common/getcommands.c
- $(CC) $(AM_CFLAGS) -c $< -o $@
-