]> gitweb.michael.orlitzky.com - emacs-keys.git/commitdiff
Use autotools for the build/dist system.
authorMichael Orlitzky <michael@orlitzky.com>
Mon, 4 Dec 2017 13:28:55 +0000 (08:28 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Mon, 4 Dec 2017 13:42:20 +0000 (08:42 -0500)
Makefile.am [new file with mode: 0644]
autogen.sh [new file with mode: 0755]
configure.ac [new file with mode: 0644]
makefile [deleted file]

diff --git a/Makefile.am b/Makefile.am
new file mode 100644 (file)
index 0000000..dacdaae
--- /dev/null
@@ -0,0 +1,12 @@
+EXTRA_DIST = doc src
+
+consoledir = $(pkgdatadir)
+nodist_console_DATA = $(srcdir)/src/console.map
+
+if XMODMAP
+  # Without this set, we won't try to install the Xmodmap file.
+  xmodmapdir = $(pkgdatadir)
+  nodist_xmodmap_DATA = $(srcdir)/src/Xmodmap
+endif
+
+nodist_doc_DATA = $(srcdir)/doc/README
diff --git a/autogen.sh b/autogen.sh
new file mode 100755 (executable)
index 0000000..3f026c4
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/sh
+autoreconf --force --install
diff --git a/configure.ac b/configure.ac
new file mode 100644 (file)
index 0000000..51b92a0
--- /dev/null
@@ -0,0 +1,19 @@
+AC_INIT([emacs-keys], [0.0.1], [michael@orlitzky.com])
+AM_INIT_AUTOMAKE([-Wall foreign no-dist-gzip dist-xz])
+
+# --enable-Xmodmap flag, disabled by default, that decides whether or
+# not we install the Xmodmap file.
+AC_ARG_ENABLE(
+       [Xmodmap],
+       [  --enable-Xmodmap    install the Xmodmap file [[default=no]]],
+       [case "${enableval}" in
+    yes) xmodmap=true ;;
+    no)  xmodmap=false ;;
+    *) AC_MSG_ERROR([bad value ${enableval} for --enable-xmodmap]) ;;
+  esac],[xmodmap=false])
+  AM_CONDITIONAL([XMODMAP], [test x$xmodmap = xtrue])
+
+# List of output files.
+AC_CONFIG_FILES([Makefile])
+
+AC_OUTPUT
diff --git a/makefile b/makefile
deleted file mode 100644 (file)
index 87c6ccc..0000000
--- a/makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-PN = emacs-keys
-PREFIX := /usr/local
-
-# So that "make" doesn't try to install stuff.
-all:
-
-install-console: $(DESTDIR)$(PREFIX)/share/$(PN)/console.map
-install-xorg: $(DESTDIR)$(PREFIX)/share/$(PN)/Xmodmap
-
-$(DESTDIR)$(PREFIX)/share/$(PN)%: src/%
-       install -D --mode=644 $< $@