This repository was archived by the owner on Dec 29, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathfind_fplutil.mk
45 lines (41 loc) · 1.84 KB
/
find_fplutil.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Copyright 2016 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Find the fplutil directory and set it in `FPLUTIL_DIR`.
#
# We search some standard locations, such as
# (1) the variable $(DEPENDENCIES_ROOT), which can be specified
# in an environment variable,
# (2) the "dependencies" directory that gets created when cloning from GitHub,
# (3) several levels up in the directory tree.
#
# Notes
# -----
# - fplutil is the project where we keep all our shared code, so the code in
# this file (which locates fplutil) can unfortunately not be shared.
# - Since this file is duplicated in all FPL projects (except fplutil itself),
# please copy new versions to all FPL projects whenever you make a change.
FIND_FPLUTIL_DIR:=$(call my-dir)
$(foreach dir,$(wildcard $(DEPENDENCIES_ROOT)) \
$(wildcard $(FIND_FPLUTIL_DIR)/../dependencies/fplutil) \
$(wildcard $(FIND_FPLUTIL_DIR)/../../dependencies/fplutil) \
$(wildcard $(FIND_FPLUTIL_DIR)/../fplutil) \
$(wildcard $(FIND_FPLUTIL_DIR)/../../fplutil) \
$(wildcard $(FIND_FPLUTIL_DIR)/../../../fplutil) \
$(wildcard $(FIND_FPLUTIL_DIR)/../../../../fplutil),\
$(eval FPLUTIL_DIR?=$(dir)))
ifeq ($(FPLUTIL_DIR),)
ifndef (FIND_FPLUTIL_OK_IF_NOT_FOUND)
$(error "Cannot file fplutil project.")
endif
endif