Import minigbm

Minigbm is a gbm implementation for a few DRM targets. Currently the
targets are:
- cirrus
- exynos
- gma500
- i915
- rockchip
- tegra
- udl

Right some targets are controlled with GBM_{TARGET} flags. I would
like to get to a place where we can just build all the targets in a
single library, but we need the drm headers for all targets for that
to happen so this needs more thinking.

BUG=chromium:394868,chromium:402597,chromium:413947,chromium:412508
TEST=unit tests, which I will need to import later

Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>
Change-Id: I36ae07f2a59827a807e19e1432891ca196b28803
Reviewed-on: https://chromium-review.googlesource.com/218030
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..a6985e6
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,25 @@
+# Copyright 2014 The Chromium OS Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+include common.mk
+
+PC_DEPS = libdrm
+PC_CFLAGS := $(shell $(PKG_CONFIG) --cflags $(PC_DEPS))
+PC_LIBS := $(shell $(PKG_CONFIG) --libs $(PC_DEPS))
+
+CPPFLAGS += -std=c99 -D_GNU_SOURCE=1
+CFLAGS += -Wall -Wsign-compare -Wpointer-arith -Wcast-qual -Wcast-align
+
+CPPFLAGS += $(PC_CFLAGS)
+LDLIBS += $(PC_LIBS)
+
+CC_LIBRARY(libgbm.so): $(C_OBJECTS)
+
+all: CC_LIBRARY(libgbm.so)
+
+clean: CLEAN(libgbm.so)
+
+install: all
+	mkdir -p $(DESTDIR)/usr/lib
+	install -m 755 $(OUT)/libgbm.so $(DESTDIR)/usr/lib/