From 350c8699552fc6e84c6168601ba46d406a64978e Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Sun, 12 Dec 2021 09:41:16 -0600 Subject: [PATCH] Update: Restructure fake settings, moving examples into a new projects directory. Create a projects directory to store some real replacements of other projects build systems. The bzip2 build system was used as just an example and is now treated as a real use case. I am planning on trying to use cmocka to provide unit tests for this project. The cmocka uses that rather unpleasant cmake. Provide a cmocka fake build setting file for building cmocka. --- level_3/fake/data/build/fakefile-example-bzip2 | 39 ---------------------- .../data/build/fakefile-example-linux_using_make | 7 ++-- level_3/fake/data/projects/bzip2/1.0.8/fakefile | 39 ++++++++++++++++++++++ .../bzip2/1.0.8/settings-bzip2} | 14 ++++---- .../bzip2/1.0.8/settings-bzip2recover} | 8 ++--- level_3/fake/data/projects/cmocka/1.1.5/settings | 39 ++++++++++++++++++++++ 6 files changed, 92 insertions(+), 54 deletions(-) delete mode 100644 level_3/fake/data/build/fakefile-example-bzip2 create mode 100644 level_3/fake/data/projects/bzip2/1.0.8/fakefile rename level_3/fake/data/{build/settings-example-bzip2 => projects/bzip2/1.0.8/settings-bzip2} (54%) rename level_3/fake/data/{build/settings-example-bzip2recover => projects/bzip2/1.0.8/settings-bzip2recover} (72%) create mode 100644 level_3/fake/data/projects/cmocka/1.1.5/settings diff --git a/level_3/fake/data/build/fakefile-example-bzip2 b/level_3/fake/data/build/fakefile-example-bzip2 deleted file mode 100644 index 35d51b1..0000000 --- a/level_3/fake/data/build/fakefile-example-bzip2 +++ /dev/null @@ -1,39 +0,0 @@ -# fss-0005 iki-0002 -# -# This is designed for bzip2-1.0.8 as an example for compiling bzip2. -# -# To use this example do the following: -# 1) download and extract bzip2-1.0.8. -# 2) change into the extracted bzip2-1.0.8 directory. -# 3) create the directory path "data/build/" within this bzip2-1.0.8 directory. -# 4) copy the files fakefile-example-bzip2, settings-example-bzip2, and settings-example-bzip2recover) into the created directory path "data/build/". -# 5) use the featureless make build operation to make, such as: "fake make -f fakefile-example-bzip2". - -settings: - load_build no - fail exit - - compiler gcc - indexer ar - indexer_arguments rcs - -main: - operate bzip2 - operate bzip2recover - operate scripts - -bzip2: - print - print Building settings-example-bzip2. - build settings-example-bzip2 - -bzip2recover: - print - print Building settings-example-bzip2recover. - build settings-example-bzip2recover - -scripts: - print - print copying bzip2 scripts. - touch directory build build/programs build/programs/scripts - copy bzdiff bzgrep build/programs/scripts diff --git a/level_3/fake/data/build/fakefile-example-linux_using_make b/level_3/fake/data/build/fakefile-example-linux_using_make index 1417a82..76ca62a 100644 --- a/level_3/fake/data/build/fakefile-example-linux_using_make +++ b/level_3/fake/data/build/fakefile-example-linux_using_make @@ -6,9 +6,9 @@ # This assumes make and everything necessary to compile the linux kernel is available. # # To use this example do the following: -# 1) download and extract the linux source, such as linux-5.8.8. -# 2) change into the extracted source (linux-5.8.8) directory. -# 3) run using this, such as: "fake make -f /path/to/fakefile-example-bzip2". +# 1) Download and extract the linux source, such as linux-5.8.8. +# 2) Change into the extracted source (linux-5.8.8) directory. +# 3) Run using this, such as: "fake make -f /path/to/fakefile-example-linux_using_make". settings: load_build no @@ -21,7 +21,6 @@ settings: parameter config defconfig main: - print print Cleaning Linux kernel source. run make mrproper diff --git a/level_3/fake/data/projects/bzip2/1.0.8/fakefile b/level_3/fake/data/projects/bzip2/1.0.8/fakefile new file mode 100644 index 0000000..fd8104b --- /dev/null +++ b/level_3/fake/data/projects/bzip2/1.0.8/fakefile @@ -0,0 +1,39 @@ +# fss-0005 iki-0002 +# +# This is designed for compiling bzip2-1.0.8. +# +# To use this do the following: +# 1) Download and extract bzip2-1.0.8. +# 2) Change into the extracted bzip2-1.0.8 directory. +# 3) Create the directory path "data/build/" within this bzip2-1.0.8 directory. +# 4) Copy the files fakefile-bzip2, settings-bzip2, and settings-bzip2recover) into the created directory path "data/build/". +# 5) Use the featureless make build operation to make, such as: "fake make -f fakefile-bzip2". + +settings: + load_build no + fail exit + + compiler gcc + indexer ar + indexer_arguments rcs + +main: + operate bzip2 + operate bzip2recover + operate scripts + +bzip2: + print + print Building settings-bzip2. + build settings-bzip2 + +bzip2recover: + print + print Building settings-bzip2recover. + build settings-bzip2recover + +scripts: + print + print copying bzip2 scripts. + touch directory build build/programs build/programs/scripts + copy bzdiff bzgrep build/programs/scripts diff --git a/level_3/fake/data/build/settings-example-bzip2 b/level_3/fake/data/projects/bzip2/1.0.8/settings-bzip2 similarity index 54% rename from level_3/fake/data/build/settings-example-bzip2 rename to level_3/fake/data/projects/bzip2/1.0.8/settings-bzip2 index 5af88ff..6373619 100644 --- a/level_3/fake/data/build/settings-example-bzip2 +++ b/level_3/fake/data/projects/bzip2/1.0.8/settings-bzip2 @@ -1,13 +1,13 @@ # fss-0001 # -# This is designed for bzip2-1.0.8 as an example for compiling bzip2. +# This is designed for compiling bzip2-1.0.8. # -# To use this example do the following: -# 1) download and extract bzip2-1.0.8. -# 2) change into the extracted bzip2-1.0.8 directory. -# 3) create the directory path "data/build/" within this bzip2-1.0.8 directory. -# 4) copy this file (settings-example-bzip2) into the created directory path "data/build/". -# 5) use the featureless make build operation to build, such as: "fake build -s settings-example-bzip2". +# To use this do the following: +# 1) Download and extract bzip2-1.0.8. +# 2) Change into the extracted bzip2-1.0.8 directory. +# 3) Create the directory path "data/build/" within this bzip2-1.0.8 directory. +# 4) Copy this file (settings-bzip2) into the created directory path "data/build/". +# 5) Use the featureless make build operation to build, such as: "fake build -s settings-bzip2". project_name bzip2 diff --git a/level_3/fake/data/build/settings-example-bzip2recover b/level_3/fake/data/projects/bzip2/1.0.8/settings-bzip2recover similarity index 72% rename from level_3/fake/data/build/settings-example-bzip2recover rename to level_3/fake/data/projects/bzip2/1.0.8/settings-bzip2recover index da70061..515c373 100644 --- a/level_3/fake/data/build/settings-example-bzip2recover +++ b/level_3/fake/data/projects/bzip2/1.0.8/settings-bzip2recover @@ -1,13 +1,13 @@ # fss-0001 # -# This is designed for bzip2-1.0.8 as an example for compiling bzip2recover. +# This is designed for compiling bzip2-1.0.8. # -# To use this example do the following: +# To use this do the following: # 1) download and extract bzip2-1.0.8. # 2) change into the extracted bzip2-1.0.8 directory. # 3) create the directory path "data/build/" within this bzip2-1.0.8 directory. -# 4) copy this file (settings-example-bzip2recover) into the created directory path "data/build/". -# 5) use the featureless make build operation to build, such as: "fake build -s settings-example-bzip2recover". +# 4) copy this file (settings-bzip2recover) into the created directory path "data/build/". +# 5) use the featureless make build operation to build, such as: "fake build -s settings-bzip2recover". project_name bzip2recover diff --git a/level_3/fake/data/projects/cmocka/1.1.5/settings b/level_3/fake/data/projects/cmocka/1.1.5/settings new file mode 100644 index 0000000..6a82626 --- /dev/null +++ b/level_3/fake/data/projects/cmocka/1.1.5/settings @@ -0,0 +1,39 @@ +# fss-0001 +# +# This is designed for compiling cmocka-1.1.5. +# +# To use this do the following: +# 1) Download and extract cmocka-1.1.5. +# 2) Change into the extracted cmocka-1.1.5 directory. +# 3) Create the directory path "data/build/" within this cmocka-1.1.5 directory. +# 4) Copy this file (settings) into the created directory path "data/build/". +# 5) Use the featureless make build operation to build, such as: "fake build". +# +# This depends on a c-library with realtime and pthread support. + +project_name cmocka + +version_major 1 +version_minor 1 +version_micro 5 +version_file micro +version_target major + +build_compiler gcc +build_indexer ar +build_indexer_arguments rcs +build_language c +build_libraries -pthread -lrt -lc +build_sources_library src/cmocka.c +build_sources_headers include/cmocka.h include/cmocka_pbc.h +build_script no + +path_sources +path_standard no + +defines -DHAVE_MALLOC_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_SIGNAL_H=1 -DHAVE_STRINGS_H=1 -DHAVE_GCC_THREAD_LOCAL_STORAGE=1 -DHAVE_CLOCK_REALTIME=1 -DHAVE_SIGLONGJMP=1 -DHAVE_STRSIGNAL=1 + +flags -z now -g -fdiagnostics-color=always -Wall -Winline -O2 -Iinclude/ -std=gnu99 +flags -Wpedantic -Wall -Wshadow -Wmissing-prototypes -Wcast-align -Werror=address -Wstrict-prototypes -Werror=strict-prototypes -Wwrite-strings -Werror=write-strings -Werror-implicit-function-declaration -Wpointer-arith -Werror=pointer-arith -Wdeclaration-after-statement -Werror=declaration-after-statement -Wreturn-type -Werror=return-type -Wuninitialized -Werror=uninitialized -Wimplicit-fallthrough -Werror=strict-overflow -Wstrict-overflow=2 -Wno-format-zero-length -Wmissing-field-initializers -Wformat -Wformat-security -Werror=format-security +flags -fno-common -fstack-protector-strong -fstack-clash-protection +flags_library -fPIC -- 1.8.3.1