mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 08:24:32 -08:00
The great header shift: It didn't make sense to regenerate headers for the same module for every target (boot/kernel/user) it appeared in. And now that core headers are out of src/include, this was going to cause problems for the new libc changes I've been working on. So I went back to re-design how module headers work. Pre-requisites: - A module's public headers should all be available in one location, not tied to target. - No accidental includes. Another module should not be able to include anything (creating an implicit dependency) from a module without declaring an explicit dependency. - Exception to the previous: libc's headers should be available to all, at least for the freestanding headers. New system: - A new "public_headers" property of module declares all public headers that should be available to dependant modules - All public headers (after possible processing) are installed relative to build/include/<module> with the same path as their source - This also means no "include" dir in modules is necessary. If a header should be included as <j6/types.h> then its source should be src/libraries/j6/j6/types.h - this caused the most churn as all public header sources moved one directory up. - The "includes" property of a module is local only to that module now, it does not create any implicit public interface Other changes: - The bonnibel concept of sources changed: instead of sources having actions, they themselves are an instance of a (sub)class of Source, which provides all the necessary information itself. - Along with the above, rule names were standardized into <type>.<ext>, eg "compile.cpp" or "parse.cog" - cog and cogflags variables moved from per-target scope to global scope in the build files. - libc gained a more dynamic .module file
40 lines
1.4 KiB
YAML
40 lines
1.4 KiB
YAML
---
|
|
variables:
|
|
cc: clang
|
|
cxx: clang++
|
|
ld: ld.lld
|
|
ar: ar
|
|
nasm: nasm
|
|
objcopy: objcopy
|
|
|
|
ccflags: [
|
|
"-I${source_root}/src/include",
|
|
"-I${source_root}/src/include/x86_64",
|
|
"-fcolor-diagnostics",
|
|
"-U__STDCPP_THREADS__",
|
|
"-D_LIBCPP_HAS_NO_THREADS",
|
|
"-DVERSION_MAJOR=${version_major}",
|
|
"-DVERSION_MINOR=${version_minor}",
|
|
"-DVERSION_PATCH=${version_patch}",
|
|
"-DVERSION_GITSHA=0x${version_sha}",
|
|
'-DGIT_VERSION=\"${version_major}.${version_minor}.${version_patch}+${version_sha}\"',
|
|
'-DGIT_VERSION_WIDE=L\"${version_major}.${version_minor}.${version_patch}+${version_sha}\"',
|
|
|
|
"-Wformat=2", "-Winit-self", "-Wfloat-equal", "-Winline", "-Wmissing-format-attribute",
|
|
"-Wmissing-include-dirs", "-Wswitch", "-Wundef", "-Wdisabled-optimization",
|
|
"-Wpointer-arith", "-Wno-attributes", "-Wno-sign-compare", "-Wno-multichar",
|
|
"-Wno-div-by-zero", "-Wno-endif-labels", "-Wno-pragmas", "-Wno-format-extra-args",
|
|
"-Wno-unused-result", "-Wno-deprecated-declarations", "-Wno-unused-function",
|
|
"-Wno-address-of-packed-member", "-Wno-invalid-offsetof", "-Wno-format-nonliteral",
|
|
"-Werror" ]
|
|
|
|
asflags: [
|
|
"-DVERSION_MAJOR=${version_major}",
|
|
"-DVERSION_MINOR=${version_minor}",
|
|
"-DVERSION_PATCH=${version_patch}",
|
|
"-DVERSION_GITSHA=0x${version_sha}",
|
|
"-I${source_root}/src/include" ]
|
|
|
|
cflags: [ "-std=c11" ]
|
|
cxxflags: [ "-std=c++17" ]
|