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 5GBMTEST = gbmtest 6SOURCES += gbmtest.c 7 8OBJS = $(SOURCES:.c=.o) 9DEPS = $(SOURCES:.c=.d) 10 11PKG_CONFIG ?= pkg-config 12CCFLAGS += -g -O2 -Wall -Werror 13CCFLAGS += $(shell $(PKG_CONFIG) --cflags gbm libdrm) 14LDLIBS += $(PC_LIBS) 15LDLIBS += $(shell $(PKG_CONFIG) --libs gbm libdrm) 16 17.PHONY: all clean 18 19all: $(GBMTEST) 20 21$(GBMTEST): $(OBJS) 22 23clean: 24 $(RM) $(GBMTEST) 25 $(RM) $(OBJS) $(DEPS) 26 $(RM) *.o *.d .version 27 28$(GBMTEST): 29 $(CC) $(CCFLAGS) $(LDFLAGS) $^ -o $@ $(LDLIBS) 30 31$(OBJS): %.o: %.c 32 $(CC) $(CCFLAGS) -c $< -o $@ -MMD 33 34-include $(DEPS) 35