aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2015-12-01 08:48:35 +0100
committerMattias Andrée <maandree@operamail.com>2015-12-01 08:48:35 +0100
commitf03e05310642b1dd13a83f45b7e1b7b14602512e (patch)
tree0c8849bfc7006e2e5b9b575ccfa1323482c3cf79
parentupdate dist (diff)
downloadslack-f03e05310642b1dd13a83f45b7e1b7b14602512e.tar.gz
slack-f03e05310642b1dd13a83f45b7e1b7b14602512e.tar.bz2
slack-f03e05310642b1dd13a83f45b7e1b7b14602512e.tar.xz
misc improvements
Signed-off-by: Mattias Andrée <maandree@operamail.com>
-rw-r--r--.gitignore4
-rw-r--r--Makefile75
-rw-r--r--README50
-rw-r--r--doc/info/fdl.texinfo (renamed from info/fdl.texinfo)0
-rw-r--r--doc/info/slack.texinfo (renamed from info/slack.texinfo)0
5 files changed, 89 insertions, 40 deletions
diff --git a/.gitignore b/.gitignore
index ee4b6c0..ea50549 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,6 @@
_/
-bin/
-obj/
+/bin/
+/obj/
.*
!.git*
*~
diff --git a/Makefile b/Makefile
index 7342f27..8569981 100644
--- a/Makefile
+++ b/Makefile
@@ -5,37 +5,40 @@
# The package path prefix, if you want to install to another root, set DESTDIR to that root.
-PREFIX ?= /usr
+PREFIX = /usr
# The binary path excluding prefix.
-BIN ?= /bin
+BIN = /bin
# The resource path excluding prefix.
-DATA ?= /share
+DATA = /share
# The binary path including prefix.
-BINDIR ?= $(PREFIX)$(BIN)
+BINDIR = $(PREFIX)$(BIN)
# The resource path including prefix.
-DATADIR ?= $(PREFIX)$(DATA)
+DATADIR = $(PREFIX)$(DATA)
# The generic documentation path including prefix
-DOCDIR ?= $(DATADIR)/doc
+DOCDIR = $(DATADIR)/doc
# The info manual documentation path including prefix
-INFODIR ?= $(DATADIR)/info
+INFODIR = $(DATADIR)/info
# The license base path including prefix.
-LICENSEDIR ?= $(DATADIR)/licenses
+LICENSEDIR = $(DATADIR)/licenses
# The name of the package as it should be installed.
-PKGNAME ?= slack
+PKGNAME = slack
# The name of the command as it should be installed.
-COMMAND ?= slack
+COMMAND = slack
# Build rules.
.PHONY: default
-default: command info shell
+default: base info shell
.PHONY: all
-all: command doc shell
+all: base doc shell
+
+.PHONY: base
+base: command
# Build rules for the command.
@@ -44,7 +47,7 @@ command: bin/slack
bin/slack: src/slack.c
mkdir -p bin
- $(CC) -O3 -Wall -Wextra -pedantic $(CFLAGS) $(LDFLAGS) $(CPPFLAGS) -o $@ $<
+ $(CC) -O3 -Wall -Wextra -pedantic -o $@ $< $(CFLAGS) $(LDFLAGS) $(CPPFLAGS)
# Build rules for documentation.
@@ -52,30 +55,32 @@ bin/slack: src/slack.c
doc: info pdf dvi ps
.PHONY: info
-info: slack.info
-%.info: info/%.texinfo info/fdl.texinfo
+info: bin/slack.info
+bin/%.info: doc/info/%.texinfo doc/info/fdl.texinfo
+ @mkdir -p bin
makeinfo $<
+ mv $*.info $@
.PHONY: pdf
-pdf: slack.pdf
-%.pdf: info/%.texinfo info/fdl.texinfo
- @mkdir -p obj/pdf
- cd obj/pdf ; yes X | texi2pdf ../../$<
- mv obj/pdf/$@ $@
+pdf: bin/slack.pdf
+bin/%.pdf: doc/info/%.texinfo doc/info/fdl.texinfo
+ @mkdir -p obj/pdf bin
+ cd obj/pdf && texi2pdf ../../$< < /dev/null
+ mv obj/pdf/$*.pdf $@
.PHONY: dvi
-dvi: slack.dvi
-%.dvi: info/%.texinfo info/fdl.texinfo
- @mkdir -p obj/dvi
- cd obj/dvi ; yes X | $(TEXI2DVI) ../../$<
- mv obj/dvi/$@ $@
+dvi: bin/slack.dvi
+bin/%.dvi: doc/info/%.texinfo doc/info/fdl.texinfo
+ @mkdir -p obj/dvi bin
+ cd obj/dvi && $(TEXI2DVI) ../../$< < /dev/null
+ mv obj/dvi/$*.dvi $@
.PHONY: ps
-ps: slack.ps
-%.ps: info/%.texinfo info/fdl.texinfo
- @mkdir -p obj/ps
- cd obj/ps ; yes X | texi2pdf --ps ../../$<
- mv obj/ps/$@ $@
+ps: bin/slack.ps
+bin/%.ps: doc/info/%.texinfo doc/info/fdl.texinfo
+ @mkdir -p obj/ps bin
+ cd obj/ps && texi2pdf --ps ../../$< < /dev/null
+ mv obj/ps/$*.ps $@
# Build rules for shell auto-completion.
@@ -138,22 +143,22 @@ install-license:
install-doc: install-info install-pdf install-ps install-dvi
.PHONY: install-info
-install-info: slack.info
+install-info: bin/slack.info
install -dm755 -- "$(DESTDIR)$(INFODIR)"
install -m644 $< -- "$(DESTDIR)$(INFODIR)/$(PKGNAME).info"
.PHONY: install-pdf
-install-pdf: slack.pdf
+install-pdf: bin/slack.pdf
install -dm755 -- "$(DESTDIR)$(DOCDIR)"
install -m644 $< -- "$(DESTDIR)$(DOCDIR)/$(PKGNAME).pdf"
.PHONY: install-ps
-install-ps: slack.ps
+install-ps: bin/slack.ps
install -dm755 -- "$(DESTDIR)$(DOCDIR)"
install -m644 $< -- "$(DESTDIR)$(DOCDIR)/$(PKGNAME).ps"
.PHONY: install-dvi
-install-dvi: slack.dvi
+install-dvi: bin/slack.dvi
install -dm755 -- "$(DESTDIR)$(DOCDIR)"
install -m644 $< -- "$(DESTDIR)$(DOCDIR)/$(PKGNAME).dvi"
@@ -205,5 +210,5 @@ uninstall:
.PHONY: clean
clean:
- -rm -rf obj bin slack.info slack.pdf slack.ps slack.dvi
+ -rm -r obj bin
diff --git a/README b/README
index 0977e0b..c95ef55 100644
--- a/README
+++ b/README
@@ -1,5 +1,49 @@
-Get the current timer slack value or spawn
-a new process with a new timer slack value.
+NAME
+ slack - Control your timer slack
-Note: real-time threads do not slack around.
+SYNOPSIS
+ slack (get | GET)
+ slack ((reset | INTERVAL) [--fatal] [--] COMMAND...)
+
+DESCRIPTION
+ Get the current timer slack value or spawn a new process
+ with a new timer slack value.
+
+ If the verb get or GET is used, the current timer slack
+ value and exit. If get is used, the program shall use
+ as high prefix as possible. If GET is used the value
+ shall be printed in nanoseconds but not unit shall be
+ printed.
+
+ If the verb reset is used, the process shall set the
+ timer slack value for the process to the default timer
+ slack value, and exec(3) to COMMAND.
+
+ If an INTERVAL is given, the process shall set the
+ timer slack value for the process to INTERVAL, and
+ exec(3) to COMMAND.
+
+ INTERVAL must be a positive number, optioanlly with
+ a prefix. Recognised prefixes (and units) are:
+
+ ns, n nanoseconds (default)
+ µs, µ, us, u microseconds
+ ms, m milliseconds
+ s seconds
+
+ The default timer slack value is the timer slack value
+ on PID 1.
+
+OPTIONS
+ --fatal
+ Fail if the timer slack value cannot be set.
+
+RATIONALE
+ Could be useful increase the performance of your computer.
+
+NOTES:
+ Real-time threads do not slack around.
+
+SEE ALSO
+ nice(1) ionice(1), prctl(2)
diff --git a/info/fdl.texinfo b/doc/info/fdl.texinfo
index cb71f05..cb71f05 100644
--- a/info/fdl.texinfo
+++ b/doc/info/fdl.texinfo
diff --git a/info/slack.texinfo b/doc/info/slack.texinfo
index 692b7c9..692b7c9 100644
--- a/info/slack.texinfo
+++ b/doc/info/slack.texinfo