-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
119 lines (87 loc) · 2.1 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
### nlytiq base tool build
###
## build environment configuration
include config/base.config
## package options
include config/options.config
### list of all supported packages
compiler = llvm
prereqs = perl5 perl5mods rust
locallibs= openblas
base = gnuplot python
environs = julia octave R
misc = maxima jupyter_kernels spark
# package construction
all_packages = ${compiler} ${prereqs} ${locallibs} ${base} ${environs} ${misc}
packages =
#Linux
ifeq (${OS},Linux)
ifeq (${CLANG},1)
packages+=${compiler}
endif
packages+=${prereqs}
ifeq (${LOCALLIBS},1)
packages+=${locallibs}
endif
packages+=${base}
ifeq (${ENVIRONS},1)
packages+=${environs}
endif
ifeq (${MISC},1)
packages+=${misc}
endif
endif
# MacOSX
ifeq (${OS},Darwin)
ifeq (${CLANG},1)
packages+=${compiler}
endif
packages+=${prereqs}
ifeq (${LOCALLIBS},1)
packages+=${locallibs}
endif
packages+=${base}
ifeq (${ENVIRONS},1)
packages+=${environs}
endif
ifeq (${MISC},1)
packages+=${misc}
endif
endif
### each package has its own Makefile. This Makefile drives complilation
### with a default target of all. Each Makefile also has a clean target
### You can make them as simple/complex as you wish, as long as the above
### boundaries (all, clean) are respected, and are working ... such that
###
### make -f Makefile.$package
###
### will generate a newly installed package, and
###
### make -f Makefile.$package clean
###
### will clean up the build
### The below are the mechanisms used to create build targets, completed
### build targets, and clean up.
###
build = $(addsuffix .build,$(packages))
complete = $(addsuffix .complete,$(packages))
all: $(build) $(complete)
### generate the .build files
$(build):
for p in $(packages) ; do \
touch $$p.build ; \
done
ifeq ($(OS), Darwin)
# bad bad Apple. Bad Apple.
touch R.build R.complete octave.build octave.complete
# sigh ...
endif
%.complete: %.build
mkdir -p ${NLYTIQ_INST_PATH}
$(MAKECMD) -f Makefile.$*
touch $*.complete
clean:
for p in $(all_packages) ; do \
$(MAKECMD) -f Makefile.$$p clean ; \
rm -f $$p.build $$p.packages $$p.complete ; \
done