functionalized version 2, implemented version 1 using functions in version 2
[PsN.git] / Makefile
blob9217dfa42a76c008a03c34abd075d063247bd17e
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/prior.pm \
55 model/problem/problem.pm \
56 model/problem/pred.pm \
57 model/problem/scatter.pm \
58 model/problem/sigma.pm \
59 model/problem/simulation.pm \
60 model/problem/subroutine.pm \
61 model/problem/table.pm \
62 model/problem/theta.pm \
63 model/problem/tol.pm \
64 model/cwres_module.pm \
65 model/mirror_plot_module.pm \
66 model/iofv_module.pm \
67 model/shrinkage_module.pm \
68 model/nonparametric_module.pm \
69 model/problem.pm \
70 model.pm \
71 tool.pm \
72 tool/modelfit.pm \
73 tool/llp.pm \
74 tool/cdd.pm \
75 tool/cdd/jackknife.pm \
76 tool/sse.pm \
77 tool/npc.pm \
78 tool/pind.pm \
79 tool/nonpb.pm \
80 tool/bootstrap.pm \
81 tool/scm/config_file.pm \
82 tool/scm.pm \
83 tool/xv_step.pm \
84 tool/xv.pm \
86 PERLFILES=$(addprefix lib/,$(LIBFILES))
88 RELFILES=$(addprefix PsN-Source/lib/,$(LIBFILES)) \
89 $(addprefix PsN-Source/, \
90 lib/PsN_template.pm \
91 lib/common_options.pm \
92 lib/psn.conf \
93 lib/OSspecific.pm \
94 lib/hotkey.pm \
95 lib/ext/Math/SigFigs.pm \
96 lib/ext/Math/MatrixReal.pm \
97 lib/ext/Statistics/Distributions.pm \
98 lib/ext/Parallel/ForkManager.pm \
99 lib/ext/Config/Tiny.pm \
100 lib/ext/Color/Output.pm \
101 lib/ext/File/HomeDir.pm \
102 lib/ext/IPC/Run3.pm \
103 lib/matlab/bca.m \
104 lib/matlab/histograms.m \
105 lib/matlab/profiles.m \
106 lib/R-scripts/llp.R \
107 lib/R-scripts/cdd.R \
108 lib/R-scripts/bootstrap.R \
109 bin/execute \
110 bin/cdd \
111 bin/mc_cdd \
112 bin/sse \
113 bin/pind \
114 bin/nonpb \
115 bin/npc \
116 bin/vpc \
117 bin/llp \
118 bin/scm \
119 bin/bootstrap \
120 bin/sumo \
121 bin/single_valued_columns \
122 bin/check_termination \
123 bin/create_extra_data_model \
124 bin/create_cont_model \
125 bin/create_cont_data \
126 bin/create_subsets \
127 bin/unwrap_data \
128 bin/data_stats \
129 bin/gam42toconf \
130 bin/se_of_eta \
131 bin/update_inits \
132 doc/SSE_userguide.pdf \
133 doc/NPC_VPC_userguide.pdf \
134 setup.pl \
135 README.txt )
137 GENFILES=$(addprefix libgen/,$(LIBFILES))
139 all: libgen $(PERLFILES)
141 .PRECIOUS: $(GENFILES)
143 libgen:
144 @ mkdir -p libgen
146 lib/%.pm: libgen/%.pm lib/%_subs.pm
147 @ cp libgen/$*.pm libgen/$*_temp.pm
148 @ $(FILLSCRIPT) libgen/$*_temp.pm lib/$*_subs.pm
149 @ cp libgen/$*_temp.pm $@
150 @ perl $(PERLDIRS) -I./$(@D) -I./lib -c $@ -W -t -T|| (rm $@ && false)
152 .PHONY : clean
154 clean:
155 @-rm -rf $(PERLFILES) $(DOCUMENTS) libgen PsN-Source
157 libgen/debug.pm : diagrams/debug.dia
158 $(DIA2CODE) -t perl -d $(DIRPM) diagrams/debug.dia
160 libgen/ui.pm : diagrams/ui.dia
161 $(DIA2CODE) -t perl -d $(DIRPM) diagrams/ui.dia
163 libgen/status_bar.pm : diagrams/status_bar.dia
164 $(DIA2CODE) -t perl -d $(DIRPM) diagrams/status_bar.dia
166 libgen/nonmem.pm : diagrams/nonmem.dia
167 $(DIA2CODE) -t perl -d $(DIRPM) diagrams/nonmem.dia
169 libgen/moshog_client.pm : diagrams/moshog_client.dia
170 $(DIA2CODE) -t perl -d $(DIRPM) diagrams/moshog_client.dia
172 libgen/file.pm : diagrams/file.dia
173 $(DIA2CODE) -t perl -d $(DIRPM) diagrams/file.dia
175 libgen/tool/modelfit.pm : diagrams/modelfit.dia
176 $(DIA2CODE) -t perl -d $(DIRPM) diagrams/modelfit.dia
178 libgen/tool/llp.pm : diagrams/llp.dia
179 $(DIA2CODE) -t perl -d $(DIRPM) diagrams/llp.dia
181 libgen/tool/cdd/jackknife.pm libgen/tool/cdd.pm : diagrams/cdd.dia
182 $(DIA2CODE) -t perl -d $(DIRPM) diagrams/cdd.dia
184 libgen/tool/sse.pm : diagrams/sse.dia
185 $(DIA2CODE) -t perl -d $(DIRPM) diagrams/sse.dia
187 libgen/tool/npc.pm : diagrams/npc.dia
188 $(DIA2CODE) -t perl -d $(DIRPM) diagrams/npc.dia
190 libgen/tool/pind.pm : diagrams/pind.dia
191 $(DIA2CODE) -t perl -d $(DIRPM) diagrams/pind.dia
193 libgen/tool/nonpb.pm : diagrams/nonpb.dia
194 $(DIA2CODE) -t perl -d $(DIRPM) diagrams/nonpb.dia
196 libgen/tool/bootstrap.pm : diagrams/bootstrap.dia
197 $(DIA2CODE) -t perl -d $(DIRPM) diagrams/bootstrap.dia
199 libgen/tool/scm/config_file.pm libgen/tool/scm.pm : diagrams/scm.dia
200 $(DIA2CODE) -t perl -d $(DIRPM) diagrams/scm.dia
202 libgen/tool/xv_step.pm libgen/tool/xv.pm : diagrams/xv.dia
203 $(DIA2CODE) -t perl -d $(DIRPM) diagrams/xv.dia
205 libgen/tool.pm : diagrams/tool.dia
206 $(DIA2CODE) -t perl -d $(DIRPM) diagrams/tool.dia
208 libgen/table_file.pm libgen/extra_data.pm libgen/model%.pm : diagrams/model.dia
209 $(DIA2CODE) -t perl -d $(DIRPM) diagrams/model.dia
211 libgen/output%.pm : diagrams/output.dia
212 $(DIA2CODE) -t perl -d $(DIRPM) diagrams/output.dia
214 libgen/data%.pm : diagrams/data.dia
215 $(DIA2CODE) -t perl -d $(DIRPM) diagrams/data.dia
217 libgen/grid/nordugrid/xrsl_file.pm : diagrams/xrsl_file.dia
218 $(DIA2CODE) -t perl -d $(DIRPM) diagrams/xrsl_file.dia
220 libgen/fcon.pm : diagrams/fcon.dia
221 $(DIA2CODE) -nd -t perl -d $(DIRPM) diagrams/fcon.dia
223 documents: $(DOCUMENTS)
225 $(addprefix html/bootstrap,$(HTML_STUBS)) : bin/bootstrap lib/common_options.pm
226 perl $< --help --html
228 $(addprefix html/cdd,$(HTML_STUBS)) : bin/cdd lib/common_options.pm
229 perl $< --help --html
231 $(addprefix html/execute,$(HTML_STUBS)) : bin/execute lib/common_options.pm
232 perl $< --help --html
234 $(addprefix html/llp,$(HTML_STUBS)) : bin/llp lib/common_options.pm
235 perl $< --help --html
237 $(addprefix html/scm,$(HTML_STUBS)) : bin/scm lib/common_options.pm
238 perl $< --help --html
241 release: libgen rel_dir $(RELFILES) documents
242 @ cp -ar modules/Math-Random \
243 modules/Math-Random-Win \
244 modules/Storable PsN-Source/modules
245 @ zip -r PsN-Source PsN-Source/
246 @ tar czf PsN-Source.tar.gz PsN-Source/
248 PsN-Source/setup.pl: bin/setup.pl
249 @ cp bin/setup.pl $@
251 PsN-Source/lib/matlab/% : matlab/%
252 @ cp matlab/$* $@
254 PsN-Source/lib/R-scripts/% : R-scripts/%
255 @ cp R-scripts/$* $@
257 PsN-Source/%: %
258 @ cp -ar $* $@
260 rel_dir:
261 @mkdir -p $(sort $(dir $(RELFILES))) PsN-Source/modules