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.
5 GRALLOC = gralloc.cros.so
7 SRCS = $(wildcard *.cc)
8 SRCS += $(wildcard ../*.c)
9 SOURCES = $(filter-out ../gbm%, $(SRCS))
11 VPATH = $(dir $(SOURCES))
13 CPPFLAGS += -Wall -fPIC -Werror -flto
14 CXXFLAGS += -std=c++11
16 LIBS += -shared -lcutils -lhardware -ldrm
18 OBJS = $(foreach source, $(SOURCES), $(addsuffix .o, $(basename $(source))))
20 OBJECTS = $(addprefix $(TARGET_DIR), $(notdir $(OBJS)))
21 LIBRARY = $(addprefix $(TARGET_DIR), $(GRALLOC))
27 $(LIBRARY): $(OBJECTS)
34 $(CXX) $(CPPFLAGS) $(CXXFLAGS) $^ -o $@ $(LIBS)
36 $(TARGET_DIR)%.o: %.cc
37 $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $^ -o $@ -MMD
40 $(CC) $(CPPFLAGS) $(CFLAGS) -c $^ -o $@ -MMD