update for 2.2.0
[PsN.git] / Makefile
blobf1215e991822bd6f53644ccddcc79d42e94a9fe5
1 DIAGRAMS=llp.dia tool.dia model.dia output.dia data.dia xrsl_file.dia fcon.dia nonmem.dia moshog_client.dia
3 DIAGRAMS=$(addprefix diagrams/,$(DIAGRAMS))
5 BIN=bootstrap cdd execute llp scm
7 HTML_STUBS=_synopsis.php _description.php _options.php _examples.php
9 DOCUMENTS=$(foreach pre,$(BIN),$(foreach suff,$(HTML_STUBS),$(addprefix html/$(pre),$(suff))))
11 DIA2CODE=dia2code
12 FILLSCRIPT=perl ./bin/fill_diacode.pl
13 DIRPM=libgen/
14 DIRSUBS=lib/
15 PERLDIRS=-I/home/pontus/perl
16 LIBFILES=debug.pm \
17 ui.pm \
18 status_bar.pm \
19 nonmem.pm \
20 moshog_client.pm \
21 file.pm \
22 data/individual.pm \
23 data.pm \
24 output/problem/subproblem.pm \
25 output/problem.pm \
26 output.pm \
27 grid/nordugrid/xrsl_file.pm \
28 fcon.pm \
29 table_file.pm \
30 extra_data.pm \
31 model/problem/record/option.pm \
32 model/problem/record/init_option.pm \
33 model/problem/record/theta_option.pm \
34 model/problem/record.pm \
35 model/problem/code_record.pm \
36 model/problem/init_record.pm \
37 model/problem/abbreviated.pm \
38 model/problem/aes.pm \
39 model/problem/aesinit.pm \
40 model/problem/contr.pm \
41 model/problem/covariance.pm \
42 model/problem/data.pm \
43 model/problem/des.pm \
44 model/problem/error.pm \
45 model/problem/estimation.pm \
46 model/problem/infn.pm \
47 model/problem/input.pm \
48 model/problem/msfi.pm \
49 model/problem/mix.pm \
50 model/problem/model.pm \
51 model/problem/nonparametric.pm \
52 model/problem/omega.pm \
53 model/problem/pk.pm \
54 model/problem/problem.pm \
55 model/problem/pred.pm \
56 model/problem/scatter.pm \
57 model/problem/sigma.pm \
58 model/problem/simulation.pm \
59 model/problem/subroutine.pm \
60 model/problem/table.pm \
61 model/problem/theta.pm \
62 model/problem/tol.pm \
63 model/problem.pm \
64 model/shrinkage_module.pm \
65 model/nonparametric_module.pm \
66 model.pm \
67 tool.pm \
68 tool/modelfit.pm \
69 tool/llp.pm \
70 tool/cdd.pm \
71 tool/cdd/jackknife.pm \
72 tool/mc.pm \
73 tool/bootstrap.pm \
74 tool/scm/config_file.pm \
75 tool/scm.pm \
76 tool/xv_step.pm \
77 tool/xv.pm \
79 PERLFILES=$(addprefix lib/,$(LIBFILES))
81 RELFILES=$(addprefix PsN-Source/lib/,$(LIBFILES)) \
82 $(addprefix PsN-Source/, \
83 lib/PsN_template.pm \
84 lib/common_options.pm \
85 lib/psn.conf \
86 lib/OSspecific.pm \
87 lib/hotkey.pm \
88 lib/ext/Math/SigFigs.pm \
89 lib/ext/Math/MatrixReal.pm \
90 lib/ext/Statistics/Distributions.pm \
91 lib/ext/Parallel/ForkManager.pm \
92 lib/ext/Config/Tiny.pm \
93 lib/ext/Color/Output.pm \
94 lib/ext/File/HomeDir.pm \
95 lib/ext/IPC/Run3.pm \
96 lib/matlab/bca.m \
97 lib/matlab/histograms.m \
98 lib/matlab/profiles.m \
99 lib/R-scripts/llp.R \
100 lib/R-scripts/cdd.R \
101 lib/R-scripts/bootstrap.R \
102 bin/execute \
103 bin/cdd \
104 bin/mc_cdd \
105 bin/mcs \
106 bin/llp \
107 bin/scm \
108 bin/bootstrap \
109 bin/sumo \
110 bin/single_valued_columns \
111 bin/check_termination \
112 bin/create_extra_data_model \
113 bin/create_cont_model \
114 bin/create_cont_data \
115 bin/create_subsets \
116 bin/unwrap_data \
117 bin/data_stats \
118 bin/gam42toconf \
119 setup.pl \
120 README.txt )
122 GENFILES=$(addprefix libgen/,$(LIBFILES))
124 all: libgen $(PERLFILES)
126 .PRECIOUS: $(GENFILES)
128 libgen:
129 @ mkdir -p libgen
131 lib/%.pm: libgen/%.pm lib/%_subs.pm
132 @ cp libgen/$*.pm libgen/$*_temp.pm
133 @ $(FILLSCRIPT) libgen/$*_temp.pm lib/$*_subs.pm
134 @ cp libgen/$*_temp.pm $@
135 @ perl $(PERLDIRS) -I./$(@D) -I./lib -c $@ -W -t -T|| (rm $@ && false)
137 .PHONY : clean
139 clean:
140 @-rm -rf $(PERLFILES) $(DOCUMENTS) libgen PsN-Source
142 libgen/debug.pm : diagrams/debug.dia
143 $(DIA2CODE) -t perl -d $(DIRPM) diagrams/debug.dia
145 libgen/ui.pm : diagrams/ui.dia
146 $(DIA2CODE) -t perl -d $(DIRPM) diagrams/ui.dia
148 libgen/status_bar.pm : diagrams/status_bar.dia
149 $(DIA2CODE) -t perl -d $(DIRPM) diagrams/status_bar.dia
151 libgen/nonmem.pm : diagrams/nonmem.dia
152 $(DIA2CODE) -t perl -d $(DIRPM) diagrams/nonmem.dia
154 libgen/moshog_client.pm : diagrams/moshog_client.dia
155 $(DIA2CODE) -t perl -d $(DIRPM) diagrams/moshog_client.dia
157 libgen/file.pm : diagrams/file.dia
158 $(DIA2CODE) -t perl -d $(DIRPM) diagrams/file.dia
160 libgen/tool/modelfit.pm : diagrams/modelfit.dia
161 $(DIA2CODE) -t perl -d $(DIRPM) diagrams/modelfit.dia
163 libgen/tool/llp.pm : diagrams/llp.dia
164 $(DIA2CODE) -t perl -d $(DIRPM) diagrams/llp.dia
166 libgen/tool/cdd/jackknife.pm libgen/tool/cdd.pm : diagrams/cdd.dia
167 $(DIA2CODE) -t perl -d $(DIRPM) diagrams/cdd.dia
169 libgen/tool/mc.pm : diagrams/mc.dia
170 $(DIA2CODE) -t perl -d $(DIRPM) diagrams/mc.dia
172 libgen/tool/bootstrap.pm : diagrams/bootstrap.dia
173 $(DIA2CODE) -t perl -d $(DIRPM) diagrams/bootstrap.dia
175 libgen/tool/scm/config_file.pm libgen/tool/scm.pm : diagrams/scm.dia
176 $(DIA2CODE) -t perl -d $(DIRPM) diagrams/scm.dia
178 libgen/tool/xv_step.pm libgen/tool/xv.pm : diagrams/xv.dia
179 $(DIA2CODE) -t perl -d $(DIRPM) diagrams/xv.dia
181 libgen/tool.pm : diagrams/tool.dia
182 $(DIA2CODE) -t perl -d $(DIRPM) diagrams/tool.dia
184 libgen/table_file.pm libgen/extra_data.pm libgen/model%.pm : diagrams/model.dia
185 $(DIA2CODE) -t perl -d $(DIRPM) diagrams/model.dia
187 libgen/output%.pm : diagrams/output.dia
188 $(DIA2CODE) -t perl -d $(DIRPM) diagrams/output.dia
190 libgen/data%.pm : diagrams/data.dia
191 $(DIA2CODE) -t perl -d $(DIRPM) diagrams/data.dia
193 libgen/grid/nordugrid/xrsl_file.pm : diagrams/xrsl_file.dia
194 $(DIA2CODE) -t perl -d $(DIRPM) diagrams/xrsl_file.dia
196 libgen/fcon.pm : diagrams/fcon.dia
197 $(DIA2CODE) -nd -t perl -d $(DIRPM) diagrams/fcon.dia
199 documents: $(DOCUMENTS)
201 $(addprefix html/bootstrap,$(HTML_STUBS)) : bin/bootstrap lib/common_options.pm
202 $< --help --html
204 $(addprefix html/cdd,$(HTML_STUBS)) : bin/cdd lib/common_options.pm
205 $< --help --html
207 $(addprefix html/execute,$(HTML_STUBS)) : bin/execute lib/common_options.pm
208 $< --help --html
210 $(addprefix html/llp,$(HTML_STUBS)) : bin/llp lib/common_options.pm
211 $< --help --html
213 $(addprefix html/scm,$(HTML_STUBS)) : bin/scm lib/common_options.pm
214 $< --help --html
217 release: libgen rel_dir $(RELFILES) documents
218 @ cp -ar modules/Math-Random \
219 modules/Math-Random-Win \
220 modules/Storable PsN-Source/modules
221 @ zip -r PsN-Source PsN-Source/
222 @ tar czf PsN-Source.tar.gz PsN-Source/
224 PsN-Source/setup.pl: bin/setup.pl
225 @ cp bin/setup.pl $@
227 PsN-Source/lib/matlab/% : matlab/%
228 @ cp matlab/$* $@
230 PsN-Source/lib/R-scripts/% : matlab/%
231 @ cp R-scripts/$* $@
233 PsN-Source/%: %
234 @ cp -ar $* $@
236 rel_dir:
237 @mkdir -p $(sort $(dir $(RELFILES))) PsN-Source/modules