diff options
| author | Louis Burda <quent.burda@gmail.com> | 2023-05-29 14:27:10 +0200 |
|---|---|---|
| committer | Louis Burda <quent.burda@gmail.com> | 2023-05-29 14:27:10 +0200 |
| commit | b9d452cb79b00278188b8ba229ac77915038340a (patch) | |
| tree | c8a1b09b5a75bba22483a92f58aa42a71f724522 | |
| parent | a53bb631112fc7ad0553bd5ac86dbfacb0d378e0 (diff) | |
| download | libstrvec-c-b9d452cb79b00278188b8ba229ac77915038340a.tar.gz libstrvec-c-b9d452cb79b00278188b8ba229ac77915038340a.zip | |
Template build.jst for debug configuration
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | build.jst | 52 | ||||
| -rw-r--r-- | build.jst.tmpl | 74 | ||||
| -rwxr-xr-x | configure | 8 | ||||
| m--------- | lib/liballoc | 0 | ||||
| m--------- | lib/libdvec | 0 |
6 files changed, 83 insertions, 52 deletions
@@ -1,4 +1,5 @@ build +build.jst .cache compile_commands.json vgcore* diff --git a/build.jst b/build.jst deleted file mode 100644 index 6ab60e4..0000000 --- a/build.jst +++ /dev/null @@ -1,52 +0,0 @@ -cc = clang - -cflags = -Wunused-function -Wunused-variable -Wconversion -Wformat - -I include -I lib/liballoc/include -I lib/libdvec/include - -rule liba - $cc -o $out.tmp.o $in $cflags -r - objcopy --keep-global-symbols=libstrvec.api $out.tmp.o $out.fixed.o - ar rcs $out $out.fixed.o - rm $out.tmp.o $out.fixed.o - -rule libso - $cc -o $out $in $cflags -shared -Wl,-version-script libstrvec.lds - -rule cc - $cc -o $out $in $cflags - -rule mkdir - mkdir $out - -target build - mkdir - -target lib/liballoc/build/liballoc.a - just lib/liballoc - -target lib/libdvec/build/libdvec.a - just lib/libdvec - -target build/libstrvec.a - liba src/strvec.c - lib/liballoc/build/liballoc.a | build - -target build/libstrvec.so - libso src/strvec.c | build - -target build/test - cc src/test.c build/libstrvec.a - lib/liballoc/build/liballoc.a - lib/libdvec/build/libdvec.a | build - -command clean - rm -rf build - -command cleanall - just clean - just -C lib/libdvec cleanall - just -C lib/liballoc cleanall - -command all - just build/libstrvec.a build/libstrvec.so build/test - diff --git a/build.jst.tmpl b/build.jst.tmpl new file mode 100644 index 0000000..833bd57 --- /dev/null +++ b/build.jst.tmpl @@ -0,0 +1,74 @@ +#default PREFIX /usr/local +#default INCLDIR /include +#default LIBDIR /lib +#default CC gcc + +#ifdef LIBSTRVEC_DEBUG +#define DEBUG 1 +#endif + +#ifdef DEBUG +#define OPT_CFLAGS -Og -g +#else +#define OPT_CFLAGS -O2 +#endif + +cflags = -Wunused-function -Wunused-variable -Wconversion -Wformat + -I include -I lib/liballoc/include -I lib/libdvec/include + #{OPT_CFLAGS} #{EXTRA_CFLAGS} #{LIBSTRVEC_EXTRA_CFLAGS} + +rule liba + #{CC} -o $out.tmp.o $in $cflags -r + objcopy --keep-global-symbols=libstrvec.api $out.tmp.o $out.fixed.o + ar rcs $out $out.fixed.o + rm $out.tmp.o $out.fixed.o + +rule libso + #{CC} -o $out $in $cflags -shared -Wl,-version-script libstrvec.lds + +rule cc + #{CC} -o $out $in $cflags + +rule mkdir + mkdir $out + +target build + mkdir + +target lib/liballoc/build/liballoc.a + just lib/liballoc + +target lib/libdvec/build/libdvec.a + just lib/libdvec + +target build/libstrvec.a + liba src/strvec.c lib/liballoc/build/liballoc.a | build + +target build/libstrvec.so + libso src/strvec.c | build + +target build/test + cc src/test.c build/libstrvec.a lib/liballoc/build/liballoc.a + lib/libdvec/build/libdvec.a | build + +command clean + rm -rf build + +command cleanall + just clean + just -C lib/libdvec cleanall + just -C lib/liballoc cleanall + +command install + install -m755 build/libstrvec.a -t "#{DESTDIR}#{PREFIX}#{LIBDIR}" + install -m755 build/libstrvec.so -t "#{DESTDIR}#{PREFIX}#{LIBDIR}" + install -m755 include/strvec.h -t "#{DESTDIR}#{PREFIX}#{INCLDIR}" + +command uninstall + rm -f "#{DESTDIR}#{PREFIX}#{LIBDIR}/libstrvec.a" + rm -f "#{DESTDIR}#{PREFIX}#{LIBDIR}/libstrvec.so" + rm -f "#{DESTDIR}#{PREFIX}#{INCLDIR}/strvec.h" + +command all + just build/libstrvec.a build/libstrvec.so build/test + diff --git a/configure b/configure new file mode 100755 index 0000000..a45d01f --- /dev/null +++ b/configure @@ -0,0 +1,8 @@ +#!/bin/sh + +tmpl "$@" build.jst.tmpl > build.jst +for lib in ./lib/*; do + pushd $lib + ./configure + popd +done diff --git a/lib/liballoc b/lib/liballoc -Subproject fa03741cf151f639e361b556f9e60d1925f41d4 +Subproject 9c255c51733f553c653590a36aa089af89b18fd diff --git a/lib/libdvec b/lib/libdvec -Subproject 83df399924762dd234c2b34f14e296bd3590c14 +Subproject 7682f8fc716c5efb98f8efe6256ab72676a2aed |
