OSDN Git Service

minigbm: fix renderscipt allocation
[android-x86/external-minigbm.git] / cros_gralloc / Makefile
1 # Copyright 2016 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 GRALLOC = gralloc.cros.so
6
7 SRCS    = $(wildcard *.cc)
8 SRCS   += $(wildcard ../*.c)
9 SOURCES = $(filter-out ../gbm%, $(SRCS))
10
11 VPATH = $(dir $(SOURCES))
12
13 CPPFLAGS += -Wall -fPIC -Werror -flto
14 CXXFLAGS += -std=c++11
15 CFLAGS   += -std=c99
16 LIBS     += -shared -lcutils -lhardware -ldrm
17
18 OBJS =  $(foreach source, $(SOURCES), $(addsuffix .o, $(basename $(source))))
19
20 OBJECTS = $(addprefix $(TARGET_DIR), $(notdir $(OBJS)))
21 LIBRARY = $(addprefix $(TARGET_DIR), $(GRALLOC))
22
23 .PHONY: all clean
24
25 all: $(LIBRARY)
26
27 $(LIBRARY): $(OBJECTS)
28
29 clean:
30         $(RM) $(LIBRARY)
31         $(RM) $(OBJECTS)
32
33 $(LIBRARY):
34         $(CXX) $(CPPFLAGS) $(CXXFLAGS) $^ -o $@ $(LIBS)
35
36 $(TARGET_DIR)%.o: %.cc
37         $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $^ -o $@ -MMD
38
39 $(TARGET_DIR)%.o: %.c
40         $(CC) $(CPPFLAGS) $(CFLAGS) -c $^ -o $@ -MMD