commit 1c2166c4bbf47ed42dcdc07838615ec2069b55b0
Author: Hiltjo Posthuma <[email protected]>
Date:   Sat Feb 28 13:23:15 2015 +0100

    make rule: sbase-box-install
    
    rule to make sbase-box and setup symlinks for $BIN and /bin/[
    
    some (maybe) interesting info:
    
    $ make LDFLAGS="-s -static" CFLAGS="-Os" PREFIX=/ 
DESTDIR=`pwd`/static-normal install
    $ make LDFLAGS="-s -static" CFLAGS="-Os" PREFIX=/ DESTDIR=`pwd`/static-box 
sbase-box-install
    
    $ du -sk static-normal/ static-box
    2728    static-normal/
    572     static-box

diff --git a/Makefile b/Makefile
index ef57715..6efa7f0 100644
--- a/Makefile
+++ b/Makefile
@@ -217,6 +217,16 @@ sbase-box: $(LIB) $(SRC)
        $(LD) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ build/*.c $(LIB)
        rm -r build
 
+sbase-box-install: sbase-box
+       mkdir -p $(DESTDIR)$(PREFIX)/bin
+       cp -f sbase-box $(DESTDIR)$(PREFIX)/bin
+       chmod 755 $(DESTDIR)$(PREFIX)/bin/sbase-box
+       for f in $(BIN); do ln -sf sbase-box $(DESTDIR)$(PREFIX)/bin/"$$f"; done
+       ln -sf sbase-box $(DESTDIR)$(PREFIX)/bin/[
+       mkdir -p $(DESTDIR)$(MANPREFIX)/man1
+       for m in $(MAN); do sed "s/^\.Os sbase/.Os sbase $(VERSION)/g" < "$$m" 
> $(DESTDIR)$(MANPREFIX)/man1/"$$m"; done
+       cd $(DESTDIR)$(MANPREFIX)/man1 && chmod 644 $(MAN)
+
 clean:
        rm -f $(BIN) $(OBJ) $(LIB) sbase-box sbase-$(VERSION).tar.gz
 

Reply via email to