forked from VentionCo/mm-python-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
38 lines (31 loc) · 1002 Bytes
/
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
# ----------------------------------------------------------------------------
# Get branch and release information.
CURRENT_BRANCH = $(shell git branch | grep \* | cut -d ' ' -f2)
VERSION = $(shell cat version.txt)
RELEASE_BRANCH = release/${VERSION}
CWD = $(shell pwd)
LIB_NAME = MachineMotion
P3_SITE = $(shell python3 -m site --user-site)
P2_SITE = $(shell python2 -m site --user-site)
.PHONY: all release install clean
all: install done
release: checkout-release done
# symlink to site packages.
install: clean
ln -s $(CWD) $(P3_SITE)/$(LIB_NAME)
ln -s $(CWD) $(P2_SITE)/$(LIB_NAME)
# clear old links.
clean:
rm -f $(P3_SITE)/$(LIB_NAME)
rm -f $(P2_SITE)/$(LIB_NAME)
# ----------------------------------------------------------------------------
# Branch management
checkout-release:
ifneq (${CURRENT_BRANCH},${RELEASE_BRANCH})
@echo "Switching to branch ${RELASE_BRANCH}"
@git pull
@git checkout ${RELEASE_BRANCH}
@echo Done - mm-python-api
endif
done:
@echo Done - mm-python-api