summarylogtreecommitdiffstats
path: root/Makefile.archy
blob: 72ba10f5eb681803c15a3edfc041c1821775c9f7 (plain)
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
ADALIB!=	gnatls -v | grep adalib | awk '{print $$1}'

PROCESSORS=7

STATIC_FLAGS=	-gnatQ -O2 -gnatn -gnatp -gnatA -j${PROCESSORS}
DYNAMIC_FLAGS=	-fPIC ${STATIC_FLAGS}

ECHO=echo

LIBVER=4.6.0.0

CURRENT_FOLDER=$(shell pwd)

#
# unicode depends on nothing
#

unicode/lib/static/libxmlada_unicode.a: unicode/dummy_unicode.adb
	@echo building static unicode/lib/static/libxmlada_unicode.a library
	@rm -f unicode/lib/static/libxmlada_unicode.a
	gnatmake -c unicode/dummy_unicode.adb -D unicode/obj/static ${STATIC_FLAGS}
	rm unicode/obj/static/dummy*
	ar cq unicode/lib/static/libxmlada_unicode.a unicode/obj/static/*.o
	ranlib unicode/lib/static/libxmlada_unicode.a

unicode/lib/relocatable/libxmlada_unicode.so: unicode/dummy_unicode.adb
	@${ECHO} building shared library unicode/lib/relocatable/libxmlada_unicode.so
	@rm -f unicode/lib/relocatable/libxmlada_unicode.so unicode/lib/relocatable/libxmlada_unicode.so.${LIBVER}
	gnatmake -c unicode/dummy_unicode.adb -D unicode/obj/relocatable ${DYNAMIC_FLAGS}
	rm unicode/obj/relocatable/dummy*
	gcc -shared -Wl,-rpath,${PREFIX}/lib/xmlada/relocatable \
	    -L${ADALIB} -lgnat -Wl,-rpath,${ADALIB} \
	    -o unicode/lib/relocatable/libxmlada_unicode.so.${LIBVER} -Wl,-soname,unicode/lib/relocatable/libxmlada_unicode.so.${LIBVER} \
	    unicode/obj/relocatable/*.o
	ln -s $(CURRENT_FOLDER)/unicode/lib/relocatable/libxmlada_unicode.so.${LIBVER} unicode/lib/relocatable/libxmlada_unicode.so

#
# input sources depends on unicode
#

input_sources/lib/static/libxmlada_input_sources.a: input_sources/dummy_input_sources.adb unicode/lib/static/libxmlada_unicode.a
	@echo building static input_sources/lib/static/libxmlada_input_sources.a library
	@rm -f input_sources/lib/static/libxmlada_input_sources.a
	gnatmake -c input_sources/dummy_input_sources.adb -D input_sources/obj/static -aOunicode/obj/static -aIunicode ${STATIC_FLAGS}
	rm input_sources/obj/static/dummy*
	ar cq input_sources/lib/static/libxmlada_input_sources.a input_sources/obj/static/*.o
	ranlib input_sources/lib/static/libxmlada_input_sources.a

input_sources/lib/relocatable/libxmlada_input_sources.so: input_sources/dummy_input_sources.adb unicode/lib/relocatable/libxmlada_unicode.so
	@${ECHO} building shared library input_sources/lib/relocatable/libxmlada_input_sources.so
	@rm -f input_sources/lib/relocatable/libxmlada_input_sources.so input_sources/lib/relocatable/libxmlada_input_sources.so.${LIBVER}
	gnatmake -c input_sources/dummy_input_sources.adb -D input_sources/obj/relocatable -aOunicode/obj/relocatable -aIunicode ${DYNAMIC_FLAGS}
	rm input_sources/obj/relocatable/dummy*
	gcc -shared -Wl,-rpath,${PREFIX}/lib/xmlada/relocatable \
	    -L${ADALIB} -lgnat -Wl,-rpath,${ADALIB} \
	    -Lunicode/lib/relocatable -lxmlada_unicode \
	    -o input_sources/lib/relocatable/libxmlada_input_sources.so.${LIBVER} -Wl,-soname,input_sources/lib/relocatable/libxmlada_input_sources.so.${LIBVER} \
	    input_sources/obj/relocatable/*.o
	ln -s $(CURRENT_FOLDER)/input_sources/lib/relocatable/libxmlada_input_sources.so.${LIBVER} input_sources/lib/relocatable/libxmlada_input_sources.so

#
# sax depends on input sources and unicode (sufficent to limit to I.S)
#

sax/lib/static/libxmlada_sax.a: sax/dummy_sax.adb input_sources/lib/static/libxmlada_input_sources.a
	@echo building static sax/lib/static/libxmlada_sax.a library
	@rm -f sax/lib/static/libxmlada_sax.a
	gnatmake -c sax/dummy_sax.adb -D sax/obj/static -aOunicode/obj/static -aOinput_sources/obj/static -aIunicode -aIinput_sources ${STATIC_FLAGS}
	rm sax/obj/static/dummy*
	ar cq sax/lib/static/libxmlada_sax.a sax/obj/static/*.o
	ranlib sax/lib/static/libxmlada_sax.a

sax/lib/relocatable/libxmlada_sax.so: sax/dummy_sax.adb input_sources/lib/relocatable/libxmlada_input_sources.so
	@${ECHO} building shared library sax/lib/relocatable/libxmlada_sax.so
	@rm -f sax/lib/relocatable/libxmlada_sax.so sax/lib/relocatable/libxmlada_sax.so.${LIBVER}
	gnatmake -c sax/dummy_sax.adb -D sax/obj/relocatable -aOunicode/obj/relocatable -aOinput_sources/obj/relocatable -aIunicode -aIinput_sources ${DYNAMIC_FLAGS}
	rm sax/obj/relocatable/dummy*
	gcc -shared -Wl,-rpath,${PREFIX}/lib/xmlada/relocatable \
	    -L${ADALIB} -lgnat -Wl,-rpath,${ADALIB} \
	    -Lunicode/lib/relocatable -lxmlada_unicode \
	    -Linput_sources/lib/relocatable -lxmlada_input_sources \
	    -o sax/lib/relocatable/libxmlada_sax.so.${LIBVER} -Wl,-soname,sax/lib/relocatable/libxmlada_sax.so.${LIBVER} \
	    sax/obj/relocatable/*.o
	ln -s $(CURRENT_FOLDER)/sax/lib/relocatable/libxmlada_sax.so.${LIBVER} sax/lib/relocatable/libxmlada_sax.so

#
# dom depends on three other libraries (sufficent to limit to sax)
#

dom/lib/static/libxmlada_dom.a: dom/dummy_dom.adb sax/lib/static/libxmlada_sax.a
	@echo building static dom/lib/static/libxmlada_dom.a library
	@rm -f dom/lib/static/libxmlada_dom.a
	gnatmake -c dom/dummy_dom.adb -D dom/obj/static -aOunicode/obj/static -aOinput_sources/obj/static -aOsax/obj/static -aIunicode -aIinput_sources -aIsax ${STATIC_FLAGS}
	rm dom/obj/static/dummy*
	ar cq dom/lib/static/libxmlada_dom.a dom/obj/static/*.o
	ranlib dom/lib/static/libxmlada_dom.a

dom/lib/relocatable/libxmlada_dom.so: dom/dummy_dom.adb sax/lib/relocatable/libxmlada_sax.so
	@${ECHO} building shared library dom/lib/relocatable/libxmlada_dom.so
	@rm -f dom/lib/relocatable/libxmlada_dom.so dom/lib/relocatable/libxmlada_dom.so.${LIBVER}
	gnatmake -c dom/dummy_dom.adb -D dom/obj/relocatable -aOunicode/obj/relocatable -aOinput_sources/obj/relocatable -aOsax/obj/relocatable -aIunicode -aIinput_sources -aIsax ${DYNAMIC_FLAGS}
	rm dom/obj/relocatable/dummy*
	gcc -shared -Wl,-rpath,${PREFIX}/lib/xmlada/relocatable \
	    -L${ADALIB} -lgnat -Wl,-rpath,${ADALIB} \
	    -Lunicode/lib/relocatable -lxmlada_unicode \
	    -Linput_sources/lib/relocatable -lxmlada_input_sources \
	    -Lsax/lib/relocatable -lxmlada_sax \
	    -o dom/lib/relocatable/libxmlada_dom.so.${LIBVER} -Wl,-soname,dom/lib/relocatable/libxmlada_dom.so.${LIBVER} \
	    dom/obj/relocatable/*.o
	ln -s $(CURRENT_FOLDER)/dom/lib/relocatable/libxmlada_dom.so.${LIBVER} dom/lib/relocatable/libxmlada_dom.so

#
# schema depends on four other libraries (sufficent to limit to dom)
#

schema/lib/static/libxmlada_schema.a: schema/dummy_schema.adb dom/lib/static/libxmlada_dom.a
	@echo building static schema/lib/static/libxmlada_schema.a library
	@rm -f schema/lib/static/libxmlada_schema.a
	gnatmake -c schema/dummy_schema.adb -D schema/obj/static -aOunicode/obj/static -aOinput_sources/obj/static -aOsax/obj/static -aOdom/obj/static -aIunicode -aIinput_sources -aIsax -aIdom ${STATIC_FLAGS}
	rm schema/obj/static/dummy*
	ar cq schema/lib/static/libxmlada_schema.a schema/obj/static/*.o
	ranlib schema/lib/static/libxmlada_schema.a

schema/lib/relocatable/libxmlada_schema.so: schema/dummy_schema.adb dom/lib/relocatable/libxmlada_dom.so
	@${ECHO} ${CURRENT_FOLDER} ************************** building shared library schema/lib/relocatable/libxmlada_schema.so
	@rm -f schema/lib/relocatable/libxmlada_schema.so schema/lib/relocatable/libxmlada_schema.so.${LIBVER}
	gnatmake -c schema/dummy_schema.adb -D schema/obj/relocatable -aOunicode/obj/relocatable -aOinput_sources/obj/relocatable -aOsax/obj/relocatable -aOdom/obj/relocatable -aIunicode -aIinput_sources -aIsax -aIdom ${DYNAMIC_FLAGS}
	rm schema/obj/relocatable/dummy*
	gcc -shared -Wl,-rpath,${PREFIX}/lib/xmlada/relocatable \
	    -L${ADALIB} -lgnat -Wl,-rpath,${ADALIB} \
	    -Lunicode/lib/relocatable -lxmlada_unicode \
	    -Linput_sources/lib/relocatable -lxmlada_input_sources \
	    -Lsax/lib/relocatable -lxmlada_sax \
	    -Ldom/lib/relocatable -lxmlada_dom \
	    -o schema/lib/relocatable/libxmlada_schema.so.${LIBVER} -Wl,-soname,schema/lib/relocatable/libxmlada_schema.so.${LIBVER} \
	    schema/obj/relocatable/*.o
	ln -s $(CURRENT_FOLDER)/schema/lib/relocatable/libxmlada_schema.so.${LIBVER} schema/lib/relocatable/libxmlada_schema.so

#
# Sphinx documentation
#

docs:
	${MAKE} -e -C docs


all: schema/lib/static/libxmlada_schema.a schema/lib/relocatable/libxmlada_schema.so