Home | History | Annotate | Download | only in src
      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 
      5 GBMTEST = gbmtest
      6 SOURCES += gbmtest.c
      7 
      8 OBJS = $(SOURCES:.c=.o)
      9 DEPS = $(SOURCES:.c=.d)
     10 
     11 PKG_CONFIG ?= pkg-config
     12 CCFLAGS += -g -O2 -Wall -Werror
     13 CCFLAGS += $(shell $(PKG_CONFIG) --cflags gbm libdrm)
     14 LDLIBS += $(PC_LIBS)
     15 LDLIBS += $(shell $(PKG_CONFIG) --libs gbm libdrm)
     16 
     17 .PHONY: all clean
     18 
     19 all: $(GBMTEST)
     20 
     21 $(GBMTEST): $(OBJS)
     22 
     23 clean:
     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