summaryrefslogtreecommitdiff
path: root/config.mk
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2010-03-27 12:16:01 +0100
committerDaniel Friesel <derf@derf.homelinux.org>2010-03-27 12:16:01 +0100
commitea00c2fc6d91d71b8cf3c8408af8ca8de7c037a6 (patch)
treed113e1e07c6ae4fe7b9b3d27d35b1e23885abbad /config.mk
parent69d69f145763f01724efdce119f6312272022740 (diff)
Makefile/config.mk: Support getting the usual values from the environment.
No need to edit config.mk to set addictional CFLAGS/LDFLAGS or change the DESTDIR etc. now
Diffstat (limited to 'config.mk')
-rw-r--r--config.mk43
1 files changed, 17 insertions, 26 deletions
diff --git a/config.mk b/config.mk
index f254354..03c3d4d 100644
--- a/config.mk
+++ b/config.mk
@@ -1,45 +1,36 @@
-package = feh
-version = 1.4.1-git
-
-# Customize below:
+PACKAGE ?= feh
+VERSION ?= 1.4.1-git
# Prefix for all installed files
-prefix = /usr/local
+PREFIX ?= /usr/local
# Directories for manuals, executables, docs, data, etc.
-man_dir = $(prefix)/share/man
-bin_dir = $(prefix)/bin
-doc_dir = $(prefix)/share/doc
-image_dir = $(prefix)/share/feh/images
-font_dir = $(prefix)/share/feh/fonts
+main_dir = ${DESTDIR}${PREFIX}
+man_dir = ${main_dir}/share/man
+bin_dir = ${main_dir}/bin
+doc_dir = ${main_dir}/share/doc
+image_dir = ${main_dir}/share/feh/images
+font_dir = ${main_dir}/share/feh/fonts
# default CFLAGS
-CFLAGS = -g -Wall -Wextra -pedantic -O2
+CFLAGS ?= -g -O2
+CFLAGS += -Wall -Wextra -pedantic
# Comment these out if you don't have libxinerama
xinerama = -DHAVE_LIBXINERAMA
xinerama_ld = -lXinerama
-# Put extra header (-I/some/directory) directories here
-extra_headers =
-
-# Put extra include (-L/some/directory) directories here
-extra_libs =
-
debug = -DDEBUG
# Uncomment this for debug mode
# (Use feh -+ <level> to see debug output)
-#CFLAGS += $(debug)
+#CFLAGS += ${debug}
dmalloc = -DWITH_DMALLOC
# Uncomment this to use dmalloc
-#CFLAGS += $(dmalloc)
-
-
-# You should not need to change anything below this line.
+#CFLAGS += ${dmalloc}
-CFLAGS += $(extra_headers) $(xinerama) -DPREFIX=\"$(prefix)\" \
- -DPACKAGE=\"$(package)\" -DVERSION=\"$(version)\"
+CFLAGS += ${xinerama} -DPREFIX=\"${PREFIX}\" \
+ -DPACKAGE=\"${PACKAGE}\" -DVERSION=\"${VERSION}\"
-LDFLAGS = -lpng -lX11 -lImlib2 -lfreetype -lXext -lgiblib \
- $(xinerama_ld) $(extra_includes)
+LDFLAGS += -lpng -lX11 -lImlib2 -lfreetype -lXext -lgiblib \
+ ${xinerama_ld} ${extra_includes}