diff --git a/.gitignore b/.gitignore index cc5cbfb..a3b5e39 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,7 @@ tools/cert_create/src/*.o tools/cert_create/src/**/*.o tools/cert_create/cert_create + +# Ignore header files copied. +tools/fip_create/firmware_image_package.h +tools/fip_create/uuid.h diff --git a/tools/fip_create/Makefile b/tools/fip_create/Makefile index 52e06a7..da99302 100644 --- a/tools/fip_create/Makefile +++ b/tools/fip_create/Makefile @@ -34,6 +34,7 @@ PROJECT = fip_create OBJECTS = fip_create.o +COPIED_H_FILES := uuid.h firmware_image_package.h CFLAGS = -Wall -Werror -pedantic -std=c99 ifeq (${DEBUG},1) @@ -42,13 +43,12 @@ CFLAGS += -O2 endif -# Make soft links and include from local directory otherwise wrong headers -# could get pulled in from firmware tree. +# Only include from local directory (see comment below). INCLUDE_PATHS = -I. CC := gcc -.PHONY: all clean +.PHONY: all clean distclean all: ${PROJECT} @@ -59,10 +59,25 @@ @echo "Built $@ successfully" @${ECHO_BLANK_LINE} -%.o: %.c %.h Makefile +%.o: %.c %.h ${COPIED_H_FILES} Makefile @echo " CC $<" ${Q}${CC} -c ${CFLAGS} ${INCLUDE_PATHS} $< -o $@ +# +# Copy required library headers to a local directory so they can be included +# by this project without adding the library directories to the system include +# path. This avoids conflicts with definitions in the compiler standard +# include path. +# +uuid.h : ../../include/stdlib/sys/uuid.h + $(call SHELL_COPY,$<,$@) + +firmware_image_package.h : ../../include/common/firmware_image_package.h + $(call SHELL_COPY,$<,$@) + clean: $(call SHELL_DELETE_ALL, ${PROJECT} ${OBJECTS}) +distclean: clean + $(call SHELL_DELETE_ALL, ${COPIED_H_FILES}) + diff --git a/tools/fip_create/firmware_image_package.h b/tools/fip_create/firmware_image_package.h deleted file mode 120000 index cc61903..0000000 --- a/tools/fip_create/firmware_image_package.h +++ /dev/null @@ -1 +0,0 @@ -../../include/common/firmware_image_package.h \ No newline at end of file diff --git a/tools/fip_create/uuid.h b/tools/fip_create/uuid.h deleted file mode 120000 index c77762f..0000000 --- a/tools/fip_create/uuid.h +++ /dev/null @@ -1 +0,0 @@ -../../include/stdlib/sys/uuid.h \ No newline at end of file