libk  Diff

Differences From Artifact [b7dc8d033f]:

To Artifact [ca0001a46e]:


     1      1   #!/usr/bin/env bash
     2      2   source global/common.sh
     3      3   
     4         -say "this component of the build system does not yet exist"
            4  +check "prefix" "a directory to install to"
            5  +build="${build:-out}"
            6  +
            7  +bindir="$prefix/bin"
            8  +libdir="$prefix/lib"
            9  +
           10  +if [ "$prefix" = "/" ]; then
           11  +	say "installing docs and headers into usr instad of /"
           12  +	sharedir="$prefix/usr/share"
           13  +	incdir="$prefix/usr/include"
           14  +else
           15  +	incdir="$prefix/include"
           16  +	sharedir="$prefix/share"
           17  +fi
           18  +
           19  +# Libraries
           20  +# These may or may not exist, depending on what library build is done, so check
           21  +[ -e "$build/libk.a" ] && install -Dm644 -t "$libdir" "$build/libk.a"
           22  +[ -e "$build/libk.so" ] && install -Dm644 -t "$libdir" "$build/libk.so"
           23  +[ -e "$build/boot.o" ] && install -Dm644 -t "$libdir/libk" "$build/boot.o"
           24  +
           25  +# Binaries
           26  +install -Dm755 -t "$bindir" "$build/kcore.testbin"
           27  +install -Dm755 -t "$bindir" "$build/kcli.testbin"
           28  +install -Dm755 -t "$bindir" "$build/kgraft.attach"
           29  +
           30  +# Includes
           31  +for inc in "$build"/k/*; do
           32  +	install -Dm644 -t "$incdir/k" "$inc"
           33  +done
           34  +
           35  +# Documentation
           36  +for man in "$build"/doc/man/*; do
           37  +	install -Dm644 -t "$sharedir/man" "$man"
           38  +done
           39  +for html in "$build"/doc/html/*; do
           40  +	install -Dm644 -t "$sharedir/doc/libk/html" "$html"
           41  +done
           42  +for pdf in "$build"/doc/pdf/*; do
           43  +	install -Dm644 -t "$sharedir/doc/libk/pdf" "$pdf"
           44  +done