[hackers] [wmii] More build system cleanup. Install README. || Kris Maglione

From: <hg_AT_suckless.org>
Date: Tue, 13 Oct 2009 07:26:01 +0000 (UTC)

changeset: 2537:7278315a7895
tag: tip
user: Kris Maglione <jg_AT_suckless.org>
date: Tue Oct 13 02:40:45 2009 -0400
files: Makefile alternative_wmiircs/Makefile alternative_wmiircs/python/wmiirc.py alternative_wmiircs/ruby/config.yaml alternative_wmiircs/ruby/wmiirc man/wmii.1 mk/common.mk mk/hdr.mk
description:
More build system cleanup. Install README.

diff -r 3439261a75fc -r 7278315a7895 Makefile
--- a/Makefile Mon Oct 12 22:07:51 2009 -0400
+++ b/Makefile Tue Oct 13 02:40:45 2009 -0400
@@ -1,23 +1,23 @@
 ROOT=.
 include ${ROOT}/mk/hdr.mk
+include ${ROOT}/mk/wmii.mk
 
 PDIRS = \
+ doc \
+ man \
         cmd \
         libwmii_hack \
         rc \
- alternative_wmiircs \
- doc \
- man
+ alternative_wmiircs
 
 DIRS = \
         libbio \
         libfmt \
         libregexp \
         libutf \
- ${PDIRS}
+ $(PDIRS)
 
-config:
- ROOT="${ROOT}" ${ROOT}/util/genconfig
+DOCS = README
 
 deb-dep:
         apt-get -qq install build-essential debhelper libxext-dev x11proto-xext-dev libx11-dev libxrandr-dev
@@ -26,6 +26,5 @@
         dpkg-buildpackage -rfakeroot
 
 include ${ROOT}/mk/dir.mk
-INSTDIRS = ${PDIRS}
-.PHONY: config
+INSTDIRS = $(PDIRS)
 
diff -r 3439261a75fc -r 7278315a7895 alternative_wmiircs/Makefile
--- a/alternative_wmiircs/Makefile Mon Oct 12 22:07:51 2009 -0400
+++ b/alternative_wmiircs/Makefile Tue Oct 13 02:40:45 2009 -0400
@@ -3,19 +3,11 @@
 include $(ROOT)/mk/wmii.mk
 
 BIN = $(ETC)/wmii$(CONFVERSION)
-TARG = python \
+DIRS = python \
         plan9port \
         ruby
 
-$(TARG:%=%.install):
- echo INSTALL $$($(CLEANNAME) $(BASE)${@:.install=})
- cp -r ${@:.install=} $(DESTDIR)$(BIN)
-$(TARG:%=%.uninstall):
- echo UNINSTALL $$($(CLEANNAME) $(BASE)${@:.uninstall=})
- rm -rf $(DESTDIR)$(BIN)/${@:.uninstall=}
+DOCS = README
+DOCDIR = $(DOC)/alternative_wmiircs
 
-.PHONY: $(TARG:%=%.install) $(TARG:%=%.uninstall)
-
-install: $(TARG:%=%.install)
-uninstall: $(TARG:%=%.uninstall)
-
+include $(ROOT)/mk/dir.mk
diff -r 3439261a75fc -r 7278315a7895 alternative_wmiircs/python/wmiirc.py
--- a/alternative_wmiircs/python/wmiirc.py Mon Oct 12 22:07:51 2009 -0400
+++ b/alternative_wmiircs/python/wmiirc.py Tue Oct 13 02:40:45 2009 -0400
@@ -44,7 +44,7 @@
     call('xsetroot', '-solid', color)
 setbackground(background)
 
-terminal = 'wmiir', 'setsid', 'xterm'
+terminal = 'wmiir', 'setsid', '@TERMINAL@'
 pygmi.shell = os.environ.get('SHELL', 'sh')
 
 @defmonitor
diff -r 3439261a75fc -r 7278315a7895 alternative_wmiircs/ruby/config.yaml
--- a/alternative_wmiircs/ruby/config.yaml Mon Oct 12 22:07:51 2009 -0400
+++ b/alternative_wmiircs/ruby/config.yaml Tue Oct 13 02:40:45 2009 -0400
@@ -15,7 +15,7 @@
 # Program preferences.
 #
 program:
- terminal: urxvt
+ terminal: @TERMINAL@
   browser: firefox
   editor: mousepad
   filer: thunar
diff -r 3439261a75fc -r 7278315a7895 alternative_wmiircs/ruby/wmiirc
--- a/alternative_wmiircs/ruby/wmiirc Mon Oct 12 22:07:51 2009 -0400
+++ b/alternative_wmiircs/ruby/wmiirc Tue Oct 13 02:40:45 2009 -0400
@@ -72,7 +72,7 @@
   LOG.error e
 
   # allow the user to rescue themselves
- system 'xterm &'
+ system '@TERMINAL@ &'
 
   IO.popen('xmessage -nearmouse -file - -buttons Recover,Ignore -print', 'w+') do |f|
     f.puts e.inspect, e.backtrace
diff -r 3439261a75fc -r 7278315a7895 man/wmii.1
--- a/man/wmii.1 Mon Oct 12 22:07:51 2009 -0400
+++ b/man/wmii.1 Tue Oct 13 02:40:45 2009 -0400
@@ -174,6 +174,11 @@
 .TE
 
 .SS Default Key Bindings
+.P
+All of the provided \fBwmiirc\fR scripts accept at least the following key
+bindings. They should also provide a \fBshowkeys\fR action to open a
+key binding quick\-reference.
+
 .SS Moving Around
 .TS
 tab(^); ll.
@@ -452,6 +457,15 @@
 Selects a column or the floating area.
 
 .nf
+ area ::= \fI<area_spec>\fR | \fI<screen_spec>\fR:\fI<area_spec>\fR
+.fi
+
+
+When \fI<screen_spec>\fR is omitted and \fI<area_spec>\fR is not "sel",
+0 is assumed. "sel" by itself represents the selected client no
+matter which screen it is on.
+
+.nf
      area_spec ::= "~" | \fI<number>\fR | "sel"
 .fi
 
@@ -466,15 +480,6 @@
 
 Where \fI<number>\fR representes the 0\-based Xinerama screen number.
 
-.nf
- area ::= \fI<area_spec>\fR | \fI<screen_spec>\fR:\fI<area_spec>\fR
-.fi
-
-
-When \fI<screen_spec>\fR is omitted and \fI<area_spec>\fR is not "sel",
-0 is assumed. "sel" by itself represents the selected client no
-matter which screen it is on.
-
 .TP
 frame
 Selects a client window.
diff -r 3439261a75fc -r 7278315a7895 mk/common.mk
--- a/mk/common.mk Mon Oct 12 22:07:51 2009 -0400
+++ b/mk/common.mk Tue Oct 13 02:40:45 2009 -0400
@@ -1,12 +1,21 @@
 all:
 
-install: all
+install: all simpleinstall
+uninstall: simpleuninstall
 
-MANDIRS=$(MAN)/man1
-mkdirs:
- for i in $(BIN) $(ETC) $(DOC) $(LIBDIR) $(MANDIRS) $(INCLUDE); do \
- test -d $(DESTDIR)$$i || echo MKDIR $$i; \
- mkdir -pm 0755 $(DESTDIR)$$i; \
+DOCDIR = $(DOC)
+simpleinstall:
+ for f in $(DOCS); do \
+ $(INSTALL) 0644 $$f $(DOCDIR)/$$f; \
+ done
+ for f in $(TEXT); do \
+ $(INSTALL) 0644 $$f $(DIR)/$$f; \
+ done
+ for f in $(BINARY); do \
+ $(INSTALL) -b 0644 $$f $(DIR)/$$f; \
+ done
+ for f in $(EXECS); do \
+ $(INSTALL) -b 0755 $$f $(DIR)/$$f; \
         done
 
 cleandep:
@@ -26,3 +35,4 @@
 include $(DEP)
 
 .PHONY: all options clean dist install uninstall depend cleandep tags
+.PHONY: simpleuninstall simpleinstall
diff -r 3439261a75fc -r 7278315a7895 mk/hdr.mk
--- a/mk/hdr.mk Mon Oct 12 22:07:51 2009 -0400
+++ b/mk/hdr.mk Tue Oct 13 02:40:45 2009 -0400
@@ -2,11 +2,11 @@
 
 EXCFLAGS = $(INCLUDES) -D_XOPEN_SOURCE=600
 
-COMPILE = $(ROOT)/util/compile "$(CC)" "$(EXCFLAGS) $(CFLAGS) $$(pkg-config --cflags $(PACKAGES))"
-COMPILEPIC = $(ROOT)/util/compile "$(CC)" "$(EXCFLAGS) $(CFLAGS) $$(pkg-config --cflags $(PACKAGES)) $(SOCFLAGS)"
+COMPILE = $(ROOT)/util/compile "$(CC)" "$(EXCFLAGS) $(CFLAGS) $$(pkg-config --cflags $(PACKAGES))"
+COMPILEPIC = $(ROOT)/util/compile "$(CC)" "$(EXCFLAGS) $(CFLAGS) $$(pkg-config --cflags $(PACKAGES)) $(SOCFLAGS)"
 
-LINK = $(ROOT)/util/link "$(LD)" "$$(pkg-config --libs $(PACKAGES)) $(LDFLAGS)"
-LINKSO = $(ROOT)/util/link "$(LD)" "$$(pkg-config --libs $(PACKAGES)) $(SOLDFLAGS) $(SHARED)"
+LINK = $(ROOT)/util/link "$(LD)" "$$(pkg-config --libs $(PACKAGES)) $(LDFLAGS)"
+LINKSO = $(ROOT)/util/link "$(LD)" "$$(pkg-config --libs $(PACKAGES)) $(SOLDFLAGS) $(SHARED)"
 
 CLEANNAME=$(ROOT)/util/cleanname
 
@@ -40,7 +40,8 @@
 
 .c.depend:
         echo MKDEP $<
- $(MKDEP) $(EXCFLAGS) $(CFLAGS) $< >>.depend
+ [ "$$noisycc" = 1 ] && echo $(MKDEP) $(EXCFLAGS) $(CFLAGS) $$(pkg-config --cflags $(PACKAGES)) $< || true
+ $(MKDEP) $(EXCFLAGS) $(CFLAGS) $$(pkg-config --cflags $(PACKAGES)) $< >>.depend
 
 .sh.depend .rc.depend .1.depend .awk.depend:
         :
@@ -56,61 +57,59 @@
         $(COMPILE) ${<:.c=.o} $<
         $(LINK) $@ ${<:.c=.o}
 
-.sh.out:
+.rc.out .awk.out .sh.out:
         echo FILTER $(BASE)$<
- $(FILTER) $< >$@
- sh -n $@
- chmod 0755 $@
-.rc.out .awk.out:
- echo FILTER $(BASE)$<
+ [ -n "${<:%.sh=}" ] || sh -n $<
         $(FILTER) $< >$@
         chmod 0755 $@
+
 .man1.1:
         echo TXT2TAGS $(BASE)$<
         txt2tags -o- $< >$@
 
+INSTALL= _install() { set -e; \
+ dashb=$$1; [ $$1 = -b ] && shift; \
+ d=$$(dirname $$3); \
+ if [ ! -d $$d ]; then echo MKDIR $$d; mkdir -p $(DESTDIR)$$d; fi; \
+ echo INSTALL $$($(CLEANNAME) $(BASE)$$2); \
+ if [ "$$dashb" = -b ]; \
+ then cp -f $$2 $(DESTDIR)$$3; \
+ else $(FILTER) <$$2 >$(DESTDIR)$$3; \
+ fi; \
+ chmod $$1 $(DESTDIR)$$3; \
+ }; _install
+UNINSTALL= _uninstall() { set -e; \
+ echo UNINSTALL $$($(CLEANNAME) $(BASE)$$2); \
+ rm -f $(DESTDIR)$$3; \
+ }; _uninstall
+
 .out.install:
- echo INSTALL $$($(CLEANNAME) $(BASE)$*)
- cp -f $< $(DESTDIR)$(BIN)/$*
- chmod 0755 $(DESTDIR)$(BIN)/$*
+ $(INSTALL) -b 0755 $< $(BIN)/$*
 .out.uninstall:
- echo UNINSTALL $$($(CLEANNAME) $(BASE)$*)
- rm -f $(DESTDIR)$(BIN)/$*
+ $(UNINSTALL) $< $(BIN)/$*
 
 .a.install .$(SOEXT).install:
- echo INSTALL $$($(CLEANNAME) $(BASE)$<)
- cp -f $< $(DESTDIR)$(LIBDIR)/$<
- chmod 0644 $(DESTDIR)$(LIBDIR)/$<
+ $(INSTALL) -b 0644 $< $(LIBDIR)/$<
 .a.uninstall .$(SOEXT).uninstall:
- echo UNINSTALL $$($(CLEANNAME) $(BASE)$<)
- rm -f $(DESTDIR)$(LIBDIR)/$<
+ $(UNINSTALL) $< $(LIBDIR)/$<
 
 .h.install:
- echo INSTALL $$($(CLEANNAME) $(BASE)$<)
- cp -f $< $(DESTDIR)$(INCLUDE)/$<
- chmod 0644 $(DESTDIR)$(INCLUDE)/$<
+ $(INSTALL) 0644 $< $(INCLUDE)/$<
 .h.uninstall:
- echo UNINSTALL $$($(CLEANNAME) $(BASE)$<)
- rm -f $(DESTDIR)$(INCLUDE)/$<
+ $(UNINSTALL) $< $(INCLUDE)/$<
 
 .pdf.install:
- echo INSTALL $$($(CLEANNAME) $(BASE)$<)
- cp -f $< $(DESTDIR)$(DOC)/$<
- chmod 0644 $(DESTDIR)$(DOC)/$<
+ $(INSTALL) -b 0644 $< $(DOC)/$<
 .pdf.uninstall:
- echo UNINSTALL $$($(CLEANNAME) $(BASE)$<)
- rm -f $(DESTDIR)$(DOC)/$<
+ $(UNINSTALL) $< $(DOC)/$<
 
-.1.install:
- set -e; \
- man=1; \
- path="$(MAN)/man$$man/$*.$$man"; \
- echo INSTALL man $$($(CLEANNAME) "$(BASE)/$*($$man)"); \
- $(FILTER) <"$<" >$(DESTDIR)"$$path"; \
- chmod 0644 $(DESTDIR)"$$path"
-.1.uninstall:
- echo UNINSTALL man $$($(CLEANNAME) $*'(1)')
- rm -f $(DESTDIR)$(MAN)/man1/$<
+INSTALMAN= _installman() { man=$${1\#\#*.}; $(INSTALL) 0644 $$1 $(MAN)/man$$man/$$1; }; _installman
+UNINSTALLMAN=_uninstallman() { man=$${1\#\#*.}; $(UNINSTALL) $$1 $(MAN)/man$$man/$$1; }; _uninstallman
+MANSECTIONS=1 2 3 4 5 6 7 8 9
+${MANSECTIONS:%=.%.install}:
+ $(INSTALMAN) $<
+${MANSECTIONS:%=.%.uninstall}:
+ $(UNINSTALL) $<
 
 .out.clean:
         echo CLEAN $$($(CLEANNAME) $(BASE)$<)
@@ -121,9 +120,8 @@
         rm -f $< || true 2>/dev/null
 
 printinstall:
-mkdirs:
 clean:
-install: printinstall mkdirs
+install: printinstall
 depend: cleandep
 
 include $(ROOT)/mk/common.mk
Received on Tue Oct 13 2009 - 07:26:01 UTC

This archive was generated by hypermail 2.2.0 : Tue Oct 13 2009 - 07:36:06 UTC