aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver O'Halloran <oohall@gmail.com>2020-10-01 22:32:18 +1000
committerOliver O'Halloran <oohall@gmail.com>2020-10-01 23:29:48 +1000
commit8830892c7b61187b352c07ab35be2d0dddb713cc (patch)
treeeca6e698425b14f310f43d4029f4d2f1ecf788f9
parentb9cbe4f6f25de9e5a838bec5394a8384cb47ed40 (diff)
downloadskiboot-8830892c7b61187b352c07ab35be2d0dddb713cc.zip
skiboot-8830892c7b61187b352c07ab35be2d0dddb713cc.tar.gz
skiboot-8830892c7b61187b352c07ab35be2d0dddb713cc.tar.bz2
secvar: Clean up makefiles and fix out of tree builds
The secvar makefiles use $(SRC) in a few places they shouldn't and don't use it in a few places they should. Also drop the _SRCS rules and the pattern substuituion that turns them into _OBJS rules because chaining dependent rules is infuriating at the best of times. Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
-rw-r--r--libstb/crypto/Makefile.inc2
-rw-r--r--libstb/secvar/Makefile.inc16
-rw-r--r--libstb/secvar/backend/Makefile.inc5
-rw-r--r--libstb/secvar/storage/Makefile.inc9
4 files changed, 13 insertions, 19 deletions
diff --git a/libstb/crypto/Makefile.inc b/libstb/crypto/Makefile.inc
index ed2387e..4bc1a64 100644
--- a/libstb/crypto/Makefile.inc
+++ b/libstb/crypto/Makefile.inc
@@ -42,7 +42,7 @@ MBEDTLS_SRCS = $(addprefix mbedtls/library/,$(MBED_CRYPTO_SRCS) $(MBED_X509_SRCS
MBEDTLS_OBJS = $(MBEDTLS_SRCS:%.c=%.o)
-include $(CRYPTO_DIR)/pkcs7/Makefile.inc
+include $(SRC)/$(CRYPTO_DIR)/pkcs7/Makefile.inc
CRYPTO = $(CRYPTO_DIR)/built-in.a
diff --git a/libstb/secvar/Makefile.inc b/libstb/secvar/Makefile.inc
index b40bfc2..57c7cfb 100644
--- a/libstb/secvar/Makefile.inc
+++ b/libstb/secvar/Makefile.inc
@@ -1,16 +1,12 @@
# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
# -*-Makefile-*-
-SECVAR_DIR = $(SRC)/libstb/secvar
+SUBDIRS += libstb/secvar
-SUBDIRS += $(SECVAR_DIR)
+SECVAR_OBJS = secvar_main.o secvar_util.o secvar_devtree.o secvar_api.o
+SECVAR = libstb/secvar/built-in.a
-include $(SECVAR_DIR)/storage/Makefile.inc
-include $(SECVAR_DIR)/backend/Makefile.inc
+include $(SRC)/libstb/secvar/storage/Makefile.inc
+include $(SRC)/libstb/secvar/backend/Makefile.inc
-SECVAR_SRCS = secvar_main.c secvar_util.c secvar_devtree.c
-SECVAR_SRCS = secvar_main.c secvar_util.c secvar_devtree.c secvar_api.c
-SECVAR_OBJS = $(SECVAR_SRCS:%.c=%.o)
-SECVAR = $(SECVAR_DIR)/built-in.a
-
-$(SECVAR): $(SECVAR_OBJS:%=$(SECVAR_DIR)/%) $(SECVAR_STORAGE) $(SECVAR_BACKEND)
+$(SECVAR): $(SECVAR_OBJS:%=libstb/secvar/%) $(SECVAR_STORAGE) $(SECVAR_BACKEND)
diff --git a/libstb/secvar/backend/Makefile.inc b/libstb/secvar/backend/Makefile.inc
index bc987f6..436f9fa 100644
--- a/libstb/secvar/backend/Makefile.inc
+++ b/libstb/secvar/backend/Makefile.inc
@@ -1,12 +1,11 @@
# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
# -*-Makefile-*-
-SECVAR_BACKEND_DIR = $(SRC)/libstb/secvar/backend
+SECVAR_BACKEND_DIR = libstb/secvar/backend
SUBDIRS += $(SECVAR_BACKEND_DIR)
-SECVAR_BACKEND_SRCS = edk2-compat.c edk2-compat-process.c edk2-compat-reset.c
-SECVAR_BACKEND_OBJS = $(SECVAR_BACKEND_SRCS:%.c=%.o)
+SECVAR_BACKEND_OBJS = edk2-compat.o edk2-compat-process.o edk2-compat-reset.o
SECVAR_BACKEND = $(SECVAR_BACKEND_DIR)/built-in.a
$(SECVAR_BACKEND): $(SECVAR_BACKEND_OBJS:%=$(SECVAR_BACKEND_DIR)/%)
diff --git a/libstb/secvar/storage/Makefile.inc b/libstb/secvar/storage/Makefile.inc
index dc5353f..50156fe 100644
--- a/libstb/secvar/storage/Makefile.inc
+++ b/libstb/secvar/storage/Makefile.inc
@@ -1,19 +1,18 @@
# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
# -*-Makefile-*-
-SECVAR_STORAGE_DIR = $(SRC)/libstb/secvar/storage
+SECVAR_STORAGE_DIR = libstb/secvar/storage
SUBDIRS += $(SECVAR_STORAGE_DIR)
# Swap the comment on these two lines to use the fake TPM NV
# implementation hardware without a TPM
-SECVAR_STORAGE_SRCS = secboot_tpm.c tpmnv_ops.c
-#SECVAR_STORAGE_SRCS = secboot_tpm.c fakenv_ops.c
+SECVAR_STORAGE_OBJS = secboot_tpm.o tpmnv_ops.o
+#SECVAR_STORAGE_OBJS = secboot_tpm.o fakenv_ops.o
-SECVAR_STORAGE_OBJS = $(SECVAR_STORAGE_SRCS:%.c=%.o)
SECVAR_STORAGE = $(SECVAR_STORAGE_DIR)/built-in.a
$(SECVAR_STORAGE): $(SECVAR_STORAGE_OBJS:%=$(SECVAR_STORAGE_DIR)/%)
gen_tpmnv_public_name: $@
- gcc -o $@ $(SECVAR_STORAGE_DIR)/$@.c -I $(SRC)/libstb/tss2/ibmtpm20tss/utils/ -lmbedcrypto
+ $(HOSTCC) -o $@ $(SECVAR_STORAGE_DIR)/$@.c -I $(SRC)/libstb/tss2/ibmtpm20tss/utils/ -lmbedcrypto