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 | |
| 14 | CPPFLAGS += $(PC_CFLAGS) |
| 15 | LDLIBS += $(PC_LIBS) |
| 16 | |
Stéphane Marchesin | 85afac4 | 2014-09-15 15:38:37 -0700 | [diff] [blame] | 17 | LIBDIR ?= /usr/lib/ |
| 18 | |
Stéphane Marchesin | 25a2606 | 2014-09-12 16:18:59 -0700 | [diff] [blame] | 19 | CC_LIBRARY(libgbm.so): $(C_OBJECTS) |
| 20 | |
| 21 | all: CC_LIBRARY(libgbm.so) |
| 22 | |
| 23 | clean: CLEAN(libgbm.so) |
| 24 | |
| 25 | install: all |
Stéphane Marchesin | 85afac4 | 2014-09-15 15:38:37 -0700 | [diff] [blame] | 26 | mkdir -p $(DESTDIR)/$(LIBDIR) |
Stéphane Marchesin | 8c7039c | 2014-09-18 18:27:41 -0700 | [diff] [blame^] | 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 |