aboutsummaryrefslogtreecommitdiffstats
path: root/mk/Variables.mk
diff options
context:
space:
mode:
authorkraxel <kraxel>2008-10-14 10:14:15 +0000
committerkraxel <kraxel>2008-10-14 10:14:15 +0000
commit6d6bfa8453392ccc488e6d31586a97600c9d7583 (patch)
tree3eeeca47bcf63973143679244edbe923993d199d /mk/Variables.mk
parent6c19f2147bfa61f75775ce2b6c791b9f1d4499ab (diff)
downloadinput-6d6bfa8453392ccc488e6d31586a97600c9d7583.tar.gz
- a bunch of updates for recent input layer changes (new events, ...)
by Guillem Jover - update Makefiles.
Diffstat (limited to 'mk/Variables.mk')
-rw-r--r--mk/Variables.mk52
1 files changed, 37 insertions, 15 deletions
diff --git a/mk/Variables.mk b/mk/Variables.mk
index 4449d81..99f787c 100644
--- a/mk/Variables.mk
+++ b/mk/Variables.mk
@@ -1,33 +1,55 @@
# common variables ...
########################################################################
-# package + version
-empty :=
-space := $(empty) $(empty)
-PWD := $(shell pwd)
-DIR := $(patsubst $(dir $(PWD))%,%,$(PWD))
-PACKAGE := $(word 1,$(subst -,$(space),$(DIR)))
-VERSION := $(word 2,$(subst -,$(space),$(DIR)))
-TARBALL := $(PACKAGE)_$(VERSION).tar.gz
-
# directories
DESTDIR =
+srcdir ?= .
prefix ?= /usr/local
bindir = $(DESTDIR)$(prefix)/bin
-mandir = $(DESTDIR)$(prefix)/share/man
-locdir = $(DESTDIR)$(prefix)/share/locale
+sbindir = $(DESTDIR)$(prefix)/sbin
+libdir = $(DESTDIR)$(prefix)/$(LIB)
+shrdir = $(DESTDIR)$(prefix)/share
+mandir = $(shrdir)/man
+locdir = $(shrdir)/locale
+appdir = $(shrdir)/applications
+
+# package + version
+empty :=
+space := $(empty) $(empty)
+ifneq ($(wildcard $(srcdir)/VERSION),)
+ VERSION := $(shell cat $(srcdir)/VERSION)
+else
+ VERSION := 42
+endif
+RELTAG := v$(subst .,_,$(VERSION))
# programs
CC ?= gcc
CXX ?= g++
MOC ?= $(if $(QTDIR),$(QTDIR)/bin/moc,moc)
+
+STRIP ?= -s
INSTALL ?= install
-INSTALL_BINARY := $(INSTALL) -s
+INSTALL_BINARY := $(INSTALL) $(STRIP)
INSTALL_SCRIPT := $(INSTALL)
INSTALL_DATA := $(INSTALL) -m 644
INSTALL_DIR := $(INSTALL) -d
# cflags
-CFLAGS ?= -g -O2
-CFLAGS += -Wall -Wmissing-prototypes -Wstrict-prototypes \
- -Wpointer-arith -Wunused
+CFLAGS ?= -g -O2
+CXXFLAGS ?= $(CFLAGS)
+CFLAGS += -Wall -Wmissing-prototypes -Wstrict-prototypes \
+ -Wpointer-arith -Wunused
+CXXFLAGS += -Wall -Wpointer-arith -Wunused
+
+# add /usr/local to the search path if something is in there ...
+ifneq ($(wildcard /usr/local/include/*.h),)
+ CFLAGS += -I/usr/local/include
+ LDFLAGS += -L/usr/local/$(LIB)
+endif
+
+# fixup include path for $(srcdir) != "."
+ifneq ($(srcdir),.)
+ CFLAGS += -I. -I$(srcdir)
+endif
+