diff options
| author | Louis Burda <quent.burda@gmail.com> | 2024-10-02 00:06:32 +0200 |
|---|---|---|
| committer | Louis Burda <quent.burda@gmail.com> | 2024-10-02 02:49:44 +0200 |
| commit | 0a75f8259b198a702ed9f06e843e7c189463cec7 (patch) | |
| tree | d9c40a2c6be04a44108caec99d9b41364f940b69 /lib/liballoc/build.rmk.tmpl | |
| parent | efba5f45438c08a5fe9a1533164e39b3fa3c58aa (diff) | |
| download | libstrvec-c-0a75f8259b198a702ed9f06e843e7c189463cec7.tar.gz libstrvec-c-0a75f8259b198a702ed9f06e843e7c189463cec7.zip | |
Rename to rmk
Diffstat (limited to 'lib/liballoc/build.rmk.tmpl')
| -rw-r--r-- | lib/liballoc/build.rmk.tmpl | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/lib/liballoc/build.rmk.tmpl b/lib/liballoc/build.rmk.tmpl new file mode 100644 index 0000000..410749d --- /dev/null +++ b/lib/liballoc/build.rmk.tmpl @@ -0,0 +1,60 @@ +#default PREFIX /usr/local +#default INCLDIR /include +#default LIBDIR /lib +#default CC gcc + +#ifdef DEBUG +#define OPT_CFLAGS -Og -g +#else +#define OPT_CFLAGS -O2 +#endif + +cflags = -Wunused-function -Wunused-variable -Wconversion -Wformat + -I include #{OPT_CFLAGS} #{EXTRA_CFLAGS} + +rule liba + gcc -o $out.tmp.o $in $cflags -r + objcopy --keep-global-symbols=liballoc.api $out.tmp.o $out.fixed.o + ar rcs $out $out.fixed.o + rm $out.tmp.o $out.fixed.o + +rule libso + gcc -o $out $in $cflags -shared -Wl,-version-script liballoc.lds + +rule cc + gcc -o $out $in $cflags + +rule mkdir + mkdir $out + +target build + mkdir + +target build/liballoc.a + liba src/allocator.c | include/allocator.h build + +target build/liballoc.so + libso src/allocator.c | include/allocator.h build + +target build/test + cc src/test.c build/liballoc.a | build + +command clean + rm -rf build + +command cleanall + just clean + +command install + install -m755 build/liballoc.a -t "#{DESTDIR}#{PREFIX}#{LIBDIR}" + install -m755 build/liballoc.so -t "#{DESTDIR}#{PREFIX}#{LIBDIR}" + install -m644 include/allocator.h -t "#{DESTDIR}#{PREFIX}#{INCLDIR}" + +command uninstall + rm -f "#{DESTDIR}#{PREFIX}#{LIBDIR}/liballoc.a" + rm -f "#{DESTDIR}#{PREFIX}#{LIBDIR}/liballoc.so" + rm -f "#{DESTDIR}#{PREFIX}#{INCLDIR}/allocator.h" + +command all + just build/liballoc.a build/liballoc.so build/test + |
