Stéphane Marchesin | 25a2606 | 2014-09-12 16:18:59 -0700 | [diff] [blame] | 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 | |
Stéphane Marchesin | eeac2ff | 2014-09-18 14:42:42 -0700 | [diff] [blame^] | 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 | |
Stéphane Marchesin | 25a2606 | 2014-09-12 16:18:59 -0700 | [diff] [blame] | 24 | CPPFLAGS += $(PC_CFLAGS) |
| 25 | LDLIBS += $(PC_LIBS) |
| 26 | |
Stéphane Marchesin | 85afac4 | 2014-09-15 15:38:37 -0700 | [diff] [blame] | 27 | LIBDIR ?= /usr/lib/ |
| 28 | |
Stéphane Marchesin | 25a2606 | 2014-09-12 16:18:59 -0700 | [diff] [blame] | 29 | CC_LIBRARY(libgbm.so): $(C_OBJECTS) |
| 30 | |
| 31 | all: CC_LIBRARY(libgbm.so) |
| 32 | |
| 33 | clean: CLEAN(libgbm.so) |
| 34 | |
| 35 | install: all |
Stéphane Marchesin | 85afac4 | 2014-09-15 15:38:37 -0700 | [diff] [blame] | 36 | mkdir -p $(DESTDIR)/$(LIBDIR) |
Stéphane Marchesin | 8c7039c | 2014-09-18 18:27:41 -0700 | [diff] [blame] | 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 |