#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 just 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 just clean just -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 just build/libhmap.a build/libhmap.so build/test