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/share/protofiles 11 PROTO_DEFS = $(PROTO_PATH)/chrome_device_policy.proto \ 12 $(PROTO_PATH)/device_management_backend.proto \ 13 $(PROTO_PATH)/chrome_extension_policy.proto \ 14 $(PROTO_PATH)/cloud_policy.proto 15 PROTO_BINDINGS = $(OUT_DIR)/chrome_device_policy_pb2.py \ 16 $(OUT_DIR)/device_management_backend_pb2.py \ 17 $(OUT_DIR)/chrome_extension_policy_pb2.py \ 18 $(OUT_DIR)/cloud_policy_pb2.py 19 20 all: $(PROTO_BINDINGS) 21 22 $(PROTO_BINDINGS): $(PROTO_DEFS) 23 protoc --proto_path=$(PROTO_PATH) --python_out=$(OUT_DIR) $(PROTO_DEFS) 24 25 clean: 26 rm -f $(PROTO_BINDINGS) 27