mirror of
https://github.com/ipxe/ipxe
synced 2026-01-01 00:07:27 +03:00
[build] Allow for named configurations at build time
Allow named configurations to be specified via the CONFIG=... build parameter. For headers in config/*.h which support named configurations, the following files will be included when building with CONFIG=<name>: - config/defaults/<platform>.h (e.g. config/defaults/pcbios.h) - config/<header>.h - config/<name>/<header>.h (only if the directory config/<name> exists) - config/local/<header>.h (autocreated if necessary) - config/local/<name>/<header>.h (autocreated if necessary) This mechanism allows for predefined named configurations to be checked in to the source tree, as a directory config/<name> containing all of the required header files. The mechanism also allows for users to define multiple local configurations, by creating header files in the directory config/local/<name>. Note that the config/*.h files which are used only to configure internal iPXE APIs (e.g. config/ioapi.h) cannot be modified via a named configuration. This avoids rebuilding the entire iPXE codebase whenever switching to a different named configuration. Inspired-by: Robin Smidsrød <robin@smidsrod.no> Tested-by: Robin Smidsrød <robin@smidsrod.no> Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
26
src/config/named.h
Normal file
26
src/config/named.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#ifndef CONFIG_NAMED_H
|
||||
#define CONFIG_NAMED_H
|
||||
|
||||
/** @file
|
||||
*
|
||||
* Named configurations
|
||||
*
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
/* config/<name>/<header>.h */
|
||||
#ifdef CONFIG
|
||||
#define NAMED_CONFIG(_header) <config/CONFIG/_header>
|
||||
#else
|
||||
#define NAMED_CONFIG(_header) <config/_header>
|
||||
#endif
|
||||
|
||||
/* config/local/<name>/<header>.h */
|
||||
#ifdef LOCAL_CONFIG
|
||||
#define LOCAL_NAMED_CONFIG(_header) <config/local/LOCAL_CONFIG/_header>
|
||||
#else
|
||||
#define LOCAL_NAMED_CONFIG(_header) <config/_header>
|
||||
#endif
|
||||
|
||||
#endif /* CONFIG_NAMED_H */
|
||||
Reference in New Issue
Block a user