|
1 | 1 | # Check if we're running in Jenkins |
2 | 2 | ifdef JENKINS_URL |
3 | | - # Files are already in workspace from shared library |
| 3 | +# Files are already in workspace from shared library |
4 | 4 | MAKE_INCLUDES := . |
5 | 5 | else |
6 | | - # For local dev, use the installed vivarium_build_utils package |
7 | | - MAKE_INCLUDES := $(shell python -c "import vivarium_build_utils.resources" &>/dev/null && python -c "from vivarium_build_utils.resources import get_makefiles_path; print(get_makefiles_path())") |
| 6 | +# For local dev, use the installed vivarium_build_utils package if it exists |
| 7 | +# First, check if we can import vivarium_build_utils and assign 'yes' or 'no'. |
| 8 | +# We do this by importing the package in python and redirecting stderr to the null device. |
| 9 | +# If the import is successful (&&), it will print 'yes', otherwise (||) it will print 'no'. |
| 10 | + VIVARIUM_BUILD_UTILS_AVAILABLE := $(shell python -c "import vivarium_build_utils" 2>/dev/null && echo "yes" || echo "no") |
| 11 | +# If vivarium_build_utils is available, get the makefiles path or else set it to empty |
| 12 | + ifeq ($(VIVARIUM_BUILD_UTILS_AVAILABLE),yes) |
| 13 | + MAKE_INCLUDES := $(shell python -c "from vivarium_build_utils.resources import get_makefiles_path; print(get_makefiles_path())") |
| 14 | + else |
| 15 | + MAKE_INCLUDES := |
| 16 | + endif |
8 | 17 | endif |
9 | 18 |
|
| 19 | +# Set the package name as the last part of this file's parent directory path |
10 | 20 | PACKAGE_NAME = $(notdir $(CURDIR)) |
11 | 21 |
|
| 22 | +ifneq ($(MAKE_INCLUDES),) # not empty |
12 | 23 | # Include makefiles from vivarium_build_utils |
13 | | -ifneq ($(MAKE_INCLUDES),) # if not an empty string |
14 | 24 | include $(MAKE_INCLUDES)/base.mk |
15 | 25 | include $(MAKE_INCLUDES)/test.mk |
16 | | -endif |
17 | | - |
18 | | -ifeq ($(MAKE_INCLUDES),) # empty string |
| 26 | +else # empty |
| 27 | +# Use this help message (since the vivarium_build_utils version is not available) |
19 | 28 | help: |
20 | 29 | @echo |
21 | 30 | @echo "For Make's standard help, run 'make --help'." |
|
0 commit comments