From 731fcf06dba4e2098bc1689510e4d13306ff8e41 Mon Sep 17 00:00:00 2001 From: Soren Brinkmann Date: Sat, 11 Jul 2015 09:03:34 -0700 Subject: [PATCH] xilsecure: Fix make rules When building xilsecure with '-rR' as arguments to make causes this error: Compiling Xilsecure Library make[1]: *** No rule to make target 'xsecure_sha.o', needed by 'libxilsecure.a'. Stop. Makefile:27: recipe for target 'psu_cortexa53_0/libsrc/xilsecure_v1_0/src/make.libs' failed make: *** [psu_cortexa53_0/libsrc/xilsecure_v1_0/src/make.libs] Error 2 Fixing this by adding a pattern rules matching the required object files. Signed-off-by: Soren Brinkmann Acked-by: Bhavik Ameta --- lib/sw_services/xilsecure/src/Makefile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/sw_services/xilsecure/src/Makefile b/lib/sw_services/xilsecure/src/Makefile index 3dbb5c52..3f6bbe61 100755 --- a/lib/sw_services/xilsecure/src/Makefile +++ b/lib/sw_services/xilsecure/src/Makefile @@ -57,6 +57,7 @@ RELEASEDIR=../../../lib INCLUDEDIR=../../../include INCLUDES=-I./include/ -I${INCLUDEDIR} SECURE_DIR = . +OBJDIR = obj/ LIB_SRCS = $(SECURE_DIR)/xsecure_sha.c \ $(SECURE_DIR)/xsecure_aes.c \ @@ -67,7 +68,7 @@ LIB_SRCS = $(SECURE_DIR)/xsecure_sha.c \ SECURE_SRCS = $(LIB_SRCS) -SECURE_OBJS = $(SECURE_SRCS:%.c=%.o) +SECURE_OBJS = $(addprefix $(OBJDIR), $(SECURE_SRCS:%.c=%.o)) EXPORT_INCLUDE_FILES = $(SECURE_DIR)/xsecure_sha.h \ @@ -96,10 +97,10 @@ libxilsecure.a: obj_dir print_msg_secure_base $(SECURE_OBJS) obj_dir: - mkdir obj + mkdir -p obj print_msg_secure_base: @echo "Compiling Xilsecure Library" -.c.o: - $(COMPILER) $(COMPILER_FLAGS) $(EXTRA_COMPILER_FLAGS) $(INCLUDES) -c $< -o obj/$(@F) +$(OBJDIR)%.o: $(SECURE_DIR)/%.c + $(COMPILER) $(COMPILER_FLAGS) $(EXTRA_COMPILER_FLAGS) $(INCLUDES) -c $< -o $@