generated_headers.am 1.84 KB
Newer Older
1
define extract_interface
Lorenz Huedepohl's avatar
Lorenz Huedepohl committed
2
	@echo "Extracting interface marked with '$1' from $@...";
3
	@grep -h "^ *$1" $^ | sed 's/^ *$1//;' >> $@ || { rm $@; exit 1; }
4
5
6
endef

elpa test:
7
	@mkdir $@
8

9
test/shared: | test
10
	@mkdir $@
11
12
13
14
15

config-f90.h: config.h
	@echo "Generating $@...";
	@grep "^#define" $^ > $@ || { rm $@; exit 1; }

16
elpa/elpa_generated.h: $(top_srcdir)/src/elpa_driver/legacy_interface/elpa_driver_c_interface.F90 \
17
                       $(top_srcdir)/src/elpa1/legacy_interface/elpa_1stage_c_interface.F90 \
18
                       $(top_srcdir)/src/elpa2/legacy_interface/elpa_2stage_c_interface.F90 | elpa
Lorenz Huedepohl's avatar
Lorenz Huedepohl committed
19
	@rm -f $@
20
21
	$(call extract_interface,!c>)

22
23
24
25
26
27
elpa/elpa_generated_legacy.h: $(top_srcdir)/src/elpa_driver/legacy_interface/elpa_driver_c_interface.F90 \
                       $(top_srcdir)/src/elpa1/legacy_interface/elpa_1stage_c_interface.F90 \
                       $(top_srcdir)/src/elpa2/legacy_interface/elpa_2stage_c_interface.F90 | elpa
	@rm -f $@
	$(call extract_interface,!lc>)

Andreas Marek's avatar
Andreas Marek committed
28
test/shared/generated.h: $(wildcard $(top_srcdir)/test/shared/*.*90) | test/shared
Lorenz Huedepohl's avatar
Lorenz Huedepohl committed
29
	@rm -f $@
30
31
	$(call extract_interface,!c>)

Lorenz Huedepohl's avatar
Lorenz Huedepohl committed
32
33
elpa/elpa_generated_fortran_interfaces.h: $(wildcard $(top_srcdir)/src/elpa2/kernels/*.c $(top_srcdir)/src/elpa2/kernels/*.s $(top_srcdir)/src/*.[ch]) | elpa
	@rm -f $@
34
	$(call extract_interface,!f>)
35
	$(call extract_interface,#!f>)
36

37
src/fortran_constants.X90: $(top_srcdir)/src/fortran_constants.h
38
39
40
	@$(CPP) $(CPPFLAGS) -I$(top_builddir)/ -I$(top_srcdir)/ -I. $< -o $@_ || { rm -f $@; exit 1; }
	@awk '/!ELPA_C_DEFINE/ {gsub(/!ELPA_C_DEFINE/, "\n"); gsub(/NEWLINE/, "\n"); print;}' < $@_ > $@ || { rm -f $@; exit 1; }
	@rm $@_
41
42


43
generated_headers= config-f90.h elpa/elpa_generated.h elpa/elpa_generated_legacy.h test/shared/generated.h elpa/elpa_generated_fortran_interfaces.h src/fortran_constants.X90
44
generated-headers: $(generated_headers)
45
46
47


# vim: syntax=make