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 /build.rmk.tmpl | |
| parent | efba5f45438c08a5fe9a1533164e39b3fa3c58aa (diff) | |
| download | libstrvec-c-0a75f8259b198a702ed9f06e843e7c189463cec7.tar.gz libstrvec-c-0a75f8259b198a702ed9f06e843e7c189463cec7.zip | |
Rename to rmk
Diffstat (limited to 'build.rmk.tmpl')
| -rw-r--r-- | build.rmk.tmpl | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/build.rmk.tmpl b/build.rmk.tmpl new file mode 100644 index 0000000..bbcdab8 --- /dev/null +++ b/build.rmk.tmpl @@ -0,0 +1,75 @@ +#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 + rmk lib/liballoc + +target lib/libdvec/build/libdvec.a + rmk lib/libdvec + +target build/libstrvec.a + liba src/strvec.c lib/libdvec/build/libdvec.a + lib/liballoc/build/liballoc.a | include/strvec.h libstrvec.api 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 | include/strvec.h libstrvec.lds build + +command clean + rm -rf build + +command cleanall + rmk clean + rmk -C lib/libdvec cleanall + rmk -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 -m644 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 + rmk build/libstrvec.a build/libstrvec.so build/test + |
