summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Heijligen <thomas.heijligen@secunet.com>2022-04-14 13:50:55 +0200
committerAnastasia Klimchuk <aklm@chromium.org>2022-04-29 01:50:46 +0000
commit87d7b110d6ed6d4ef0b61e777f2fee3c10808f0b (patch)
treeca84844a110c7cad98b998248442463bafe0d45f
parentbfbec45de0963b76081f5ff95681ce887ba1ef90 (diff)
downloadflashrom-87d7b110d6ed6d4ef0b61e777f2fee3c10808f0b.tar.gz
flashrom-87d7b110d6ed6d4ef0b61e777f2fee3c10808f0b.tar.bz2
flashrom-87d7b110d6ed6d4ef0b61e777f2fee3c10808f0b.zip
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>
-rw-r--r--Makefile6
-rw-r--r--include/chipdrivers.h (renamed from chipdrivers.h)0
-rw-r--r--include/coreboot_tables.h (renamed from coreboot_tables.h)0
-rw-r--r--include/custom_baud.h (renamed from custom_baud.h)0
-rw-r--r--include/edi.h (renamed from edi.h)0
-rw-r--r--include/ene.h (renamed from ene.h)0
-rw-r--r--include/flash.h (renamed from flash.h)0
-rw-r--r--include/flashchips.h (renamed from flashchips.h)0
-rw-r--r--include/fmap.h (renamed from fmap.h)0
-rw-r--r--include/hwaccess_physmap.h (renamed from hwaccess_physmap.h)0
-rw-r--r--include/hwaccess_x86_io.h (renamed from hwaccess_x86_io.h)0
-rw-r--r--include/hwaccess_x86_msr.h (renamed from hwaccess_x86_msr.h)0
-rw-r--r--include/i2c_helper.h (renamed from i2c_helper.h)0
-rw-r--r--include/ich_descriptors.h (renamed from ich_descriptors.h)0
-rw-r--r--include/layout.h (renamed from layout.h)0
-rw-r--r--include/libflashrom.h (renamed from libflashrom.h)0
-rw-r--r--include/platform.h (renamed from platform.h)0
-rw-r--r--include/platform/pci.h (renamed from platform/pci.h)0
-rw-r--r--include/programmer.h (renamed from programmer.h)0
-rw-r--r--include/spi.h (renamed from spi.h)0
-rw-r--r--include/usb_device.h (renamed from usb_device.h)0
-rw-r--r--include/writeprotect.h (renamed from writeprotect.h)0
-rw-r--r--meson.build10
-rw-r--r--platform/endian_big.c2
-rw-r--r--platform/endian_little.c2
-rw-r--r--platform/memaccess.c2
-rw-r--r--util/ich_descriptors_tool/Makefile1
-rw-r--r--util/ich_descriptors_tool/meson.build2
28 files changed, 16 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index 26c77d9e6..e4cfede97 100644
--- a/Makefile
+++ b/Makefile
@@ -253,6 +253,8 @@ HAS_LINUX_I2C := $(call c_compile_test, Makefile.d/linux_i2c_test.c)
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: $(PROGRAM)$(EXEC_SUFFIX) $(PROGRAM).8
$(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
index 0695993a8..0695993a8 100644
--- a/chipdrivers.h
+++ b/include/chipdrivers.h
diff --git a/coreboot_tables.h b/include/coreboot_tables.h
index e1f63a81d..e1f63a81d 100644
--- a/coreboot_tables.h
+++ b/include/coreboot_tables.h
diff --git a/custom_baud.h b/include/custom_baud.h
index c8b8fc296..c8b8fc296 100644
--- a/custom_baud.h
+++ b/include/custom_baud.h
diff --git a/edi.h b/include/edi.h
index 542bf26ec..542bf26ec 100644
--- a/edi.h
+++ b/include/edi.h
diff --git a/ene.h b/include/ene.h
index e03e49b2e..e03e49b2e 100644
--- a/ene.h
+++ b/include/ene.h
diff --git a/flash.h b/include/flash.h
index 9493fd21c..9493fd21c 100644
--- a/flash.h
+++ b/include/flash.h
diff --git a/flashchips.h b/include/flashchips.h
index ba9771997..ba9771997 100644
--- a/flashchips.h
+++ b/include/flashchips.h
diff --git a/fmap.h b/include/fmap.h
index 924e11f6b..924e11f6b 100644
--- a/fmap.h
+++ b/include/fmap.h
diff --git a/hwaccess_physmap.h b/include/hwaccess_physmap.h
index a0a7e74d8..a0a7e74d8 100644
--- a/hwaccess_physmap.h
+++ b/include/hwaccess_physmap.h
diff --git a/hwaccess_x86_io.h b/include/hwaccess_x86_io.h
index 31d1e86c8..31d1e86c8 100644
--- a/hwaccess_x86_io.h
+++ b/include/hwaccess_x86_io.h
diff --git a/hwaccess_x86_msr.h b/include/hwaccess_x86_msr.h
index eda007e80..eda007e80 100644
--- a/hwaccess_x86_msr.h
+++ b/include/hwaccess_x86_msr.h
diff --git a/i2c_helper.h b/include/i2c_helper.h
index 709a748d1..709a748d1 100644
--- a/i2c_helper.h
+++ b/include/i2c_helper.h
diff --git a/ich_descriptors.h b/include/ich_descriptors.h
index cd5a45cb1..cd5a45cb1 100644
--- a/ich_descriptors.h
+++ b/include/ich_descriptors.h
diff --git a/layout.h b/include/layout.h
index abbdc22c1..abbdc22c1 100644
--- a/layout.h
+++ b/include/layout.h
diff --git a/libflashrom.h b/include/libflashrom.h
index 936c9aeb7..936c9aeb7 100644
--- a/libflashrom.h
+++ b/include/libflashrom.h
diff --git a/platform.h b/include/platform.h
index d15082f02..d15082f02 100644
--- a/platform.h
+++ b/include/platform.h
diff --git a/platform/pci.h b/include/platform/pci.h
index 93bc163be..93bc163be 100644
--- a/platform/pci.h
+++ b/include/platform/pci.h
diff --git a/programmer.h b/include/programmer.h
index 5fb06260e..5fb06260e 100644
--- a/programmer.h
+++ b/include/programmer.h
diff --git a/spi.h b/include/spi.h
index 14f71aa06..14f71aa06 100644
--- a/spi.h
+++ b/include/spi.h
diff --git a/usb_device.h b/include/usb_device.h
index 8b7a80106..8b7a80106 100644
--- a/usb_device.h
+++ b/include/usb_device.h
diff --git a/writeprotect.h b/include/writeprotect.h
index e27403dcf..e27403dcf 100644
--- a/writeprotect.h
+++ b/include/writeprotect.h
diff --git a/meson.build b/meson.build
index f8ca1d3d0..32e31df35 100644
--- a/meson.build
+++ b/meson.build
@@ -379,10 +379,12 @@ libdir = join_paths(prefix, get_option('libdir'))
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 @@ flashrom = library(
sources : [
srcs,
],
+ include_directories : include_dir,
soversion : lt_current,
version : lt_version,
dependencies : [
@@ -466,7 +469,7 @@ configure_file(
flashrom_dep = declare_dependency(
link_with : flashrom,
- include_directories : include_directories('.'),
+ include_directories : include_dir,
dependencies : deps
)
@@ -493,6 +496,7 @@ executable(
'cli_output.c',
'flashrom.c',
],
+ include_directories : include_dir,
dependencies : [
deps,
],
@@ -512,7 +516,7 @@ cmocka_dep = dependency(
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 5d65500dc..6541a831e 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 b7c006818..aeb9d5730 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 44ef41084..836812123 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 7f5814fc1..4d971f551 100644
--- a/util/ich_descriptors_tool/Makefile
+++ b/util/ich_descriptors_tool/Makefile
@@ -21,6 +21,7 @@ SRC = $(wildcard *.c)
# 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 b5bf09ec9..19097eef9 100644
--- a/util/ich_descriptors_tool/meson.build
+++ b/util/ich_descriptors_tool/meson.build
@@ -7,7 +7,7 @@ executable(
dependencies : [
deps,
],
- include_directories : include_directories('../..'),
+ include_directories : include_dir,
c_args : [
'-DICH_DESCRIPTORS_FROM_DUMP_ONLY',
],