Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add configure and rename Makefile to Makefile.in.

Add minimalistic configure-like script. Rename Makefile to Makefile.in
and enhance it a bit.

* Makefile -> Makefile.in: Rename and improve.
* configure: New file.
* .gitignore: Update.
* NEWS: Update.
  • Loading branch information...
commit e70be6fbef5621c6c12cdcdd1445a54ea81a66a9 1 parent ba28017
@przemoc authored
Showing with 96 additions and 1 deletion.
  1. +1 −0  .gitignore
  2. +6 −1 Makefile → Makefile.in
  3. +3 −0  NEWS
  4. +86 −0 configure
View
1  .gitignore
@@ -1,2 +1,3 @@
*.o
vidma*
+Makefile
View
7 Makefile → Makefile.in
@@ -24,6 +24,8 @@ CFLAGS += -Wall -O2
override CFLAGS += -std=c99 -Wno-variadic-macros \
-D_FILE_OFFSET_BITS=64 -D_XOPEN_SOURCE=600 \
-DVIDMA_VERSION="\"$(VIDMA_VERSION)\""
+CPPFLAGS +=
+LDFLAGS +=
PREFIX := /usr/local
EPREFIX := $(PREFIX)
@@ -61,6 +63,9 @@ $(OUT): $(OBJS)
clean:
$(RM) $(OUT) $(OBJS) $(if $(NOT_IN_SRCDIR),$(MAN1))
+distclean: clean
+ $(RM) Makefile $(MAN1).html
+
install: $(OUT) $(MAN1)
$(INSTALL) -d $(DESTDIR)$(BINDIR)
$(INSTALL_EXEC) $(OUT) $(DESTDIR)$(BINDIR)/$(OUT)
@@ -76,4 +81,4 @@ uninstall:
FORCE:
-.PHONY: all clean install uninstall
+.PHONY: all clean distclean install uninstall
View
3  NEWS
@@ -2,6 +2,9 @@
- Messages printed by vidma have been slightly changed.
+- Simple configure script has been added. You have to run it before invoking
+ make. Building outside of the source directory is now supported.
+
* What's new in version 0.0.3a (2011-02-28)
- Manual page has been added.
View
86 configure
@@ -0,0 +1,86 @@
+#!/bin/sh
+
+# Copyright (C) 2011 Przemyslaw Pawelczyk <przemoc@gmail.com>
+#
+# This software is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2.
+# See <http://www.gnu.org/licenses/gpl-2.0.txt>.
+#
+# This software is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+
+# minimalistic configure-like script
+
+set -e
+
+SRCDIR="$(dirname $0)"
+
+help() {
+ echo \
+"Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE. See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+ -h, --help display this help and exit
+ --srcdir=DIR find the sources in DIR [configure dir]
+
+Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [/usr/local]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [PREFIX]
+
+Fine tuning of the installation directories:
+ --bindir=DIR user executables [EPREFIX/bin]
+ --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
+ --mandir=DIR man documentation [DATAROOTDIR/man]
+ --docdir=DIR documentation root [DATAROOTDIR/doc/vidma]
+
+Some influential environment variables:
+ CFLAGS C compiler flags
+ LDFLAGS linker flags
+ CPPFLAGS C/C++/Objective C preprocessor flags
+"
+ exit 0
+}
+
+modify() {
+ if [ -n "$OPTARG" ]; then
+ CMDS="$CMDS/^$1 /"'s#\([^ ]\?\)= .*#\1= '"$OPTARG#;"
+ fi
+}
+
+for OPT in "$@"; do
+ case "$OPT" in
+ *=*)
+ OPTARG="$(expr "$OPT" : '[^=]*=\(.*\)' || true)"
+ ;;
+ *)
+ OPTARG=""
+ ;;
+ esac
+ case "$OPT" in
+ -h | --help) help ;;
+ --srcdir=*) SRCDIR="${OPTARG:-${SRCDIR}}" ;;
+ --prefix=*) modify PREFIX ;;
+ --exec-prefix=*) modify EPREFIX ;;
+ --bindir=*) modify BINDIR ;;
+ --datarootdir=*) modify DATADIR ;;
+ --mandir=*) modify MANDIR ;;
+ --docdir=*) modify DOCDIR ;;
+ CPPFLAGS=*) modify CPPFLAGS ;;
+ CFLAGS=*) modify CFLAGS ;;
+ LDFLAGS=*) modify LDFLAGS ;;
+ esac
+done
+
+OPTARG="$SRCDIR"
+modify SRCDIR
+
+sed "$CMDS" "$SRCDIR/Makefile.in" >Makefile
Please sign in to comment.
Something went wrong with that request. Please try again.