OSDN Git Service

fix the test for environment variables
[android-x86/external-minigbm.git] / Makefile
1 # Copyright 2014 The Chromium OS Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 include common.mk
6
7 PC_DEPS = libdrm
8 PC_CFLAGS := $(shell $(PKG_CONFIG) --cflags $(PC_DEPS))
9 PC_LIBS := $(shell $(PKG_CONFIG) --libs $(PC_DEPS))
10
11 CPPFLAGS += -std=c99 -D_GNU_SOURCE=1
12 CFLAGS += -Wall -Wsign-compare -Wpointer-arith -Wcast-qual -Wcast-align
13
14 ifdef GBM_EXYNOS
15         CFLAGS += $(shell $(PKG_CONFIG) --cflags libdrm_exynos)
16 endif
17 ifdef GBM_I915
18         CFLAGS += $(shell $(PKG_CONFIG) --cflags libdrm_intel)
19 endif
20 ifdef GBM_ROCKCHIP
21         CFLAGS += $(shell $(PKG_CONFIG) --cflags libdrm_rockchip)
22 endif
23
24 CPPFLAGS += $(PC_CFLAGS)
25 LDLIBS += $(PC_LIBS)
26
27 LIBDIR ?= /usr/lib/
28
29 CC_LIBRARY(libgbm.so): $(C_OBJECTS)
30
31 all: CC_LIBRARY(libgbm.so)
32
33 clean: CLEAN(libgbm.so)
34
35 install: all
36         mkdir -p $(DESTDIR)/$(LIBDIR)
37         install -D -m 755 $(OUT)/libgbm.so $(DESTDIR)/$(LIBDIR)
38         install -D -m 0644 $(SRC)/libgbm.pc $(DESTDIR)$(LIBDIR)/pkgconfig/libgbm.pc
39         install -D -m 0644 $(SRC)/gbm.h $(DESTDIR)/usr/include/gbm.h