Permalink
Browse files

makefile: Make INSTALL_DIR optional, and create the directory

This patch allows to override to default (pkg-config-obtained)
install path. Also, we need to make sure the directory is
created, for it could be inexistent.

Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
  • Loading branch information...
1 parent 474569f commit 2f58a127871414b4ac06e89d8ef482706a37f3b3 @ezequielgarcia committed Jul 29, 2013
Showing with 4 additions and 1 deletion.
  1. +4 −1 makefile
View
@@ -12,7 +12,9 @@ DFB_HEADER = $(DFB_INC_DIR)directfb_keyboard.h $(DFB_INC_DIR)directfb.h
CFLAGS = -Wall -fPIC $(shell pkg-config --cflags directfb $(LUA))
LDFLAGS = -shared $(shell pkg-config --libs directfb $(LUA))
-INSTALL_DIR = $(shell pkg-config --variable INSTALL_CMOD $(LUA))
+
+# We might want to install the module to a different path
+INSTALL_DIR ?= $(shell pkg-config --variable INSTALL_CMOD $(LUA))
COMPAT_DIR := compat/
SRC_DIR := src/
@@ -39,6 +41,7 @@ tags: $(SRC_DIR)* $(DFB_HEADER)
.PHONY: install
install: $(OUTPUT)
+ $(Q)mkdir -p $(INSTALL_DIR)
$(Q)cp $(OUTPUT) $(INSTALL_DIR)
.PHONY: clean

0 comments on commit 2f58a12

Please sign in to comment.