From ea00c2fc6d91d71b8cf3c8408af8ca8de7c037a6 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 27 Mar 2010 12:16:01 +0100 Subject: 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 --- config.mk | 43 +++++++++++++++++-------------------------- 1 file changed, 17 insertions(+), 26 deletions(-) (limited to 'config.mk') 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 -+ 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} -- cgit v1.2.3