From a8fba52b44d8336578b021ab318c5af750dcffd2 Mon Sep 17 00:00:00 2001 From: Glen Whitney Date: Sun, 18 Dec 2022 16:50:01 -0500 Subject: [PATCH] chore: initialize build2 project --- .gitignore | 51 +++++++++++++++++++++---------------------- build/.gitignore | 4 ++++ build/bootstrap.build | 7 ++++++ build/root.build | 20 +++++++++++++++++ buildfile | 1 + cpm/.gitignore | 5 +++++ cpm/buildfile | 6 +++++ cpm/cpm.cxx | 14 ++++++++++++ cpm/testscript | 9 ++++++++ manifest | 12 ++++++++++ repositories.manifest | 11 ++++++++++ 11 files changed, 114 insertions(+), 26 deletions(-) create mode 100644 build/.gitignore create mode 100644 build/bootstrap.build create mode 100644 build/root.build create mode 100644 buildfile create mode 100644 cpm/.gitignore create mode 100644 cpm/buildfile create mode 100644 cpm/cpm.cxx create mode 100644 cpm/testscript create mode 100644 manifest create mode 100644 repositories.manifest diff --git a/.gitignore b/.gitignore index e257658..e9c9440 100644 --- a/.gitignore +++ b/.gitignore @@ -1,34 +1,33 @@ -# ---> C++ -# Prerequisites -*.d +.bdep/ -# Compiled Object files -*.slo -*.lo +# Editor backups +*~ + +# Local default options files. +# +.build2/local/ + +# Compiler/linker output. +# +*.d +*.t +*.i +*.i.* +*.ii +*.ii.* *.o *.obj - -# Precompiled Headers -*.gch -*.pch - -# Compiled Dynamic libraries +*.gcm +*.pcm +*.ifc *.so -*.dylib *.dll - -# Fortran module files -*.mod -*.smod - -# Compiled Static libraries -*.lai -*.la *.a *.lib - -# Executables +*.exp +*.pdb +*.ilk *.exe -*.out -*.app - +*.exe.dlls/ +*.exe.manifest +*.pc diff --git a/build/.gitignore b/build/.gitignore new file mode 100644 index 0000000..974e01d --- /dev/null +++ b/build/.gitignore @@ -0,0 +1,4 @@ +/config.build +/root/ +/bootstrap/ +build/ diff --git a/build/bootstrap.build b/build/bootstrap.build new file mode 100644 index 0000000..e2cddf4 --- /dev/null +++ b/build/bootstrap.build @@ -0,0 +1,7 @@ +project = cplusminus + +using version +using config +using test +using install +using dist diff --git a/build/root.build b/build/root.build new file mode 100644 index 0000000..ae3d2a6 --- /dev/null +++ b/build/root.build @@ -0,0 +1,20 @@ +# Uncomment to suppress warnings coming from external libraries. +# +#cxx.internal.scope = current + +cxx.std = latest + +using cxx + +hxx{*}: extension = hxx +ixx{*}: extension = ixx +txx{*}: extension = txx +cxx{*}: extension = cxx + +# Assume headers are importable unless stated otherwise. +# +hxx{*}: cxx.importable = true + +# The test target for cross-testing (running tests under Wine, etc). +# +test.target = $cxx.target diff --git a/buildfile b/buildfile new file mode 100644 index 0000000..b760c85 --- /dev/null +++ b/buildfile @@ -0,0 +1 @@ +./: {*/ -build/} doc{README.md} legal{LICENSE} manifest diff --git a/cpm/.gitignore b/cpm/.gitignore new file mode 100644 index 0000000..d9ce0ed --- /dev/null +++ b/cpm/.gitignore @@ -0,0 +1,5 @@ +cpm + +# Testscript output directory (can be symlink). +# +test-cpm diff --git a/cpm/buildfile b/cpm/buildfile new file mode 100644 index 0000000..fd2b8f3 --- /dev/null +++ b/cpm/buildfile @@ -0,0 +1,6 @@ +libs = +#import libs += libhello%lib{hello} + +exe{cpm}: {hxx ixx txx cxx}{**} $libs testscript + +cxx.poptions =+ "-I$out_root" "-I$src_root" diff --git a/cpm/cpm.cxx b/cpm/cpm.cxx new file mode 100644 index 0000000..086aaa1 --- /dev/null +++ b/cpm/cpm.cxx @@ -0,0 +1,14 @@ +#include + +int main (int argc, char* argv[]) +{ + using namespace std; + + if (argc < 2) + { + cerr << "error: missing name" << endl; + return 1; + } + + cout << "Hello, " << argv[1] << '!' << endl; +} diff --git a/cpm/testscript b/cpm/testscript new file mode 100644 index 0000000..cefda39 --- /dev/null +++ b/cpm/testscript @@ -0,0 +1,9 @@ +: basics +: +$* 'World' >'Hello, World!' + +: missing-name +: +$* 2>>EOE != 0 +error: missing name +EOE diff --git a/manifest b/manifest new file mode 100644 index 0000000..1ca6eee --- /dev/null +++ b/manifest @@ -0,0 +1,12 @@ +: 1 +name: cplusminus +version: 0.1.0-a.0.z +summary: cpm source transducer for C++ +license: MIT ; MIT License. +description-file: README.md +url: https://code.studioinfinity.org/glen/cplusminus +email: glen@studioinfinity.org +#build-error-email: glen@studioinfinity.org +depends: * build2 >= 0.15.0 +depends: * bpkg >= 0.15.0 +#depends: libhello ^1.0.0 diff --git a/repositories.manifest b/repositories.manifest new file mode 100644 index 0000000..11d38e0 --- /dev/null +++ b/repositories.manifest @@ -0,0 +1,11 @@ +: 1 +summary: cpm project repository + +#: +#role: prerequisite +#location: https://pkg.cppget.org/1/stable +#trust: ... + +#: +#role: prerequisite +#location: https://git.build2.org/hello/libhello.git