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 ifndef SYSROOT
      6   $(error Define SYSROOT)
      7 endif
      8 
      9 OUT_DIR ?= .
     10 PROTO_PATH = $(SYSROOT)/usr/include/metrics/proto
     11 PROTO_DEFS = $(PROTO_PATH)/*.proto
     12 PROTO_BINDINGS = $(PROTO_DEFS:$PROTO_PATH%.proto=$OUT_DIR%_pb2.py)
     13 
     14 all: $(PROTO_BINDINGS)
     15 
     16 $(PROTO_BINDINGS): $(PROTO_DEFS)
     17 	protoc --proto_path=$(PROTO_PATH) --python_out=$(OUT_DIR) $(PROTO_DEFS)
     18 
     19 clean:
     20 	rm -f $(PROTO_BINDINGS)
     21