Anastasia Klimchuk has submitted this change. ( https://review.coreboot.org/c/flashrom/+/58622 )
Change subject: Introduce an `include` directory for header files ......................................................................
Introduce an `include` directory for header files
Move all header files to the new `include` directory. Adapt include directives and build systems to the new directory.
Change-Id: Iaddd6bbfa0624b166d422f665877f096983bf4cf Signed-off-by: Felix Singer felix.singer@secunet.com Signed-off-by: Thomas Heijligen thomas.heijligen@secunet.com Reviewed-on: https://review.coreboot.org/c/flashrom/+/58622 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Anastasia Klimchuk aklm@chromium.org --- M Makefile R include/chipdrivers.h R include/coreboot_tables.h R include/custom_baud.h R include/edi.h R include/ene.h R include/flash.h R include/flashchips.h R include/fmap.h R include/hwaccess_physmap.h R include/hwaccess_x86_io.h R include/hwaccess_x86_msr.h R include/i2c_helper.h R include/ich_descriptors.h R include/layout.h R include/libflashrom.h R include/platform.h R include/platform/pci.h R include/programmer.h R include/spi.h R include/usb_device.h R include/writeprotect.h M meson.build M platform/endian_big.c M platform/endian_little.c M platform/memaccess.c M util/ich_descriptors_tool/Makefile M util/ich_descriptors_tool/meson.build 28 files changed, 16 insertions(+), 9 deletions(-)
Approvals: build bot (Jenkins): Verified Anastasia Klimchuk: Looks good to me, approved
diff --git a/Makefile b/Makefile index 26c77d9..e4cfede 100644 --- a/Makefile +++ b/Makefile @@ -253,6 +253,8 @@ HAS_SERIAL := $(strip $(if $(filter $(TARGET_OS), DOS libpayload), no, yes)) EXEC_SUFFIX := $(strip $(if $(filter $(TARGET_OS), DOS MinGW), .exe))
+override CFLAGS += -Iinclude + ifeq ($(TARGET_OS), DOS) # DJGPP has odd uint*_t definitions which cause lots of format string warnings. override CFLAGS += -Wno-format @@ -985,11 +987,11 @@ $(INSTALL) -m 0755 $(PROGRAM)$(EXEC_SUFFIX) $(DESTDIR)$(PREFIX)/sbin $(INSTALL) -m 0644 $(PROGRAM).8 $(DESTDIR)$(MANDIR)/man8
-libinstall: libflashrom.a libflashrom.h +libinstall: libflashrom.a include/libflashrom.h mkdir -p $(DESTDIR)$(PREFIX)/lib $(INSTALL) -m 0644 libflashrom.a $(DESTDIR)$(PREFIX)/lib mkdir -p $(DESTDIR)$(PREFIX)/include - $(INSTALL) -m 0644 libflashrom.h $(DESTDIR)$(PREFIX)/include + $(INSTALL) -m 0644 include/libflashrom.h $(DESTDIR)$(PREFIX)/include
_export: $(PROGRAM).8 @rm -rf "$(EXPORTDIR)/flashrom-$(RELEASENAME)" diff --git a/chipdrivers.h b/include/chipdrivers.h similarity index 100% rename from chipdrivers.h rename to include/chipdrivers.h diff --git a/coreboot_tables.h b/include/coreboot_tables.h similarity index 100% rename from coreboot_tables.h rename to include/coreboot_tables.h diff --git a/custom_baud.h b/include/custom_baud.h similarity index 100% rename from custom_baud.h rename to include/custom_baud.h diff --git a/edi.h b/include/edi.h similarity index 100% rename from edi.h rename to include/edi.h diff --git a/ene.h b/include/ene.h similarity index 100% rename from ene.h rename to include/ene.h diff --git a/flash.h b/include/flash.h similarity index 100% rename from flash.h rename to include/flash.h diff --git a/flashchips.h b/include/flashchips.h similarity index 100% rename from flashchips.h rename to include/flashchips.h diff --git a/fmap.h b/include/fmap.h similarity index 100% rename from fmap.h rename to include/fmap.h diff --git a/hwaccess_physmap.h b/include/hwaccess_physmap.h similarity index 100% rename from hwaccess_physmap.h rename to include/hwaccess_physmap.h diff --git a/hwaccess_x86_io.h b/include/hwaccess_x86_io.h similarity index 100% rename from hwaccess_x86_io.h rename to include/hwaccess_x86_io.h diff --git a/hwaccess_x86_msr.h b/include/hwaccess_x86_msr.h similarity index 100% rename from hwaccess_x86_msr.h rename to include/hwaccess_x86_msr.h diff --git a/i2c_helper.h b/include/i2c_helper.h similarity index 100% rename from i2c_helper.h rename to include/i2c_helper.h diff --git a/ich_descriptors.h b/include/ich_descriptors.h similarity index 100% rename from ich_descriptors.h rename to include/ich_descriptors.h diff --git a/layout.h b/include/layout.h similarity index 100% rename from layout.h rename to include/layout.h diff --git a/libflashrom.h b/include/libflashrom.h similarity index 100% rename from libflashrom.h rename to include/libflashrom.h diff --git a/platform.h b/include/platform.h similarity index 100% rename from platform.h rename to include/platform.h diff --git a/platform/pci.h b/include/platform/pci.h similarity index 100% rename from platform/pci.h rename to include/platform/pci.h diff --git a/programmer.h b/include/programmer.h similarity index 100% rename from programmer.h rename to include/programmer.h diff --git a/spi.h b/include/spi.h similarity index 100% rename from spi.h rename to include/spi.h diff --git a/usb_device.h b/include/usb_device.h similarity index 100% rename from usb_device.h rename to include/usb_device.h diff --git a/writeprotect.h b/include/writeprotect.h similarity index 100% rename from writeprotect.h rename to include/writeprotect.h diff --git a/meson.build b/meson.build index f8ca1d3..32e31df 100644 --- a/meson.build +++ b/meson.build @@ -379,10 +379,12 @@ mandir = join_paths(prefix, get_option('mandir'))
install_headers([ - 'libflashrom.h', + 'include/libflashrom.h', ], )
+include_dir = include_directories('include') + # core modules needed by both the library and the CLI srcs += '82802ab.c' srcs += 'at45db.c' @@ -423,6 +425,7 @@ sources : [ srcs, ], + include_directories : include_dir, soversion : lt_current, version : lt_version, dependencies : [ @@ -466,7 +469,7 @@
flashrom_dep = declare_dependency( link_with : flashrom, - include_directories : include_directories('.'), + include_directories : include_dir, dependencies : deps )
@@ -493,6 +496,7 @@ 'cli_output.c', 'flashrom.c', ], + include_directories : include_dir, dependencies : [ deps, ], @@ -512,7 +516,7 @@ required: false ) flashrom_test_dep = declare_dependency( - include_directories : include_directories('.'), + include_directories : include_dir, sources : [ srcs, 'cli_common.c', diff --git a/platform/endian_big.c b/platform/endian_big.c index 5d65500..6541a83 100644 --- a/platform/endian_big.c +++ b/platform/endian_big.c @@ -15,7 +15,7 @@ * GNU General Public License for more details. */
-#include "../platform.h" +#include "platform.h"
/* convert cpu native endian to little endian */ ___return_swapped(cpu_to_le, 8) diff --git a/platform/endian_little.c b/platform/endian_little.c index b7c0068..aeb9d57 100644 --- a/platform/endian_little.c +++ b/platform/endian_little.c @@ -15,7 +15,7 @@ * GNU General Public License for more details. */
-#include "../platform.h" +#include "platform.h"
/* convert cpu native endian to little endian */ ___return_same(cpu_to_le, 8) diff --git a/platform/memaccess.c b/platform/memaccess.c index 44ef410..8368121 100644 --- a/platform/memaccess.c +++ b/platform/memaccess.c @@ -15,7 +15,7 @@ * GNU General Public License for more details. */
-#include "../platform.h" +#include "platform.h"
/* * macro to return endian aware read function diff --git a/util/ich_descriptors_tool/Makefile b/util/ich_descriptors_tool/Makefile index 7f5814f..4d971f5 100644 --- a/util/ich_descriptors_tool/Makefile +++ b/util/ich_descriptors_tool/Makefile @@ -21,6 +21,7 @@ # If the user has specified custom CFLAGS, all CFLAGS settings below will be # completely ignored by gnumake. CFLAGS ?= -Os -Wall -Wshadow +CFLAGS += -I$(SHAREDSRCDIR)/include
# Auto determine HOST_OS and TARGET_OS if they are not set as argument HOST_OS ?= $(shell uname) diff --git a/util/ich_descriptors_tool/meson.build b/util/ich_descriptors_tool/meson.build index b5bf09e..19097ee 100644 --- a/util/ich_descriptors_tool/meson.build +++ b/util/ich_descriptors_tool/meson.build @@ -7,7 +7,7 @@ dependencies : [ deps, ], - include_directories : include_directories('../..'), + include_directories : include_dir, c_args : [ '-DICH_DESCRIPTORS_FROM_DUMP_ONLY', ],