forked from microsoft/Olive
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
50 lines (43 loc) · 1.43 KB
/
Makefile
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
46
47
48
49
50
WINDOWS ?= False
PIPELINE ?= False
INSTALL_DEV_MODE ?= False
EXAMPLE_FOLDER ?=
EXAMPLE_NAME ?=
INSTALL_EXTRAS ?=
VERSION ?=
ifeq ($(WINDOWS), True)
CURRENT_DIR = "$(subst /,\\,${CURDIR})"
MKDIR_LOG_CMD = mkdir logs | exit 0
INSTALL_OLIVE_CMD = "scripts\\install_olive.bat"
TEST_CMD = "scripts\\test.bat"
TEST_EXAMPLES_CMD = "scripts\\test_examples.bat"
OVERWRITE_VERSION = "python scripts\\overwrite_version.py --version $(VERSION)"
else
CURRENT_DIR = ${CURDIR}
MKDIR_LOG_CMD = mkdir -p logs
INSTALL_OLIVE_CMD = bash scripts/install_olive.sh
TEST_CMD = bash scripts/test.sh
TEST_EXAMPLES_CMD = bash scripts/test_examples.sh
OVERWRITE_VERSION = python scripts/overwrite_version.py --version $(VERSION)
endif
.PHONY: all
all:
@echo "Please specify your command. Options: install-olive, test-examples, clean."
logs/:
$(MKDIR_LOG_CMD)
.PHONY: overwrite-version
overwrite-version:
$(OVERWRITE_VERSION)
.PHONY: install-olive
install-olive:
$(INSTALL_OLIVE_CMD) $(PIPELINE) $(INSTALL_DEV_MODE)
.PHONY: test
test:
$(TEST_CMD) $(PIPELINE) $(CURRENT_DIR)
.PHONY: test-examples
test-examples: logs/
test-examples:
$(TEST_EXAMPLES_CMD) $(PIPELINE) $(CURRENT_DIR) $(EXAMPLE_FOLDER) $(EXAMPLE_NAME)
.PHONY: clean
clean:
git clean -dfX