Makefile.am 5.55 KB
Newer Older
Guillaume Lazzara's avatar
Guillaume Lazzara committed
1
2
3
4
## Process this file through Automake to create Makefile.in -*- Makefile -*-

include $(top_srcdir)/milena/doc/doc.mk

5
noinst_PROGRAMS =		\
Guillaume Lazzara's avatar
Guillaume Lazzara committed
6
  accu-right-instanciation 	\
Guillaume Lazzara's avatar
Guillaume Lazzara committed
7
  borderthickness 		\
Guillaume Lazzara's avatar
Guillaume Lazzara committed
8
9
  box2d-bbox 			\
  domain-display 		\
Guillaume Lazzara's avatar
Guillaume Lazzara committed
10
  dpoint-1 			\
Guillaume Lazzara's avatar
Guillaume Lazzara committed
11
  estim-sites 			\
Guillaume Lazzara's avatar
Guillaume Lazzara committed
12
  extend 			\
Guillaume Lazzara's avatar
Guillaume Lazzara committed
13
14
15
16
17
18
19
20
21
22
23
  extension-ignore 		\
  fill 				\
  fill-call-1			\
  fill-part-image 		\
  fill-subdomain 		\
  fill-subdomain-shorter	\
  fill-subimage-cfun 		\
  forall-piter  		\
  fun-p2v-1 			\
  graph-data 			\
  graph-iter 			\
Guillaume Lazzara's avatar
Guillaume Lazzara committed
24
  ima-has 			\
Guillaume Lazzara's avatar
Guillaume Lazzara committed
25
  ima-save 			\
Guillaume Lazzara's avatar
Guillaume Lazzara committed
26
27
  ima-size 			\
  ima2d-1 			\
Guillaume Lazzara's avatar
Guillaume Lazzara committed
28
29
30
31
32
33
  ima2d-2 			\
  ima2d-3 			\
  ima2d-4 			\
  ima2d-5 			\
  ima2d-6-clone			\
  ima2d-7 			\
Guillaume Lazzara's avatar
Guillaume Lazzara committed
34
  ima2d-rot 			\
Guillaume Lazzara's avatar
Guillaume Lazzara committed
35
36
  ima-size 			\
  labeling-compute 		\
Guillaume Lazzara's avatar
Guillaume Lazzara committed
37
  logical-not 			\
Guillaume Lazzara's avatar
Guillaume Lazzara committed
38
39
40
  mln_var 			\
  parray-bbox 			\
  paste 			\
Guillaume Lazzara's avatar
Guillaume Lazzara committed
41
  paste-call-1 			\
Guillaume Lazzara's avatar
Guillaume Lazzara committed
42
43
44
45
46
  parray-append 		\
  point-1 			\
  predicate-1 			\
  win-create-1 			\
  win-create-2
Guillaume Lazzara's avatar
Guillaume Lazzara committed
47

Guillaume Lazzara's avatar
Guillaume Lazzara committed
48
49
50
51
noinst_PROGRAMS += 		\
tuto2_first_image 		\
tuto3_rw_image 			\
tuto4_genericity_and_algorithms
Guillaume Lazzara's avatar
Guillaume Lazzara committed
52

Guillaume Lazzara's avatar
Guillaume Lazzara committed
53
accu_right_instanciation_SOURCES = accu-right-instanciation.cc
Guillaume Lazzara's avatar
Guillaume Lazzara committed
54
borderthickness_SOURCES = borderthickness.cc
Guillaume Lazzara's avatar
Guillaume Lazzara committed
55
56
box2d_bbox_SOURCES = box2d-bbox.cc
domain_display_SOURCES = domain-display.cc
Guillaume Lazzara's avatar
Guillaume Lazzara committed
57
dpoint_1_SOURCES = dpoint-1.cc
Guillaume Lazzara's avatar
Guillaume Lazzara committed
58
estim_sites_SOURCES = estim-sites.cc
Guillaume Lazzara's avatar
Guillaume Lazzara committed
59
extend_SOURCES = extend.cc
Guillaume Lazzara's avatar
Guillaume Lazzara committed
60
61
62
63
64
65
66
67
68
69
70
extension_ignore_SOURCES = extension-ignore.cc
fill_SOURCES = fill.cc
fill_call_1_SOURCES = fill-call-1.cc
fill_part_image_SOURCES = fill-part-image.cc
fill_subdomain_SOURCES = fill-subdomain.cc
fill_subdomain_shorter_SOURCES = fill-subdomain-shorter.cc
fill_subimage_cfun_SOURCES = fill-subimage-cfun.cc
forall_piter_SOURCES = forall-piter.cc
fun_p2v_1_SOURCES = fun-p2v-1.cc
graph_data_SOURCES = graph-data.cc
graph_iter_SOURCES = graph-iter.cc
Guillaume Lazzara's avatar
Guillaume Lazzara committed
71
ima_has_SOURCES = ima-has.cc
Guillaume Lazzara's avatar
Guillaume Lazzara committed
72
ima_save_SOURCES = ima-save.cc
Guillaume Lazzara's avatar
Guillaume Lazzara committed
73
74
ima_size_SOURCES = ima-size.cc
ima2d_1_SOURCES = ima2d-1.cc
Guillaume Lazzara's avatar
Guillaume Lazzara committed
75
76
77
78
79
80
ima2d_2_SOURCES = ima2d-2.cc
ima2d_3_SOURCES = ima2d-3.cc
ima2d_4_SOURCES = ima2d-4.cc
ima2d_5_SOURCES = ima2d-5.cc
ima2d_6_clone_SOURCES = ima2d-6-clone.cc
ima2d_7_SOURCES = ima2d-7.cc
Guillaume Lazzara's avatar
Guillaume Lazzara committed
81
ima2d_rot_SOURCES = ima2d-rot.cc
Guillaume Lazzara's avatar
Guillaume Lazzara committed
82
labeling_compute_SOURCES = labeling-compute.cc
Guillaume Lazzara's avatar
Guillaume Lazzara committed
83
logical_not_SOURCES = logical-not.cc
Guillaume Lazzara's avatar
Guillaume Lazzara committed
84
85
mln_var_SOURCES = mln_var.cc
paste_SOURCES = paste.cc
Guillaume Lazzara's avatar
Guillaume Lazzara committed
86
paste_call_1_SOURCES = paste-call-1.cc
Guillaume Lazzara's avatar
Guillaume Lazzara committed
87
88
parray_append_SOURCES = parray-append.cc
parray_bbox_SOURCES = parray-bbox.cc
Guillaume Lazzara's avatar
Guillaume Lazzara committed
89
point_1_SOURCES = point-1.cc
Guillaume Lazzara's avatar
Guillaume Lazzara committed
90
91
92
predicate_1_SOURCES = predicate-1.cc
win_create_1_SOURCES = win-create-1.cc
win_create_2_SOURCES = win-create-2.cc
Guillaume Lazzara's avatar
Guillaume Lazzara committed
93

Guillaume Lazzara's avatar
Guillaume Lazzara committed
94
tuto2_first_image_SOURCES = tuto2_first_image.cc
Guillaume Lazzara's avatar
Guillaume Lazzara committed
95
tuto3_rw_image_SOURCES = tuto3_rw_image.cc
Guillaume Lazzara's avatar
Guillaume Lazzara committed
96
tuto4_genericity_and_algorithms_SOURCES = tuto4_genericity_and_algorithms.cc
Guillaume Lazzara's avatar
Guillaume Lazzara committed
97

Guillaume Lazzara's avatar
Guillaume Lazzara committed
98
all: clean-figures 
99
100
	mkdir -p $(OUTPUTS_BUILDDIR) 
	mkdir -p $(FIGURES_BUILDDIR) 
Guillaume Lazzara's avatar
Guillaume Lazzara committed
101
102
103


run-samples: all
104
	@failcom='exit 1'; 						\
105
	list='$(noinst_PROGRAMS)'; for bin in $$list; do 		\
106
107
	  echo "Running $$bin"; 					\
	  ./$$bin > $(OUTPUTS_BUILDDIR)/$$bin.txt || eval $$failcom; 	\
Guillaume Lazzara's avatar
Guillaume Lazzara committed
108
109
110
111
112
113
114
115
	done


data: run-samples diff-data split-samples split-outputs 


diff-data:
	@failcom='exit 1'; 						\
116
 	has_txt_diff="";						\
Guillaume Lazzara's avatar
Guillaume Lazzara committed
117
 	txtlist="$(OUTPUTS_BUILDDIR)/*.txt"; for txt in $$txtlist; do 	\
118
119
120
121
122
123
124
125
 	  echo "Diff `basename $$txt`";					\
 	  diff $$txt $(OUTPUTS_SRCDIR)/`basename $$txt` >/dev/null 2>&1	\
 		|| has_txt_diff+=" `basename $$txt`";	\
 	done;								\
 	has_fig_diff="";						\
 	figlist="$(FIGURES_BUILDDIR)/*"; for fig in $$figlist; do 	\
 	  echo "Diff `basename $$fig`";					\
 	  diff $$fig $(FIGURES_SRCDIR)/`basename $$fig` >/dev/null 2>&1 \
Guillaume Lazzara's avatar
Guillaume Lazzara committed
126
 		|| has_fig_diff+=" `basename $$fig`";	\
127
128
129
130
131
132
133
134
135
136
137
138
 	done; 								\
	(test -z "$$has_txt_diff" && test -z "$$has_fig_diff")		\
	 || (echo "--------";						\
	     echo "ERROR: please check if the tutorial needs an update.";\
	     echo "       The following files differ from their \
reference or their reference file does not exist:";  			\
	     echo "--------"; 						\
  	     echo "* Outputs:";						\
  	     echo "";							\
  	     echo "$$has_txt_diff"; 					\
  	     echo "";							\
	     echo "--------"; 						\
Guillaume Lazzara's avatar
Guillaume Lazzara committed
139
  	     echo "* Figures:"; 					\
140
141
142
143
  	     echo "";							\
  	     echo "$$has_fig_diff"; 					\
  	     echo "";							\
	     echo "--------"; 						\
Guillaume Lazzara's avatar
Guillaume Lazzara committed
144
145
146
147
148
149
150
151
  	     echo "* Please update manually the reference files located \
in:";									\
  	     echo "";							\
	     echo " $(OUTPUTS_SRCDIR)"; 				\
	     echo " $(FIGURES_SRCDIR)"; 				\
  	     echo "";							\
	     echo "* Reference files can updated automatically with \
'make fix-refdata'"; 							\
152
153
154
155
  	     echo "";							\
  	     echo "";							\
  	     eval $$failcom);

Guillaume Lazzara's avatar
Guillaume Lazzara committed
156

Guillaume Lazzara's avatar
Guillaume Lazzara committed
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
fix-refdata:
	@failcom='exit 1'; 						\
 	txtlist="$(OUTPUTS_BUILDDIR)/*.txt"; for txt in $$txtlist; do 	\
 	  diff $$txt $(OUTPUTS_SRCDIR)/`basename $$txt` >/dev/null 2>&1	\
 		|| echo "Updating reference file for $$txt"; 		\
		   cp $$txt $(OUTPUTS_SRCDIR);				\
 	done;								\
 	figlist="$(FIGURES_BUILDDIR)/*.p*m"; for fig in $$figlist; do 	\
 	  diff $$fig $(FIGURES_SRCDIR)/`basename $$fig` >/dev/null 2>&1 \
 		|| echo "Updating reference file for $$fig";		\
		   cp $$fig $(FIGURES_SRCDIR);				\
 	done; 								


split-samples:
Guillaume Lazzara's avatar
Guillaume Lazzara committed
172
	mkdir -p $(EXAMPLES_BUILDDIR)
Guillaume Lazzara's avatar
Guillaume Lazzara committed
173
	@failcom='exit 1'; 						\
Guillaume Lazzara's avatar
Guillaume Lazzara committed
174
175
	list='$(EXAMPLES_SRCDIR)/*.cc'; for file in $$list; do 		\
	$(DOC_SRCDIR)/tools/split_sample.sh $$file cc $(EXAMPLES_BUILDDIR)\
Guillaume Lazzara's avatar
Guillaume Lazzara committed
176
177
178
179
180
181
182
					      || eval $$failcom; 	\
	done

split-outputs:
	mkdir -p $(SPLITTED_OUTPUTS_BUILDDIR)
	@failcom='exit 1'; 						\
	list='$(OUTPUTS_BUILDDIR)/*.txt'; for file in $$list; do 	\
Guillaume Lazzara's avatar
Guillaume Lazzara committed
183
	$(DOC_SRCDIR)/tools/split_sample.sh $$file txt $(SPLITTED_OUTPUTS_BUILDDIR)\
Guillaume Lazzara's avatar
Guillaume Lazzara committed
184
185
186
187
188
189
					      || eval $$failcom; 	\
	done


clean-local: clean-figures
	rm -Rf $(OUTPUTS_BUILDDIR)
Guillaume Lazzara's avatar
Guillaume Lazzara committed
190
	rm -f $(EXAMPLES_BUILDDIR)/*.cc
Guillaume Lazzara's avatar
Guillaume Lazzara committed
191

Guillaume Lazzara's avatar
Guillaume Lazzara committed
192
193
clean-figures:
	rm -Rf $(FIGURES_BUILDDIR)