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 GRALLOCTEST = gralloctest 6 SOURCES += gralloctest.c 7 8 CCFLAGS += -g -O2 -Wall -fPIE 9 LIBS += -lhardware -lsync -lcutils -pie 10 11 OBJS = $(foreach source, $(SOURCES), $(addsuffix .o, $(basename $(source)))) 12 13 OBJECTS = $(addprefix $(TARGET_DIR), $(notdir $(OBJS))) 14 BINARY = $(addprefix $(TARGET_DIR), $(GRALLOCTEST)) 15 16 .PHONY: all clean 17 18 all: $(BINARY) 19 20 $(BINARY): $(OBJECTS) 21 22 clean: 23 $(RM) $(BINARY) 24 $(RM) $(OBJECTS) 25 26 $(BINARY): 27 $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ $(LIBS) 28 29 $(TARGET_DIR)%.o: %.c 30 $(CC) $(CFLAGS) -c $^ -o $@ -MMD 31