diff options
| author | Louis Burda <quent.burda@gmail.com> | 2024-10-02 03:59:21 +0200 |
|---|---|---|
| committer | Louis Burda <quent.burda@gmail.com> | 2024-10-02 03:59:21 +0200 |
| commit | 36c8d24c07ef3c6658f397fd156396f83b35ac27 (patch) | |
| tree | 1b3293264dca677a8d8e1ca44061aa7af191f839 /lib/libhmap/build.rmk.tmpl | |
| parent | eff49100e4fca394a23973abd5001a4fde15d6e8 (diff) | |
| download | tabular-master.tar.gz tabular-master.zip | |
Diffstat (limited to 'lib/libhmap/build.rmk.tmpl')
| -rw-r--r-- | lib/libhmap/build.rmk.tmpl | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/lib/libhmap/build.rmk.tmpl b/lib/libhmap/build.rmk.tmpl new file mode 100644 index 0000000..b123dcf --- /dev/null +++ b/lib/libhmap/build.rmk.tmpl @@ -0,0 +1,69 @@ +#default PREFIX /usr/local +#default INCLDIR /include +#default LIBDIR /lib +#default CC gcc + +#ifdef LIBHMAP_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 #{OPT_CFLAGS} + #{EXTRA_CFLAGS} #{LIBHMAP_EXTRA_CFLAGS} + +rule mkdir + mkdir $out + +rule liba + #{CC} -o $out.tmp.o $in $cflags -r + objcopy --keep-global-symbols=libhmap.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 libhmap.lds + +rule cc + #{CC} -o $out $in $cflags + +target build + mkdir + +target lib/liballoc/build/liballoc.a + rmk lib/liballoc + +target build/libhmap.a + liba src/hmap.c | include/hmap.h build + +target build/libhmap.so + libso src/hmap.c | include/hmap.h build + +target build/test + cc src/test.c build/libhmap.a lib/liballoc/build/liballoc.a | build + +command clean + rm -rf build + +command cleanall + rmk clean + rmk -C lib/liballoc cleanall + +command install + install -m755 build/libhmap.a -t "#{DESTDIR}#{PREFIX}#{LIBDIR}" + install -m755 build/libhmap.so -t "#{DESTDIR}#{PREFIX}#{LIBDIR}" + install -m644 include/hmap.h -t "#{DESTDIR}#{PREFIX}#{INCLDIR}" + +command uninstall + rm -f "#{DESTDIR}#{PREFIX}#{LIBDIR}/libhmap.a" + rm -f "#{DESTDIR}#{PREFIX}#{LIBDIR}/libhmap.so" + rm -f "#{DESTDIR}#{PREFIX}#{INCLDIR}/hmap.h" + +command all + rmk build/libhmap.a build/libhmap.so build/test + |
