OSDN Git Service

Support pkg-config
[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 CPPFLAGS += $(PC_CFLAGS)
15 LDLIBS += $(PC_LIBS)
16
17 LIBDIR ?= /usr/lib/
18
19 CC_LIBRARY(libgbm.so): $(C_OBJECTS)
20
21 all: CC_LIBRARY(libgbm.so)
22
23 clean: CLEAN(libgbm.so)
24
25 install: all
26         mkdir -p $(DESTDIR)/$(LIBDIR)
27         install -D -m 755 $(OUT)/libgbm.so $(DESTDIR)/$(LIBDIR)
28         install -D -m 0644 $(SRC)/libgbm.pc $(DESTDIR)$(LIBDIR)/pkgconfig/libgbm.pc
29         install -D -m 0644 $(SRC)/gbm.h $(DESTDIR)/usr/include/gbm.h