File: Makefile.in

package info (click to toggle)
libxmlada 4.4.2014-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 8,612 kB
  • ctags: 74
  • sloc: ada: 44,182; sh: 3,077; makefile: 345; perl: 128; xml: 105; python: 48
file content (177 lines) | stat: -rw-r--r-- 6,547 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
## The type of library we want to build. Possible values:
##   relocatable
##   static
LIBRARY_TYPE=static

# Replace with the location for the installation directory
INSTALL=@INSTALL@
PACKAGE_TARNAME=@PACKAGE_TARNAME@
VERSION=@PACKAGE_VERSION@
BUILDS_SHARED=@GNAT_BUILDS_SHARED@
prefix=@prefix@
exec_prefix=@exec_prefix@
datadir=@datadir@
datarootdir=@datarootdir@
bindir=@bindir@
libdir=@libdir@
xmllib=${libdir}/xmlada/${LIBRARY_TYPE}/
docdir=@docdir@
includedir=@includedir@

# Set a default value (ignored if set in the environment)
PROCESSORS?=1
GNATMAKE=@gnatmake@ -j${PROCESSORS}

# Compiler mode: one of "distrib", "Debug", "Production", "profile", "coverage"
MODE=@BUILD_TYPE@

LIBEXT=@SO_EXT@

# Commands for installation procedure
CHMOD=chmod
LN_S=@LN_S@
MKDIR=@MKDIR@

# In some cases, we use cp instead of install for doing the installation,
# since the latter does not support installing multiple files at once.
CP=cp -p

#########################################################################
## Nothing to modify below this point
#########################################################################

MODULES=unicode input_sources sax dom schema
MODULE_INSTALL=${MODULES:%=%_inst}

MAKE_ARGS=-XBUILD=${MODE} -XLIBRARY_TYPE=${LIBRARY_TYPE}

.PHONY: all obj clean install install_dirs build_library_type install_library_type

ifeq (${BUILDS_SHARED},yes)
all: static relocatable
install: install_static install_relocatable
else
all: static
install: install_static
endif

build_library_type: obj
static:
	${MAKE} LIBRARY_TYPE=static build_library_type
shared relocatable:
	${MAKE} LIBRARY_TYPE=relocatable build_library_type

obj: force
	${GNATMAKE} -m -p -Punicode/unicode.gpr ${MAKE_ARGS}
	${GNATMAKE} -m -p -Pinput_sources/input_sources.gpr ${MAKE_ARGS}
	${GNATMAKE} -m -p -Psax/sax.gpr ${MAKE_ARGS}
	${GNATMAKE} -m -p -Pdom/dom.gpr ${MAKE_ARGS}
	${GNATMAKE} -m -p -Pschema/schema.gpr ${MAKE_ARGS}

test: force
	${GNATMAKE} -m -p -Punicode/test/unicode_test.gpr ${MAKE_ARGS}
	${GNATMAKE} -m -p -Psax/test/sax_test.gpr ${MAKE_ARGS}
	${GNATMAKE} -m -p -Pdom/test/dom_test.gpr ${MAKE_ARGS}
	${GNATMAKE} -m -p -Pschema/test/schema_test.gpr ${MAKE_ARGS}

run_test: force
	@make --no-print-directory -C unicode/test tests
	@make --no-print-directory -C sax/test tests
	@make --no-print-directory -C dom/test tests
	@make --no-print-directory -C schema/test tests
run_test_valgrind: test
	cd dom/test; valgrind --tool=memcheck --leak-check=full ./testxml -auto

docs: force
	-${MAKE} -e -C docs html latexpdf

# Rule for installing the modules
%_inst: force
	${CP} $*/*.ad[bs]        ${includedir}/xmlada
	cd $*; ls *.ad[bs] > ${prefix}/lib/gnat/xmlada/xmlada_$*.lgpr
	-cd ${xmllib}; ${CHMOD} ugo+w *.ali
	-${CP} $*/lib/${LIBRARY_TYPE}/*.ali   ${xmllib}
	${RM} ${libdir}/libxmlada_$**
	${RM} ${xmllib}libxmlada_$**
ifeq (${LIBRARY_TYPE},static)
	${INSTALL} $*/lib/${LIBRARY_TYPE}/libxmlada_$*.a ${xmllib}
else
ifeq (${LIBEXT},.dll)
	${INSTALL} $*/lib/${LIBRARY_TYPE}/libxmlada_$*${LIBEXT} ${xmllib}
	cd ${bindir}; ${CP} ${libdir}/xmlada/${LIBRARY_TYPE}/libxmlada_$*${LIBEXT} libxmlada_$*${LIBEXT}
else
	${INSTALL} $*/lib/${LIBRARY_TYPE}/libxmlada_$*${LIBEXT}.${VERSION} ${xmllib}

	@# prefix/lib/xmlada/relocatable/libxmlada.so -> libxmlada.so.4.4.0w
	cd ${xmllib}; ${LN_S} libxmlada_$*${LIBEXT}.${VERSION} libxmlada_$*${LIBEXT}

	@# prefix/lib/xmlada/relocatable/libxmlada.so.4.4 -> libxmlada.so.4.4.0w
	-cd ${xmllib}; ${LN_S} libxmlada_$*${LIBEXT}.${VERSION} libxmlada_$*${LIBEXT}.${basename ${VERSION}}

	@# prefix/lib/xmlada/relocatable/libxmlada.so.4 -> libxmlada.so.4.4.0w
ifneq (${basename ${basename ${VERSION}}},${basename ${VERSION}})
	cd ${xmllib}; ${LN_S} libxmlada_$*${LIBEXT}.${VERSION} libxmlada_$*${LIBEXT}.${basename ${basename ${VERSION}}}

	@# prefix/lib/libxmlada.so.4 -> prefix/lib/xmlada/relocatable/libxmlada.so.4.4.0w
	cd ${libdir}; ${LN_S} xmlada/${LIBRARY_TYPE}/libxmlada_$*${LIBEXT}.${VERSION} libxmlada_$*${LIBEXT}.${basename ${basename ${VERSION}}}
endif

	@# prefix/lib/libxmlada.so.4.4 -> prefix/lib/xmlada/relocatable/libxmlada.so.4.4.0w
	-cd ${libdir}; ${LN_S} xmlada/${LIBRARY_TYPE}/libxmlada_$*${LIBEXT}.${VERSION} libxmlada_$*${LIBEXT}.${basename ${VERSION}}

	@# prefix/lib/libxmlada.so.4.4.0w -> prefix/lib/xmlada/relocatable/libxmlada.so.4.4.0w
	-cd ${libdir}; ${LN_S} xmlada/${LIBRARY_TYPE}/libxmlada_$*${LIBEXT}.${VERSION} libxmlada_$*${LIBEXT}.${VERSION}
endif
endif
	cd ${xmllib}; ${CHMOD} ugo-w *.ali

install_dirs: force
	@${MKDIR} ${bindir}
	@${MKDIR} ${xmllib}
	@${MKDIR} ${prefix}/lib/gnat/xmlada
	@${MKDIR} ${libdir}
	@${MKDIR} ${datadir}/doc/xmlada
	@${MKDIR} ${includedir}/xmlada
	@${MKDIR} ${datadir}/gps/plug-ins/

## Do the installation for either shared or static, depending on
## $LIBRARY_TYPE
install_library_type: install_dirs ${MODULE_INSTALL}
	${INSTALL} distrib/xmlada_shared.gpr         ${prefix}/lib/gnat/
	${INSTALL} distrib/xmlada.gpr                ${prefix}/lib/gnat/
	${INSTALL} distrib/xmlada_dom.gpr            ${prefix}/lib/gnat/
	${INSTALL} distrib/xmlada_sax.gpr            ${prefix}/lib/gnat/
	${INSTALL} distrib/xmlada_input.gpr          ${prefix}/lib/gnat/
	${INSTALL} distrib/xmlada_schema.gpr         ${prefix}/lib/gnat/
	${INSTALL} distrib/xmlada_unicode.gpr        ${prefix}/lib/gnat/
	${INSTALL} xmlada-config  ${bindir}
	-$(CP) -r docs/_build/html/* $(datadir)/doc/xmlada/ 2>/dev/null
	-$(CP) -r docs/_build/latex/XMLAda.pdf $(datadir)/doc/xmlada/ 2>/dev/null
	${CHMOD} +x ${bindir}/xmlada-config
	${INSTALL} distrib/xmlada_gps.py ${datadir}/gps/plug-ins/

## Do the installation for an explicit target
install_static: 
	${MAKE} LIBRARY_TYPE=static install_library_type
install_shared install_relocatable:
	${MAKE} LIBRARY_TYPE=relocatable install_library_type

clean_%: force
	-gnat clean -XLIBRARY_TYPE=$* -q -r -Punicode/unicode.gpr
	-gnat clean -XLIBRARY_TYPE=$* -q -r -Pinput_sources/input_sources.gpr
	-gnat clean -XLIBRARY_TYPE=$* -q -r -Psax/sax.gpr
	-gnat clean -XLIBRARY_TYPE=$* -q -r -Pdom/dom.gpr
	-gnat clean -XLIBRARY_TYPE=$* -q -r -Pschema/schema.gpr
	-gnat clean -XLIBRARY_TYPE=$* -q -Punicode/test/unicode_test.gpr
	-gnat clean -XLIBRARY_TYPE=$* -q -Pdom/test/dom_test.gpr
	-gnat clean -XLIBRARY_TYPE=$* -q -Psax/test/sax_test.gpr
	-gnat clean -XLIBRARY_TYPE=$* -q -Pschema/test/schema_test.gpr

clean: clean_relocatable clean_static
	cd docs; ${MAKE} -e clean

distclean: clean
	${RM} dom/test/default.gpr
	${RM} Makefile config.cache config.log config.status Makefile.314 xmlada-config shared.gpr distrib/xmlada_shared.gpr

force: