-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathMakefile.standalone
59 lines (49 loc) · 1.64 KB
/
Makefile.standalone
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
51
52
53
54
55
56
57
58
59
TOP_DIR = $(shell pwd)
TARGET ?= $(TOP_DIR)/deployment
DEPLOY_RUNTIME ?= /usr
TOOLS_DIR = $(TOP_DIR)/tools
WRAP_PERL_TOOL = wrap_perl
WRAP_PERL_SCRIPT = bash $(TOOLS_DIR)/$(WRAP_PERL_TOOL).sh
SRC_PERL = $(wildcard client/*.pl)
WRAP_PYTHON_TOOL = wrap_python
WRAP_PYTHON_SCRIPT = bash $(TOOLS_DIR)/$(WRAP_PYTHON_TOOL).sh
SRC_PYTHON = $(wildcard client/*.py)
ABS_PATH_TOOL = abs_path
ABS_PATH_SCRIPT = bash $(TOOLS_DIR)/$(ABS_PATH_TOOL).sh
default: deploy
deploy: deploy-client
deploy-client: deploy-libs deploy-scripts
deploy-compute: deploy-module-bin deploy-libs deploy-scripts
deploy-libs:
mkdir -p $(TARGET)/lib
rsync --exclude '*.bak*' -arv lib/. $(TARGET)/lib/.
deploy-scripts:
mkdir -p $(TARGET)/bin; \
mkdir -p $(TARGET)/plbin; \
export KB_TOP=$(TARGET); \
export KB_RUNTIME=$(DEPLOY_RUNTIME); \
export KB_PERL_PATH=$(TARGET)/lib bash ; \
for src in $(SRC_PERL) ; do \
basefile=`basename $$src`; \
base=`basename $$src .pl`; \
echo install $$src $$base ; \
cp $$src $(TARGET)/plbin/ ; \
$(WRAP_PERL_SCRIPT) "$(TARGET)/plbin/$$basefile" $(TARGET)/bin/$$base ; \
done; \
mkdir -p $(TARGET)/pybin; \
export KB_PYTHON_PATH=$(TARGET)/lib bash ; \
for src in $(SRC_PYTHON) ; do \
basefile=`basename $$src`; \
base=`basename $$src .py`; \
echo install $$src $$base ; \
cp $$src $(TARGET)/pybin/ ; \
$(WRAP_PYTHON_SCRIPT) "$(TARGET)/pybin/$$basefile" $(TARGET)/bin/$$base ; \
done; \
scripts=`$(ABS_PATH_SCRIPT) $(TARGET)/bin`; \
echo "Assembly scripts deployed in $$scripts"
deploy-module-bin:
mkdir -p $(TARGET)/module_bin
rsync -arv module_bin/. $(TARGET)/module_bin/.
test: test-client
test-client:
cd test && ./arast.t -d tmp