• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
5include common.mk
6
7PC_DEPS = libdrm
8PC_CFLAGS := $(shell $(PKG_CONFIG) --cflags $(PC_DEPS))
9PC_LIBS := $(shell $(PKG_CONFIG) --libs $(PC_DEPS))
10
11CPPFLAGS += -D_GNU_SOURCE=1
12CFLAGS += -std=c99 -Wall -Wsign-compare -Wpointer-arith -Wcast-qual \
13	  -Wcast-align -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64
14
15ifdef DRV_AMDGPU
16	CFLAGS += $(shell $(PKG_CONFIG) --cflags libdrm_amdgpu)
17	LDLIBS += -ldrm_amdgpu -ldl
18endif
19ifdef DRV_EXYNOS
20	CFLAGS += $(shell $(PKG_CONFIG) --cflags libdrm_exynos)
21endif
22ifdef DRV_I915
23	CFLAGS += $(shell $(PKG_CONFIG) --cflags libdrm_intel)
24endif
25ifdef DRV_MESON
26	CFLAGS += $(shell $(PKG_CONFIG) --cflags libdrm_meson)
27endif
28ifdef DRV_RADEON
29	CFLAGS += $(shell $(PKG_CONFIG) --cflags libdrm_radeon)
30endif
31ifdef DRV_ROCKCHIP
32	CFLAGS += $(shell $(PKG_CONFIG) --cflags libdrm_rockchip)
33endif
34ifdef DRV_VC4
35	CFLAGS += $(shell $(PKG_CONFIG) --cflags libdrm_vc4)
36endif
37
38CPPFLAGS += $(PC_CFLAGS)
39LDLIBS += $(PC_LIBS)
40
41LIBDIR ?= /usr/lib/
42
43GBM_VERSION_MAJOR := 1
44MINIGBM_VERSION := $(GBM_VERSION_MAJOR).0.0
45MINIGBM_FILENAME := libminigbm.so.$(MINIGBM_VERSION)
46
47CC_LIBRARY($(MINIGBM_FILENAME)): LDFLAGS += -Wl,-soname,libgbm.so.$(GBM_VERSION_MAJOR)
48CC_LIBRARY($(MINIGBM_FILENAME)): $(C_OBJECTS)
49
50all: CC_LIBRARY($(MINIGBM_FILENAME))
51
52clean: CLEAN($(MINIGBM_FILENAME))
53
54install: all
55	mkdir -p $(DESTDIR)/$(LIBDIR)
56	install -D -m 755 $(OUT)/$(MINIGBM_FILENAME) $(DESTDIR)/$(LIBDIR)
57	ln -sf $(MINIGBM_FILENAME) $(DESTDIR)/$(LIBDIR)/libgbm.so
58	ln -sf $(MINIGBM_FILENAME) $(DESTDIR)/$(LIBDIR)/libgbm.so.$(GBM_VERSION_MAJOR)
59	install -D -m 0644 $(SRC)/gbm.pc $(DESTDIR)$(LIBDIR)/pkgconfig/gbm.pc
60	install -D -m 0644 $(SRC)/gbm.h $(DESTDIR)/usr/include/gbm.h
61