aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2016-11-17 17:52:41 +0100
committerKarel Kočí <cynerd@email.cz>2016-11-17 17:56:33 +0100
commitad2a23815a49245117cadbfcb6a59dfd6fc95483 (patch)
tree0342f46b1e92ccfce96a6650b5250d3fafd73cfa
parent3e3af1dab62cac49c72143dddfbe097b43c2bba2 (diff)
downloadgeml-ad2a23815a49245117cadbfcb6a59dfd6fc95483.tar.gz
geml-ad2a23815a49245117cadbfcb6a59dfd6fc95483.tar.bz2
geml-ad2a23815a49245117cadbfcb6a59dfd6fc95483.zip
Implement install and uninstall target and manual template
-rw-r--r--Makefile17
-rwxr-xr-xconfigure17
-rw-r--r--docs/geml.man36
3 files changed, 65 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index ed406f5..780c5d4 100644
--- a/Makefile
+++ b/Makefile
@@ -38,7 +38,7 @@ DEP = $(patsubst src/%.c,$(O)/build/%.d,$(CSRC))
.PHONY: help
help:
- @echo "Simple general preprocessor make targets:"
+ @echo "General extendable macro language make targets:"
@echo " all|geml - Build geml executable"
@echo " help - Prints this text help."
@echo " install - Install geml to you system"
@@ -52,12 +52,21 @@ help:
@echo " Q - Define emty to show executed commands"
.PHONY: install
-install:
- #TODO
+install: $(O)/geml
+ @echo " INSTALL $(EPREFIX)/bin/geml"
+ $(Q)$(INSTALL) -d $(EPREFIX)/bin
+ $(Q)$(INSTALL) -m 755 $(O)/geml $(EPREFIX)/bin
+ @echo " INSTALL $(EPREFIX)/share/man/man1/geml.1.gz"
+ $(Q)$(INSTALL) -d $(PREFIX)/share/man/man1
+ $(Q)$(INSTALL) -m 644 docs/geml.man $(PREFIX)/share/man/man1/geml.1
+ $(Q)$(GZIP) -f $(PREFIX)/share/man/man1/geml.1
.PHONY: uninstall
uninstall:
- #TODO
+ @echo " RM $(EPREFIX)/bin/geml"
+ $(Q)$(RM) $(EPREFIX)/bin/geml
+ @echo " RM $(PREFIX)/share/man/man1/geml.1.gz"
+ $(Q)$(RM) $(PREFIX)/share/man/man1/geml.1.gz
# Cleaning
.PHONY: clean
diff --git a/configure b/configure
index 9f29180..6f8044b 100755
--- a/configure
+++ b/configure
@@ -14,6 +14,8 @@ CPREFIX:::T:F
CC:cc::T:F
CFLAGS:::T:F
LFLAGS:::T:F
+INSTALL:install::T:F
+GZIP:gzip::T:F
DOT:dot::T:F
MKDOCS:mkdocs::T:F"
############################################################################
@@ -40,6 +42,8 @@ print_help() {
echo " CC C compiler command."
echo " CFLAGS C compiler flags."
echo " LDFLAGS C Linker flags."
+ echo " INSTALL Copy files and set attributes."
+ echo " GZIP Compress file."
echo " DOT Directed graphs drawing program."
echo " MKDOCS Project documentation generator."
echo
@@ -51,7 +55,7 @@ CONFIG_FILE=.config
CONFIGURED_FILE=.configured # TODO
# Backup variables from environment
-ENVVARS="CPREFIX CC CFLAGS LDFLAGS DOT MKDOCS"
+ENVVARS="CPREFIX CC CFLAGS LDFLAGS INSTALL GZIP DOT CPPCHECK VALGRIND MKDOCS"
for E in $ENVVARS; do
eval "[ -n \"\${$E+y}\" ]" && eval "BACKUP_$E=\$$E"
done
@@ -79,10 +83,21 @@ while [ "$#" -gt 0 ]; do
;;
--prefix)
PREFIX=$2
+ [ -z "$EPREFIX_USER" ] && EPREFIX="$PREFIX"
shift
;;
--prefix=*)
PREFIX=${1#--prefix=}
+ [ -z "$EPREFIX_USER" ] && EPREFIX="$PREFIX"
+ ;;
+ --exec-prefix)
+ EPREFIX=$2
+ EPREFIX_USER=y
+ shift
+ ;;
+ --exec-prefix=*)
+ EPREFIX=${1#--exec-prefix=}
+ EPREFIX_USER=y
;;
-d|--debug)
DEBUG=yes
diff --git a/docs/geml.man b/docs/geml.man
new file mode 100644
index 0000000..aac9815
--- /dev/null
+++ b/docs/geml.man
@@ -0,0 +1,36 @@
+.\" vim: ft=groff
+.\" Manpage for geml.
+.TH sterm 1 "17 November 2016" "17112016"
+.SH NAME
+geml \- General extendable macro language processing tool
+.SH SYNOPSIS
+geml [OPTION]... INPUT_FILE
+.SH DESCRIPTION
+.PP
+TODO
+.SH OPTIONS
+.TP
+\fB\-v, --verbose\fR
+Increases vebosity of output.
+.TP
+\fB\-q, --quiet\fR
+Decreases vebosity of output.
+.TP
+\fB\-o, --output OUTPUT_FILE\fR
+Sets file in which output is going to be stored.
+.TP
+\fB\-h, --help\fR
+Prints this help.
+.TP
+\fB\--version\fR
+Prints geml version.
+
+.SH BUGS
+No known bugs.
+
+.SH SEE ALSO
+.BR ed (1),
+.BR awk (1),
+.BR sed (1).
+.SH AUTHOR
+Karel Kočí (cynerd@email.cz)