Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Ah! Some vpath build issues that vince didn't saw (he didn't install flexml ;)
[simgrid.git] / src / Makefile.am
1 AM_CFLAGS= -g
2 #AM_CFLAGS= -DNDEBUG 
3
4 # -DNLOG   cuts absolutely all logs at compilation time.
5 # -DNDEBUG cuts asserts and logs at "trace" and "debug" levels.
6
7 # -g -ffast-math -funroll-loops -O3 -fno-strict-aliasing
8 # Those should be added by configure when using gcc
9 # fast-math is nasty when using IEEE floating point semantic
10 # strict-aliasing breaks my type-punning bad habit.
11
12
13 MAINTAINERCLEANFILES=Makefile.in
14 INCLUDES= -I$(top_srcdir)/include -I$(top_srcdir)/src/include 
15 EXTRA_DIST= \
16         \
17         portable.h \
18         \
19         xbt/dynar_private.h \
20         xbt/dict_private.h \
21         xbt/heap_private.h \
22         xbt/fifo_private.h \
23         xbt/graph_private.h \
24         xbt/graphxml_parse.c \
25         xbt/graphxml.l \
26         xbt/graphxml.c \
27         xbt/graphxml.dtd \
28         xbt/context_private.h xbt/context_win32.h xbt/context_win32.c\
29         xbt/ex_interface.h \
30         \
31         surf/maxmin_private.h \
32         surf/trace_mgr_private.h \
33         surf/surf_private.h \
34         surf/cpu_private.h \
35         surf/workstation_private.h \
36         surf/surf_timer_private.h \
37         surf/surfxml_parse.c \
38         surf/surfxml.l \
39         surf/surfxml.c \
40         surf/surfxml.dtd \
41         surf/network_private.h \
42         surf/network_dassf_private.h \
43         surf/workstation_KCCFLN05_private.h \
44         \
45         include/surf/maxmin.h \
46         include/surf/trace_mgr.h \
47         include/surf/surf.h \
48         include/surf/surfxml_parse_private.h \
49         \
50         include/xbt/xbt_portability.h \
51         include/xbt/context.h \
52         \
53         msg/private.h \
54         \
55         simdag/private.h \
56         \
57         gras/Transport/transport_interface.h \
58         gras/Virtu/virtu_interface.h          gras/Virtu/virtu_private.h\
59         gras/Virtu/virtu_rl.h                 gras/Virtu/virtu_sg.h \
60         gras/DataDesc/ddt_parse.yy.l          gras/DataDesc/ddt_parse.yy.c \
61         \
62         amok/Bandwidth/bandwidth_private.h
63
64 #        gras_private.h
65
66 #LIBRARY_VERSION= 0:0:0
67 #                 | | |
68 #          +------+ | +---+
69 #          |        |     |
70 #       current:revision:age
71 #          |        |     |
72 #          |        |     +- Increment if interfaces have been added
73 #          |        |        Set to zero if interfaces have been removed or
74 #          |        |        changed
75 #          |        +- Increment if source code has changed
76 #          |           Set to zero if current is incremented
77 #          +- Increment if interfaces have been added, removed or changed
78
79 VERSION_INFO= -release 20050627 -version-info 0:0:0
80 # from `info libtool "Updating version info"` 
81 # and  `info libtool "Release numbers"` 
82 #
83 # A) For stable library (interface wise), you should use --version-info:
84 #
85 # - Begin with C:R:A = 0:0:0 (ie here, VERSION_INFO= -version-info 0:0:0)
86 # - Do not update it before public release (keep numbers small)
87 #
88 # ----------------------------------------------------------------------+
89 # +   Interface     |  code of existing  | Interface | New version info |
90 # | removal/change? | interface changed? | addition? |                  |
91 # +-----------------+--------------------+-----------+------------------+
92 # |      yes        |   must be yes ;)   |           |  C++ : 0   : 0   |
93 # |      no         |        yes         |    yes    |  C   : R++ : A++ |
94 # |      no         |        yes         |    no     |  C   : R++ : A   |
95 # |      no         |        no          |    yes    |  C   : R   : A++ |
96 # |      no         |        no          |    no     |  C   : R   : A   |
97 # +-----------------+--------------------+-----------+------------------+
98 #
99 # B) For rapidely changing library, you should go for the -release flag
100 #
101 #  It modifies the library name, and you thus cannot say that a library
102 #   using this trick is ready for a "stable" release (say, in Debian).
103
104 lib_LTLIBRARIES= libsimgrid.la libgras.la
105 noinst_PROGRAMS=testall
106
107 COMMON_SRC=\
108   \
109   xbt/snprintf.c                                                             \
110   xbt/ex.c                                                                   \
111   \
112   xbt_modinter.h    gras_modinter.h                                          \
113   \
114   xbt/sysdep.c                                                               \
115   xbt/asserts.c                                                              \
116   xbt/log.c         xbt/log_default_appender.c                               \
117   xbt/dynar.c                                                                \
118   xbt/dict.c        xbt/dict_elm.c               xbt/dict_cursor.c           \
119   xbt/dict_multi.c                                                           \
120   xbt/heap.c                                                                 \
121   xbt/fifo.c                                                                 \
122   xbt/swag.c                                                                 \
123   xbt/graph.c                                                                \
124   xbt/set.c                                                                  \
125   xbt/xbt_matrix.c                                                           \
126   xbt/xbt_host.c                                                             \
127   xbt/module.c                                                               \
128   xbt/config.c                                                               \
129   xbt/cunit.c                                                                \
130   xbt/graphxml_parse.c                                                       \
131   \
132   gras/gras.c \
133   \
134   gras/Transport/transport.c          gras/Transport/transport_private.h  \
135   \
136   gras/DataDesc/ddt_create.c          \
137   gras/DataDesc/ddt_convert.c         gras/DataDesc/ddt_exchange.c     \
138   gras/DataDesc/cbps.c                gras/DataDesc/datadesc.c         \
139   gras/DataDesc/datadesc_interface.h  gras/DataDesc/datadesc_private.h \
140   gras/DataDesc/ddt_parse.c           gras/DataDesc/ddt_parse.yy.c         gras/DataDesc/ddt_parse.yy.h \
141   \
142   gras/Msg/msg.c                      gras/Msg/rpc.c                       gras/Msg/timer.c                 \
143   gras/Msg/msg_interface.h            gras/Msg/msg_private.h           \
144   \
145   gras/Virtu/process.c
146
147 RL_SRC= \
148   gras/Transport/rl_transport.c          \
149   gras/Transport/transport_plugin_file.c   gras/Transport/transport_plugin_tcp.c  \
150   \
151   gras/Virtu/rl_emul.c \
152   gras/Virtu/rl_process.c        gras/Virtu/rl_time.c \
153   gras/Virtu/rl_dns.c\
154   \
155   gras/Msg/rl_msg.c
156
157 SG_SRC=  \
158   xbt/context.c                                                              \
159   \
160   surf/maxmin.c                                                              \
161   surf/trace_mgr.c                                                           \
162   surf/surf.c                                                                \
163   surf/surfxml_parse.c                                                       \
164   surf/cpu.c   surf/network.c   surf/workstation.c                           \
165   surf/surf_timer.c                                                          \
166   surf/network_dassf.c                                                       \
167   surf/workstation_KCCFLN05.c  \
168   \
169   msg/msg_config.c \
170   msg/task.c msg/host.c msg/m_process.c msg/gos.c \
171   msg/global.c msg/environment.c msg/deployment.c  \
172   \
173   simdag/sd_global.c simdag/sd_link.c simdag/sd_task.c                       \
174   simdag/sd_workstation.c                                                    \
175   \
176   gras/Transport/sg_transport.c  gras/Transport/transport_plugin_sg.c        \
177   \
178   gras/Virtu/sg_emul.c \
179   gras/Virtu/sg_process.c        gras/Virtu/sg_time.c     \
180   gras/Virtu/sg_dns.c\
181   \
182   gras/Msg/sg_msg.c
183
184 AMOK_SRC= \
185   amok/base.c \
186   amok/Bandwidth/bandwidth.c amok/Bandwidth/saturate.c \
187   amok/HostManagement/hostmanagement.c
188
189 ###
190 ### Testing infrastructure
191 ###
192
193 # Test files must be added both to the TEST_CFILES and TEST_UNITS because
194 # if I compute TEST_UNITS from TEST_CFILES, automake fails to note that they
195 # are generated. Sorry about that.
196
197 # If you add a test unit, you should regenerate simgrid_units_main.c from scratch:
198 # rm -f simgrid_units_main.c *_unit.c ; make testall
199
200 # Suites and tests run in the given order.
201
202 TEST_CFILES=xbt/cunit.c  xbt/ex.c          \
203             xbt/dynar.c xbt/dict.c xbt/set.c xbt/swag.c \
204             xbt/config.c
205 TEST_UNITS= cunit_unit.c ex_unit.c         \
206             dynar_unit.c dict_unit.c set_unit.c swag_unit.c \
207             config_unit.c
208
209 BUILT_SOURCES=../include/surf/surfxml.h surf/surfxml.c \
210               ../include/xbt/graphxml.h xbt/graphxml.c \
211               gras/DataDesc/ddt_parse.yy.c \
212               $(TEST_UNITS) simgrid_units_main.c
213
214 testall_SOURCES= $(TEST_UNITS) simgrid_units_main.c
215 testall_LDADD=libgras.la
216 TESTS=testall
217
218 EXTRA_DIST+=$(testall_SOURCES)
219
220 if MAINTAINER_MODE
221 cunit_unit.c: xbt/cunit.c
222         @top_srcdir@/tools/sg_unit_extractor.pl $^
223 ex_unit.c: xbt/ex.c
224         @top_srcdir@/tools/sg_unit_extractor.pl $^
225 dynar_unit.c: xbt/dynar.c
226         @top_srcdir@/tools/sg_unit_extractor.pl $^
227 dict_unit.c: xbt/dict.c
228         @top_srcdir@/tools/sg_unit_extractor.pl $^
229 set_unit.c: xbt/set.c
230         @top_srcdir@/tools/sg_unit_extractor.pl $^
231 swag_unit.c: xbt/swag.c
232         @top_srcdir@/tools/sg_unit_extractor.pl $^
233 config_unit.c: xbt/config.c
234         @top_srcdir@/tools/sg_unit_extractor.pl $^
235
236 simgrid_units_main.c: $(TEST_UNITS)
237
238 else
239
240 $(TEST_UNITS) simgrid_units_main.c: 
241         @echo "ERROR: Test units not generated."
242         @echo "ERROR: If you are using a CVS checkout, configure with the --enable-maintainer-mode flag"
243         @echo "ERROR: If not, please report the bug to the simgrid-devel mailing list."
244         @exit 1
245
246 endif
247
248 ###
249 ### Regenerate what needs to with flex & flexml
250 ###
251
252
253 gras/DataDesc/ddt_parse.yy.c: gras/DataDesc/ddt_parse.yy.l
254         set -e;@LEX@ -o$@ -Pgras_ddt_parse_ $^
255
256 if MAINTAINER_MODE
257 surf/surfxml.c: surf/surfxml.l
258         set -e;mkdir -p `basename $@`; @LEX@ -o$@ -Psurf_parse_ $^
259 xbt/graphxml.c: xbt/graphxml.l
260         set -e;mkdir -p `basename $@`; @LEX@ -o$@ -Pxbt_graph_parse_ $^
261
262 if HAVE_FLEXML
263 surf/surfxml.l: $(top_srcdir)/src/surf/surfxml.dtd
264         set -e; mkdir -p surf; cd surf; flexml -b 1000000 -P surfxml -S -L ../$(top_srcdir)/src/surf/surfxml.dtd
265 $(top_srcdir)/include/surf/surfxml.h: $(top_srcdir)/src/surf/surfxml.dtd
266         set -e;cd $(top_srcdir)/include/surf; flexml -P surfxml -H -L $(top_srcdir)/src/surf/surfxml.dtd
267         
268 xbt/graphxml.l: $(top_srcdir)/src/xbt/graphxml.dtd
269         set -e; cd xbt; flexml -b 1000000 -P graphxml -S -L $(top_srcdir)/src/xbt/graphxml.dtd
270 $(top_srcdir)/include/xbt/graphxml.h: $(top_srcdir)/src/xbt/graphxml.dtd
271         set -e;cd $(top_srcdir)/include/xbt; flexml -P graphxml -H -L ../$(top_srcdir)/src/xbt/graphxml.dtd
272 else
273
274 $(top_srcdir)/include/surf/surfxml.h surf/surfxml.l: $(top_srcdir)/src/surf/surfxml.dtd
275         @echo "ERROR: src/surf/surfxml.dtd was modified, but the flexml program was not detected"
276         @echo "ERROR: Please install it, or if you didn't modify this file, try this:"
277         @echo "ERROR:   touch include/surf/surfxml.h src/surf/surfxml.l"
278         @exit 1
279 $(top_srcdir)/include/xbt/graphxml.h xbt/graphxml.l: $(top_srcdir)/src/xbt/graphxml.dtd
280         @echo "ERROR: src/xbt/graphxml.dtd was modified, but the flexml program was not detected"
281         @echo "ERROR: Please install it, or if you didn't modify this file, try this:"
282         @echo "ERROR:   touch include/xbt/graphxml.h src/xbt/graphxml.l"
283         @exit 1
284 endif
285 endif
286
287 ###
288 ### Declare the library content
289 ###
290
291 libgras_la_SOURCES= $(COMMON_SRC) $(RL_SRC) $(AMOK_SRC)
292 libgras_la_LDFLAGS = $(VERSION_INFO) @GRAS_DEP@ @LD_DYNAMIC_FLAGS@ -lm 
293
294 libsimgrid_la_SOURCES= $(COMMON_SRC) $(SG_SRC) $(AMOK_SRC)
295 libsimgrid_la_LDFLAGS = $(VERSION_INFO) @SIMGRID_DEP@ @LD_DYNAMIC_FLAGS@ -lm
296
297
298
299 include $(top_srcdir)/acmacro/dist-files.mk