summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2013-06-15 17:10:59 -0600
committerLuke Shumaker <LukeShu@sbcglobal.net>2013-06-15 18:02:55 -0600
commit7b32b8e5eb7cdc8939042ab665f1b80f03036132 (patch)
treeaf4739cb2ce2cfced5947fe3ad09f35fe51bb25f
parent5a1241643d4360fa8acc5a1bb9dfbd4a5c691c49 (diff)
Makefiles: pull the config section into config.mk
-rw-r--r--Makefile16
-rw-r--r--common.mk19
-rw-r--r--config.mk21
-rw-r--r--src/devtools/Makefile21
4 files changed, 27 insertions, 50 deletions
diff --git a/Makefile b/Makefile
index c621a09..be453fb 100644
--- a/Makefile
+++ b/Makefile
@@ -1,17 +1,5 @@
-# Configuration
-DESTDIR=
-
-#prefix=/usr/local
-prefix=/usr
-exec_prefix=$(prefix)
-datarootdir=$(prefix)/share
-
-bindir=$(exec_prefix)/bin
-sbindir=$(exec_prefix)/sbin
-#sysconfdir=$(prefix)/etc
-sysconfdir=/etc
-datadir=$(datarootdir)
-docdir=$(datarootdir)/doc
+topdir = .
+include config.mk
################################################################################
diff --git a/common.mk b/common.mk
index ef96ee6..bbb1b7c 100644
--- a/common.mk
+++ b/common.mk
@@ -1,20 +1,5 @@
-# Configuration
-DESTDIR=
-
-#prefix=/usr/local
-prefix=/usr
-exec_prefix=$(prefix)
-bindir=$(exec_prefix)/bin
-sbindir=$(exec_prefix)/sbin
-#libexecdir=$(exec_prefix)/libexec
-libexecdir=$(exec_prefix)/lib
-
-datarootdir=$(prefix)/share
-datadir=$(datarootdir)
-#sysconfdir=$(prefix)/etc
-sysconfdir=/etc
-
-docdir=$(datarootdir)/doc
+topdir := $(dir $(lastword $(MAKEFILE_LIST)))
+include $(topdir)/config.mk
################################################################################
progs = $(shell find . -maxdepth 1 -type f -executable -printf '%f\n')
diff --git a/config.mk b/config.mk
new file mode 100644
index 0000000..1f890d0
--- /dev/null
+++ b/config.mk
@@ -0,0 +1,21 @@
+# Configuration
+# Note: $(topdir) is set to the directory containing this file.
+
+DESTDIR=
+
+#prefix=/usr/local
+prefix=/usr
+exec_prefix=$(prefix)
+bindir=$(exec_prefix)/bin
+sbindir=$(exec_prefix)/sbin
+#libexecdir=$(exec_prefix)/libexec
+libexecdir=$(exec_prefix)/lib
+
+datarootdir=$(prefix)/share
+datadir=$(datarootdir)
+#sysconfdir=$(prefix)/etc
+sysconfdir=/etc
+
+docdir=$(datarootdir)/doc
+
+devtoolsdir=$(topdir)/../devtools-par
diff --git a/src/devtools/Makefile b/src/devtools/Makefile
index e0a7386..ddfdb0f 100644
--- a/src/devtools/Makefile
+++ b/src/devtools/Makefile
@@ -1,27 +1,10 @@
-# Configuration
-DESTDIR=
-
-#prefix=/usr/local
-prefix=/usr
-exec_prefix=$(prefix)
-bindir=$(exec_prefix)/bin
-sbindir=$(exec_prefix)/sbin
-#libexecdir=$(exec_prefix)/libexec
-libexecdir=$(exec_prefix)/lib
-
-datarootdir=$(prefix)/share
-datadir=$(datarootdir)
-#sysconfdir=$(prefix)/etc
-sysconfdir=/etc
-
-docdir=$(datarootdir)/doc
+topdir = ../..
+include ../../config.mk
######################################################################
pkglibexecdir=$(libexecdir)/libretools
-devtoolsdir=../../../devtools-par
-
default: all
all: build