forked from eomahony/Numberjack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
85 lines (59 loc) · 2.19 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
SRC = ./src
SOL = ./solvers
# List of wrappers that need to be compiled before the solver interfaces.
WRAPPERS = sat mip
SOLVERS = $(wildcard $(SOL)/*)
TEMPTARGETS = $(patsubst $(SOL)/%, %, $(SOLVERS))
TARGETS = $(WRAPPERS) $(filter-out $(WRAPPERS),$(TEMPTARGETS))
TARGET_LIB = $(TARGETS:=_lib)
TARGET_INSTALL = $(TARGETS:=_install)
TARGET_LOCAL = $(TARGETS:=_local)
TARGET_CLEAN = $(TARGETS:=_clean)
TARGET_CLEAN_SWIG = $(TARGETS:=_clean_swig)
TARGET_RELEASE = $(TARGETS:=_release)
DATE := $(shell date '+%y-%m-%d')
ACCOUNT := $(shell users)
all: $(TARGET_LIB)
%_lib: $(SOL)/%
cd $(SOL)/$(@:_lib=); make
install: $(TARGET_INSTALL)
cd $(SRC); python setup.py install
%_install: $(SOL)/%
cd $(SOL)/$(@:_install=); make install_python
local_install: $(TARGET_LIB) $(TARGET_LOCAL)
cp src/*.py ./local_lib/
chmod +x ./local_lib/*.py*
chmod +x ./local_lib/*.so
tools/help.sh
%_local: $(SOL)/%
mkdir -p ./local_lib
cp $(SOL)/$(@:_local=)/python/*.py* ./local_lib/
cp $(SOL)/$(@:_local=)/python/_*.so* ./local_lib/
%_release: $(SOL)/%
cp $(SOL)/$(@:_release=)/python/*.i Numberjack.0.1.$(DATE)/$(SOL)/$(@:_release=)/python/
cp $(SOL)/$(@:_release=)/python/*.py Numberjack.0.1.$(DATE)/$(SOL)/$(@:_release=)/python/
cp $(SOL)/$(@:_release=)/python/*.cxx Numberjack.0.1.$(DATE)/$(SOL)/$(@:_release=)/python/
uninstall:
python tools/uninstall.py
clean: $(TARGET_CLEAN)
rm -rf local_lib/*
%_clean: $(SOL)/%
@echo $(SOL)/$(@:_clean=)
cd $(SOL)/$(@:_clean=); make clean
clean_swig: $(TARGET_CLEAN_SWIG)
%_clean_swig: $(SOL)/%
@echo $(SOL)/$(@:_clean_swig=)
cd $(SOL)/$(@:_clean_swig=); make clean_swig
cluster: release
scp Numberjack.0.1.$(DATE).zip 4c131:/home/$(ACCOUNT)/
release: Numberjack.0.1.$(DATE).zip
Numberjack.0.1.$(DATE).zip: Numberjack.0.1.$(DATE)/src $(TARGET_RELEASE)
@echo Build archive
#rm -rf Numberjack.0.1.$(DATE)/solvers/scip
#tar -cjf Numberjack.0.1.$(DATE).bz2 Numberjack.0.1.$(DATE)
zip -r Numberjack.0.1.$(DATE).zip Numberjack.0.1.$(DATE)
rm -rf Numberjack.0.1.$(DATE)
Numberjack.0.1.$(DATE)/src: $(SOLVERS) src/Numberjack.py
@echo Export Numberjack version 0.1.$(DATE)
mkdir Numberjack.0.1.$(DATE)
git archive master --format=tar | tar -x -C ./Numberjack.0.1.$(DATE)