1# -*- Automake -*-
2#
3# Makefile for the XMLF90 package
4#
5# Copyright (C) 2017 Yann Pouillon
6#
7# This file is part of the XMLF90 software package. For license information,
8# please see the COPYING file in the top-level directory of the source
9# distribution.
10#
11
12                    # ------------------------------------ #
13
14#
15# Main source files
16#
17
18# Common source files
19x90_srcs = \
20  m_sax_buffer.f90 \
21  m_sax_charset.f90 \
22  m_sax_converters.f90 \
23  m_sax_debug.f90 \
24  m_sax_dictionary.f90 \
25  m_sax_elstack.f90 \
26  m_sax_entities.f90 \
27  m_sax_fsm.f90 \
28  m_sax_reader.f90 \
29  m_xml_error.f90 \
30  m_xml_parser.f90 \
31  xmlf90_sax.f90
32
33# Fortran modules
34# Note: never expect they will have the same name as their source
35if F90_MOD_UPPERCASE
36x90_f03_int_mods = \
37  M_SAX_BUFFER.$(MODEXT) \
38  M_SAX_CHARSET.$(MODEXT) \
39  M_SAX_CONVERTERS.$(MODEXT) \
40  M_SAX_DEBUG.$(MODEXT) \
41  M_SAX_DICTIONARY.$(MODEXT) \
42  M_SAX_ELSTACK.$(MODEXT) \
43  M_SAX_ENTITIES.$(MODEXT) \
44  M_SAX_FSM.$(MODEXT) \
45  M_SAX_READER.$(MODEXT) \
46  M_XML_ERROR.$(MODEXT) \
47  M_XML_PARSER.$(MODEXT)
48
49x90_f03_ext_mods = \
50  XMLF90_SAX.$(MODEXT)
51else
52x90_f03_int_mods = \
53  m_sax_buffer.$(MODEXT) \
54  m_sax_charset.$(MODEXT) \
55  m_sax_converters.$(MODEXT) \
56  m_sax_debug.$(MODEXT) \
57  m_sax_dictionary.$(MODEXT) \
58  m_sax_elstack.$(MODEXT) \
59  m_sax_entities.$(MODEXT) \
60  m_sax_fsm.$(MODEXT) \
61  m_sax_reader.$(MODEXT) \
62  m_xml_error.$(MODEXT) \
63  m_xml_parser.$(MODEXT)
64
65x90_f03_ext_mods = \
66  xmlf90_sax.$(MODEXT)
67endif
68
69# Libraries to build
70noinst_LTLIBRARIES = libxmlf90_sax.la
71
72libxmlf90_sax_la_SOURCES = $(x90_srcs)
73
74# Fortran modules to install
75f03moddir = $(includedir)
76install-data-local:
77	$(INSTALL) -d -m 755 $(DESTDIR)$(f03moddir)
78	$(INSTALL) -m 644 $(x90_f03_ext_mods) $(x90_f03_int_mods) $(DESTDIR)$(f03moddir)
79
80uninstall-local:
81	cd $(DESTDIR)$(f03moddir) && rm -f $(x90_f03_ext_mods) $(x90_f03_int_mods)
82
83# Local cleaning
84clean-local:
85	rm -f $(x90_f03_int_mods) $(x90_f03_ext_mods) *.obj
86
87                    # ------------------------------------ #
88
89# Explicit dependencies within XMLF90
90# Note: this is needed because of Fortran
91m_sax_converters.$(LTOBJEXT): \
92  m_sax_debug.$(LTOBJEXT)
93
94m_sax_dictionary.$(LTOBJEXT): \
95  m_sax_buffer.$(LTOBJEXT)
96
97m_sax_elstack.$(LTOBJEXT): \
98  m_sax_buffer.$(LTOBJEXT)
99
100m_sax_entities.$(LTOBJEXT): \
101  m_sax_buffer.$(LTOBJEXT) \
102  m_xml_error.$(LTOBJEXT)
103
104m_sax_fsm.$(LTOBJEXT): \
105  m_sax_buffer.$(LTOBJEXT) \
106  m_sax_charset.$(LTOBJEXT) \
107  m_sax_dictionary.$(LTOBJEXT) \
108  m_sax_elstack.$(LTOBJEXT) \
109  m_sax_entities.$(LTOBJEXT)
110
111m_xml_error.$(LTOBJEXT): \
112  m_sax_elstack.$(LTOBJEXT)
113
114m_xml_parser.$(LTOBJEXT): \
115  m_sax_buffer.$(LTOBJEXT) \
116  m_sax_debug.$(LTOBJEXT) \
117  m_sax_dictionary.$(LTOBJEXT) \
118  m_sax_elstack.$(LTOBJEXT) \
119  m_sax_fsm.$(LTOBJEXT) \
120  m_sax_reader.$(LTOBJEXT) \
121  m_xml_error.$(LTOBJEXT)
122
123xmlf90_sax.$(LTOBJEXT): \
124  m_sax_converters.$(LTOBJEXT) \
125  m_sax_dictionary.$(LTOBJEXT) \
126  m_xml_error.$(LTOBJEXT) \
127  m_xml_parser.$(LTOBJEXT)
128
129