OSDN Git Service

gcc/fortran/
[pf3gnuchains/gcc-fork.git] / libgfortran / Makefile.am
1 ## Process this file with automake to produce Makefile.in
2
3 ## We like to use C99 routines when available.  This makes sure that
4 ## __STDC_VERSION__ is set such that libc includes make them available.
5 AM_CFLAGS = -std=gnu99
6 ACLOCAL_AMFLAGS = -I ../config
7
8 ## May be used by toolexeclibdir.
9 gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
10
11 toolexeclib_LTLIBRARIES = libgfortran.la libgfortranbegin.la
12
13 libgfortran_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` -lm $(extra_ldflags_libgfortran)
14
15 ## This should really go in the compiler lib dir, not the system lib dir.
16 libgfortranbegin_la_SOURCES = fmain.c
17 libgfortranbegin_la_LDFLAGS = -static
18
19 ## io.h conflicts with some a system header on some platforms, so
20 ## use -iquote
21 AM_CPPFLAGS = -iquote$(srcdir)/io
22
23 libgfortranincludedir = $(includedir)/gforio
24
25 gfor_io_src= \
26 io/backspace.c \
27 io/close.c \
28 io/endfile.c \
29 io/format.c \
30 io/inquire.c \
31 io/list_read.c \
32 io/lock.c \
33 io/open.c \
34 io/read.c \
35 io/rewind.c \
36 io/transfer.c \
37 io/unit.c \
38 io/unix.c \
39 io/write.c
40
41 gfor_io_headers= \
42 io/io.h
43
44 gfor_helper_src= \
45 intrinsics/associated.c \
46 intrinsics/abort.c \
47 intrinsics/args.c \
48 intrinsics/bessel.c \
49 intrinsics/c99_functions.c \
50 intrinsics/chdir.c \
51 intrinsics/cpu_time.c \
52 intrinsics/cshift0.c \
53 intrinsics/date_and_time.c \
54 intrinsics/env.c \
55 intrinsics/erf.c \
56 intrinsics/eoshift0.c \
57 intrinsics/eoshift2.c \
58 intrinsics/etime.c \
59 intrinsics/exit.c \
60 intrinsics/flush.c \
61 intrinsics/fnum.c \
62 intrinsics/gerror.c \
63 intrinsics/getcwd.c \
64 intrinsics/getlog.c \
65 intrinsics/getXid.c \
66 intrinsics/hostnm.c \
67 intrinsics/kill.c \
68 intrinsics/ierrno.c \
69 intrinsics/ishftc.c \
70 intrinsics/link.c \
71 intrinsics/mvbits.c \
72 intrinsics/pack_generic.c \
73 intrinsics/perror.c \
74 intrinsics/size.c \
75 intrinsics/sleep.c \
76 intrinsics/spread_generic.c \
77 intrinsics/string_intrinsics.c \
78 intrinsics/system.c \
79 intrinsics/rand.c \
80 intrinsics/random.c \
81 intrinsics/rename.c \
82 intrinsics/reshape_generic.c \
83 intrinsics/reshape_packed.c \
84 intrinsics/selected_int_kind.f90 \
85 intrinsics/selected_real_kind.f90 \
86 intrinsics/stat.c \
87 intrinsics/symlnk.c \
88 intrinsics/system_clock.c \
89 intrinsics/time.c \
90 intrinsics/transpose_generic.c \
91 intrinsics/umask.c \
92 intrinsics/unlink.c \
93 intrinsics/unpack_generic.c \
94 runtime/in_pack_generic.c \
95 runtime/in_unpack_generic.c \
96 runtime/normalize.c
97
98 gfor_src= \
99 runtime/environ.c \
100 runtime/error.c \
101 runtime/main.c \
102 runtime/memory.c \
103 runtime/pause.c \
104 runtime/stop.c \
105 runtime/string.c \
106 runtime/select.c \
107 gfortypes.h \
108 libgfortran.h
109
110 i_all_c= \
111 generated/all_l4.c \
112 generated/all_l8.c
113
114 i_any_c= \
115 generated/any_l4.c \
116 generated/any_l8.c
117
118 i_count_c= \
119 generated/count_4_l4.c \
120 generated/count_8_l4.c \
121 generated/count_4_l8.c \
122 generated/count_8_l8.c
123
124 i_maxloc0_c= \
125 generated/maxloc0_4_i4.c \
126 generated/maxloc0_8_i4.c \
127 generated/maxloc0_4_i8.c \
128 generated/maxloc0_8_i8.c \
129 generated/maxloc0_4_r4.c \
130 generated/maxloc0_8_r4.c \
131 generated/maxloc0_4_r8.c \
132 generated/maxloc0_8_r8.c
133
134 i_maxloc1_c= \
135 generated/maxloc1_4_i4.c \
136 generated/maxloc1_8_i4.c \
137 generated/maxloc1_4_i8.c \
138 generated/maxloc1_8_i8.c \
139 generated/maxloc1_4_r4.c \
140 generated/maxloc1_8_r4.c \
141 generated/maxloc1_4_r8.c \
142 generated/maxloc1_8_r8.c
143
144 i_maxval_c= \
145 generated/maxval_i4.c \
146 generated/maxval_i8.c \
147 generated/maxval_r4.c \
148 generated/maxval_r8.c
149
150 i_minloc0_c= \
151 generated/minloc0_4_i4.c \
152 generated/minloc0_8_i4.c \
153 generated/minloc0_4_i8.c \
154 generated/minloc0_8_i8.c \
155 generated/minloc0_4_r4.c \
156 generated/minloc0_8_r4.c \
157 generated/minloc0_4_r8.c \
158 generated/minloc0_8_r8.c
159
160 i_minloc1_c= \
161 generated/minloc1_4_i4.c \
162 generated/minloc1_8_i4.c \
163 generated/minloc1_4_i8.c \
164 generated/minloc1_8_i8.c \
165 generated/minloc1_4_r4.c \
166 generated/minloc1_8_r4.c \
167 generated/minloc1_4_r8.c \
168 generated/minloc1_8_r8.c
169
170 i_minval_c= \
171 generated/minval_i4.c \
172 generated/minval_i8.c \
173 generated/minval_r4.c \
174 generated/minval_r8.c
175
176 i_sum_c= \
177 generated/sum_i4.c \
178 generated/sum_i8.c \
179 generated/sum_r4.c \
180 generated/sum_r8.c \
181 generated/sum_c4.c \
182 generated/sum_c8.c
183
184 i_product_c= \
185 generated/product_i4.c \
186 generated/product_i8.c \
187 generated/product_r4.c \
188 generated/product_r8.c \
189 generated/product_c4.c \
190 generated/product_c8.c
191
192 i_dotprod_c= \
193 generated/dotprod_i4.c \
194 generated/dotprod_i8.c \
195 generated/dotprod_r4.c \
196 generated/dotprod_r8.c 
197
198 i_dotprodl_c= \
199 generated/dotprod_l4.c \
200 generated/dotprod_l8.c
201
202 i_dotprodc_c= \
203 generated/dotprod_c4.c \
204 generated/dotprod_c8.c
205
206 i_matmul_c= \
207 generated/matmul_i4.c \
208 generated/matmul_i8.c \
209 generated/matmul_r4.c \
210 generated/matmul_r8.c \
211 generated/matmul_c4.c \
212 generated/matmul_c8.c
213
214 i_matmull_c= \
215 generated/matmul_l4.c \
216 generated/matmul_l8.c
217
218 i_transpose_c= \
219 generated/transpose_i4.c \
220 generated/transpose_i8.c \
221 generated/transpose_c4.c \
222 generated/transpose_c8.c
223
224 i_shape_c= \
225 generated/shape_i4.c \
226 generated/shape_i8.c
227
228 i_reshape_c= \
229 generated/reshape_i4.c \
230 generated/reshape_i8.c
231
232 i_eoshift1_c= \
233 generated/eoshift1_4.c \
234 generated/eoshift1_8.c
235
236 i_eoshift3_c= \
237 generated/eoshift3_4.c \
238 generated/eoshift3_8.c
239
240 i_cshift1_c= \
241 generated/cshift1_4.c \
242 generated/cshift1_8.c
243
244 in_pack_c = \
245 generated/in_pack_i4.c \
246 generated/in_pack_i8.c
247
248 in_unpack_c = \
249 generated/in_unpack_i4.c \
250 generated/in_unpack_i8.c
251
252 i_exponent_c = \
253 generated/exponent_r4.c \
254 generated/exponent_r8.c
255
256 i_fraction_c = \
257 generated/fraction_r4.c \
258 generated/fraction_r8.c
259
260 i_nearest_c = \
261 generated/nearest_r4.c \
262 generated/nearest_r8.c
263
264 i_set_exponent_c = \
265 generated/set_exponent_r4.c \
266 generated/set_exponent_r8.c
267
268 i_pow_c = \
269 generated/pow_i4_i4.c \
270 generated/pow_i8_i4.c \
271 generated/pow_r4_i4.c \
272 generated/pow_r8_i4.c \
273 generated/pow_c4_i4.c \
274 generated/pow_c8_i4.c \
275 generated/pow_i4_i8.c \
276 generated/pow_i8_i8.c \
277 generated/pow_r4_i8.c \
278 generated/pow_r8_i8.c \
279 generated/pow_c4_i8.c \
280 generated/pow_c8_i8.c
281
282 m4_files= m4/iparm.m4 m4/ifunction.m4 m4/iforeach.m4 m4/all.m4 \
283     m4/any.m4 m4/count.m4 m4/maxloc0.m4 m4/maxloc1.m4 m4/maxval.m4 \
284     m4/minloc0.m4 m4/minloc1.m4 m4/minval.m4 m4/product.m4 m4/sum.m4 \
285     m4/dotprod.m4 m4/dotprodl.m4 m4/dotprodc.m4 m4/matmul.m4 m4/matmull.m4 \
286     m4/ctrig.m4 m4/cexp.m4 m4/chyp.m4 m4/mtype.m4 \
287     m4/specific.m4 m4/specific2.m4 m4/head.m4 m4/shape.m4 m4/reshape.m4 \
288     m4/transpose.m4 m4/eoshift1.m4 m4/eoshift3.m4 m4/exponent.m4 \
289     m4/fraction.m4 m4/nearest.m4 m4/set_exponent.m4 m4/pow.m4
290
291 gfor_built_src= $(i_all_c) $(i_any_c) $(i_count_c) $(i_maxloc0_c) \
292     $(i_maxloc1_c) $(i_maxval_c) $(i_minloc0_c) $(i_minloc1_c) $(i_minval_c) \
293     $(i_product_c) $(i_sum_c) $(i_dotprod_c) $(i_dotprodl_c) $(i_dotprodc_c) \
294     $(i_matmul_c) $(i_matmull_c) $(i_transpose_c) $(i_shape_c) $(i_eoshift1_c) \
295     $(i_eoshift3_c) $(i_cshift1_c) $(i_reshape_c) $(in_pack_c) $(in_unpack_c) \
296     $(i_exponent_c) $(i_fraction_c) $(i_nearest_c) $(i_set_exponent_c) \
297     $(i_pow_c) \
298     selected_int_kind.inc selected_real_kind.inc
299
300 # We only use these if libm doesn't contain complex math functions.
301
302 gfor_math_trig_c= \
303 generated/trig_c4.c \
304 generated/trig_c8.c
305 gfor_math_exp_c= \
306 generated/exp_c4.c \
307 generated/exp_c8.c
308 gfor_math_hyp_c= \
309 generated/hyp_c4.c \
310 generated/hyp_c8.c
311
312 gfor_math_trig_obj= \
313 trig_c4.lo \
314 trig_c8.lo
315 gfor_math_exp_obj= \
316 exp_c4.lo \
317 exp_c8.lo
318 gfor_math_hyp_obj= \
319 hyp_c4.lo \
320 hyp_c8.lo
321
322 # Machine generated specifics
323 gfor_built_specific_src= \
324 generated/_abs_c4.f90 \
325 generated/_abs_c8.f90 \
326 generated/_abs_i4.f90 \
327 generated/_abs_i8.f90 \
328 generated/_abs_r4.f90 \
329 generated/_abs_r8.f90 \
330 generated/_exp_r4.f90 \
331 generated/_exp_r8.f90 \
332 generated/_exp_c4.f90 \
333 generated/_exp_c8.f90 \
334 generated/_log_r4.f90 \
335 generated/_log_r8.f90 \
336 generated/_log_c4.f90 \
337 generated/_log_c8.f90 \
338 generated/_log10_r4.f90 \
339 generated/_log10_r8.f90 \
340 generated/_sqrt_r4.f90 \
341 generated/_sqrt_r8.f90 \
342 generated/_sqrt_c4.f90 \
343 generated/_sqrt_c8.f90 \
344 generated/_asin_r4.f90 \
345 generated/_asin_r8.f90 \
346 generated/_acos_r4.f90 \
347 generated/_acos_r8.f90 \
348 generated/_atan_r4.f90 \
349 generated/_atan_r8.f90 \
350 generated/_sin_r4.f90 \
351 generated/_sin_r8.f90 \
352 generated/_sin_c4.f90 \
353 generated/_sin_c8.f90 \
354 generated/_cos_r4.f90 \
355 generated/_cos_r8.f90 \
356 generated/_cos_c4.f90 \
357 generated/_cos_c8.f90 \
358 generated/_tan_r4.f90 \
359 generated/_tan_r8.f90 \
360 generated/_sinh_r4.f90 \
361 generated/_sinh_r8.f90 \
362 generated/_cosh_r4.f90 \
363 generated/_cosh_r8.f90 \
364 generated/_tanh_r4.f90 \
365 generated/_tanh_r8.f90 \
366 generated/_conjg_c4.f90 \
367 generated/_conjg_c8.f90 \
368 generated/_aint_r4.f90 \
369 generated/_aint_r8.f90 \
370 generated/_anint_r4.f90 \
371 generated/_anint_r8.f90
372
373 gfor_built_specific2_src= \
374 generated/_sign_i4.f90 \
375 generated/_sign_i8.f90 \
376 generated/_sign_r4.f90 \
377 generated/_sign_r8.f90 \
378 generated/_dim_i4.f90 \
379 generated/_dim_i8.f90 \
380 generated/_dim_r4.f90 \
381 generated/_dim_r8.f90 \
382 generated/_atan2_r4.f90 \
383 generated/_atan2_r8.f90 \
384 generated/_mod_i4.f90 \
385 generated/_mod_i8.f90 \
386 generated/_mod_r4.f90 \
387 generated/_mod_r8.f90
388 #specific intrinsics requiring manal code
389 #gfor_specific_c= \
390 intrinsics/_aimag.c \
391 intrinsics/_cabs.c \
392 foo
393
394 gfor_specific_src= \
395 $(gfor_built_specific_src) \
396 $(gfor_built_specific2_src) \
397 intrinsics/dprod_r8.f90 \
398 intrinsics/f2c_specifics.F90
399
400 gfor_cmath_src= $(gfor_math_trig_c) $(gfor_math_exp_c) $(gfor_math_hyp_c)
401 gfor_cmath_obj= $(gfor_math_trig_obj) $(gfor_math_exp_obj) \
402     $(gfor_math_hyp_obj)
403
404 BUILT_SOURCES=$(gfor_built_src) $(gfor_cmath_src) $(gfor_built_specific_src) \
405     $(gfor_built_specific2_src)
406 libgfortran_la_SOURCES = $(gfor_src) $(gfor_built_src) $(gfor_io_src) \
407     $(gfor_helper_src) $(gfor_io_headers) $(gfor_specific_src)
408
409 EXTRA_libgfortran_la_SOURCES = $(gfor_cmath_src)
410
411 libgfortran_la_LIBADD = @MATH_OBJ@
412 libgfortran_la_DEPENDENCIES = @MATH_OBJ@
413
414 I_M4_DEPS=m4/iparm.m4
415 I_M4_DEPS0=$(I_M4_DEPS) m4/iforeach.m4
416 I_M4_DEPS1=$(I_M4_DEPS) m4/ifunction.m4
417
418 selected_int_kind.inc: $(srcdir)/mk-sik-inc.sh
419         $(SHELL) $(srcdir)/mk-sik-inc.sh '$(FCCOMPILE)' > $@
420
421 selected_real_kind.inc: $(srcdir)/mk-srk-inc.sh
422         $(SHELL) $(srcdir)/mk-srk-inc.sh '$(FCCOMPILE)' > $@
423
424 ## A 'normal' build shouldn't need to regenerate these
425 ## so we only include them in maintainer mode
426
427 if MAINTAINER_MODE
428 $(i_all_c): m4/all.m4 $(I_M4_DEPS1)
429         m4 -Dfile=$@ -I$(srcdir)/m4 all.m4 > $(srcdir)/$@
430
431 $(i_any_c): m4/any.m4 $(I_M4_DEPS1)
432         m4 -Dfile=$@ -I$(srcdir)/m4 any.m4> $(srcdir)/$@
433
434 $(i_count_c): m4/count.m4 $(I_M4_DEPS1)
435         m4 -Dfile=$@ -I$(srcdir)/m4 count.m4> $(srcdir)/$@
436
437 $(i_maxloc0_c): m4/maxloc0.m4 $(I_M4_DEPS0)
438         m4 -Dfile=$@ -I$(srcdir)/m4 maxloc0.m4 > $(srcdir)/$@
439
440 $(i_maxloc1_c): m4/maxloc1.m4 $(I_M4_DEPS1)
441         m4 -Dfile=$@ -I$(srcdir)/m4 maxloc1.m4 > $(srcdir)/$@
442
443 $(i_maxval_c): m4/maxval.m4 $(I_M4_DEPS1)
444         m4 -Dfile=$@ -I$(srcdir)/m4 maxval.m4 > $(srcdir)/$@
445
446 $(i_minloc0_c): m4/minloc0.m4 $(I_M4_DEPS0)
447         m4 -Dfile=$@ -I$(srcdir)/m4 minloc0.m4 > $(srcdir)/$@
448
449 $(i_minloc1_c): m4/minloc1.m4 $(I_M4_DEPS1)
450         m4 -Dfile=$@ -I$(srcdir)/m4 minloc1.m4 > $(srcdir)/$@
451
452 $(i_minval_c): m4/minval.m4 $(I_M4_DEPS1)
453         m4 -Dfile=$@ -I$(srcdir)/m4 minval.m4 > $(srcdir)/$@
454
455 $(i_product_c): m4/product.m4 $(I_M4_DEPS1)
456         m4 -Dfile=$@ -I$(srcdir)/m4 product.m4 > $(srcdir)/$@
457
458 $(i_sum_c): m4/sum.m4 $(I_M4_DEPS1)
459         m4 -Dfile=$@ -I$(srcdir)/m4 sum.m4 > $(srcdir)/$@
460
461 $(i_dotprod_c): m4/dotprod.m4 $(I_M4_DEPS)
462         m4 -Dfile=$@ -I$(srcdir)/m4 dotprod.m4 > $(srcdir)/$@
463
464 $(i_dotprodl_c): m4/dotprodl.m4 $(I_M4_DEPS)
465         m4 -Dfile=$@ -I$(srcdir)/m4 dotprodl.m4 > $(srcdir)/$@
466
467 $(i_dotprodc_c): m4/dotprodc.m4 $(I_M4_DEPS)
468         m4 -Dfile=$@ -I$(srcdir)/m4 dotprodc.m4 > $(srcdir)/$@
469
470 $(i_matmul_c): m4/matmul.m4 $(I_M4_DEPS)
471         m4 -Dfile=$@ -I$(srcdir)/m4 matmul.m4 > $(srcdir)/$@
472
473 $(i_matmull_c): m4/matmull.m4 $(I_M4_DEPS)
474         m4 -Dfile=$@ -I$(srcdir)/m4 matmull.m4 > $(srcdir)/$@
475
476 $(i_transpose_c): m4/transpose.m4 $(I_M4_DEPS)
477         m4 -Dfile=$@ -I$(srcdir)/m4 transpose.m4 > $(srcdir)/$@
478
479 $(i_shape_c): m4/shape.m4 $(I_M4_DEPS)
480         m4 -Dfile=$@ -I$(srcdir)/m4 shape.m4 > $(srcdir)/$@
481
482 $(i_reshape_c): m4/reshape.m4 $(I_M4_DEPS)
483         m4 -Dfile=$@ -I$(srcdir)/m4 reshape.m4 > $(srcdir)/$@
484
485 $(i_eoshift1_c): m4/eoshift1.m4 $(I_M4_DEPS)
486         m4 -Dfile=$@ -I$(srcdir)/m4 eoshift1.m4 > $(srcdir)/$@
487
488 $(i_eoshift3_c): m4/eoshift3.m4 $(I_M4_DEPS)
489         m4 -Dfile=$@ -I$(srcdir)/m4 eoshift3.m4 > $(srcdir)/$@
490
491 $(i_cshift1_c): m4/cshift1.m4 $(I_M4_DEPS)
492         m4 -Dfile=$@ -I$(srcdir)/m4 cshift1.m4 > $(srcdir)/$@
493
494 $(in_pack_c): m4/in_pack.m4 $(I_M4_DEPS)
495         m4 -Dfile=$@ -I$(srcdir)/m4 in_pack.m4 > $(srcdir)/$@
496
497 $(in_unpack_c): m4/in_unpack.m4 $(I_M4_DEPS)
498         m4 -Dfile=$@ -I$(srcdir)/m4 in_unpack.m4 > $(srcdir)/$@
499
500 $(i_exponent_c): m4/exponent.m4 m4/mtype.m4
501         m4 -Dfile=$@ -I$(srcdir)/m4 exponent.m4 > $(srcdir)/$@
502
503 $(i_fraction_c): m4/fraction.m4 m4/mtype.m4
504         m4 -Dfile=$@ -I$(srcdir)/m4 fraction.m4 > $(srcdir)/$@
505
506 $(i_nearest_c): m4/nearest.m4 m4/mtype.m4
507         m4 -Dfile=$@ -I$(srcdir)/m4 nearest.m4 > $(srcdir)/$@
508
509 $(i_set_exponent_c): m4/set_exponent.m4 m4/mtype.m4
510         m4 -Dfile=$@ -I$(srcdir)/m4 set_exponent.m4 > $(srcdir)/$@
511
512 $(i_pow_c): m4/pow.m4 $(I_M4_DEPS)
513         m4 -Dfile=$@ -I$(srcdir)/m4 pow.m4 > $(srcdir)/$@
514
515 $(gfor_math_trig_c): m4/ctrig.m4 m4/mtype.m4
516         m4 -Dfile=$@ -I$(srcdir)/m4 ctrig.m4 > $(srcdir)/$@
517
518 $(gfor_math_exp_c): m4/cexp.m4 m4/mtype.m4
519         m4 -Dfile=$@ -I$(srcdir)/m4 cexp.m4 > $(srcdir)/$@
520
521 $(gfor_math_hyp_c): m4/chyp.m4 m4/mtype.m4
522         m4 -Dfile=$@ -I$(srcdir)/m4 chyp.m4 > $(srcdir)/$@
523
524 $(gfor_built_specific_src): m4/specific.m4 m4/head.m4
525         m4 -Dfile=$@ -I$(srcdir)/m4 specific.m4 > $(srcdir)/$@
526
527 $(gfor_built_specific2_src): m4/specific2.m4 m4/head.m4
528         m4 -Dfile=$@ -I$(srcdir)/m4 specific2.m4 > $(srcdir)/$@
529 ## end of maintainer mode only rules
530 endif
531
532 EXTRA_DIST = $(m4_files)
533