[hackers] [ubase] make rule: ubase-box-install || Hiltjo Posthuma

From: <git_AT_suckless.org>
Date: Tue, 3 Mar 2015 14:32:48 +0100 (CET)

commit 67220cf2e8836403b269d7436482d64360b12bfe
Author: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
Date: Sat Feb 28 13:58:35 2015 +0100

    make rule: ubase-box-install
    
    rule to make ubase-box and setup symlinks for $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 ubase-box-install
    
    $ du -sk static-normal/ static-box
    1776 static-normal
    356 static-box

diff --git a/Makefile b/Makefile
index 608de1d..a5268ae 100644
--- a/Makefile
+++ b/Makefile
_AT_@ -203,6 +203,18 @@ ubase-box: $(LIB) $(SRC)
         $(LD) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $_AT_ build/*.c $(LIB) $(LDLIBS)
         rm -r build
 
+ubase-box-install: ubase-box
+ mkdir -p $(DESTDIR)$(PREFIX)/bin
+ cp -f ubase-box $(DESTDIR)$(PREFIX)/bin
+ chmod 755 $(DESTDIR)$(PREFIX)/bin/ubase-box
+ for f in $(BIN); do ln -sf ubase-box $(DESTDIR)$(PREFIX)/bin/"$$f"; done
+ mkdir -p $(DESTDIR)$(MANPREFIX)/man1
+ for m in $(MAN1); do sed "s/^\.Os ubase/.Os ubase $(VERSION)/g" < "$$m" > $(DESTDIR)$(MANPREFIX)/man1/"$$m"; done
+ mkdir -p $(DESTDIR)$(MANPREFIX)/man8
+ for m in $(MAN8); do sed "s/^\.Os ubase/.Os ubase $(VERSION)/g" < "$$m" > $(DESTDIR)$(MANPREFIX)/man8/"$$m"; done
+ cd $(DESTDIR)$(MANPREFIX)/man1 && chmod 644 $(MAN1)
+ cd $(DESTDIR)$(MANPREFIX)/man8 && chmod 644 $(MAN8)
+
 clean:
         rm -f $(BIN) $(OBJ) $(LIB) ubase-box ubase-$(VERSION).tar.gz
 
Received on Tue Mar 03 2015 - 14:32:48 CET

This archive was generated by hypermail 2.3.0 : Tue Mar 03 2015 - 14:36:39 CET