Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Implement functions SD_workstation_route_get_list, SD_workstation_route_get_size...
[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         gras/Transport/transport_interface.h \
56         gras/Virtu/virtu_interface.h          gras/Virtu/virtu_private.h\
57         gras/Virtu/virtu_rl.h                 gras/Virtu/virtu_sg.h \
58         gras/DataDesc/ddt_parse.yy.l          gras/DataDesc/ddt_parse.yy.c \
59         \
60         amok/Bandwidth/bandwidth_private.h
61
62 #        gras_private.h
63
64 #LIBRARY_VERSION= 0:0:0
65 #                 | | |
66 #          +------+ | +---+
67 #          |        |     |
68 #       current:revision:age
69 #          |        |     |
70 #          |        |     +- Increment if interfaces have been added
71 #          |        |        Set to zero if interfaces have been removed or
72 #          |        |        changed
73 #          |        +- Increment if source code has changed
74 #          |           Set to zero if current is incremented
75 #          +- Increment if interfaces have been added, removed or changed
76
77 VERSION_INFO= -release 20050627 -version-info 0:0:0
78 # from `info libtool "Updating version info"` 
79 # and  `info libtool "Release numbers"` 
80 #
81 # A) For stable library (interface wise), you should use --version-info:
82 #
83 # - Begin with C:R:A = 0:0:0 (ie here, VERSION_INFO= -version-info 0:0:0)
84 # - Do not update it before public release (keep numbers small)
85 #
86 # ----------------------------------------------------------------------+
87 # +   Interface     |  code of existing  | Interface | New version info |
88 # | removal/change? | interface changed? | addition? |                  |
89 # +-----------------+--------------------+-----------+------------------+
90 # |      yes        |   must be yes ;)   |           |  C++ : 0   : 0   |
91 # |      no         |        yes         |    yes    |  C   : R++ : A++ |
92 # |      no         |        yes         |    no     |  C   : R++ : A   |
93 # |      no         |        no          |    yes    |  C   : R   : A++ |
94 # |      no         |        no          |    no     |  C   : R   : A   |
95 # +-----------------+--------------------+-----------+------------------+
96 #
97 # B) For rapidely changing library, you should go for the -release flag
98 #
99 #  It modifies the library name, and you thus cannot say that a library
100 #   using this trick is ready for a "stable" release (say, in Debian).
101
102 lib_LTLIBRARIES= libsimgrid.la libgras.la
103 noinst_PROGRAMS=testall
104
105 COMMON_SRC=\
106   \
107   xbt/snprintf.c                                                             \
108   xbt/ex.c                                                                   \
109   \
110   xbt_modinter.h    gras_modinter.h                                          \
111   \
112   xbt/sysdep.c                                                               \
113   xbt/asserts.c                                                              \
114   xbt/log.c         xbt/log_default_appender.c                               \
115   xbt/dynar.c                                                                \
116   xbt/dict.c        xbt/dict_elm.c               xbt/dict_cursor.c           \
117   xbt/dict_multi.c                                                           \
118   xbt/heap.c                                                                 \
119   xbt/fifo.c                                                                 \
120   xbt/swag.c                                                                 \
121   xbt/graph.c                                                                \
122   xbt/set.c                                                                  \
123   xbt/xbt_matrix.c                                                           \
124   xbt/xbt_host.c                                                             \
125   xbt/module.c                                                               \
126   xbt/config.c                                                               \
127   xbt/cunit.c                                                                \
128   xbt/graphxml_parse.c                                                       \
129   \
130   gras/gras.c \
131   \
132   gras/Transport/transport.c          gras/Transport/transport_private.h  \
133   \
134   gras/DataDesc/ddt_create.c          \
135   gras/DataDesc/ddt_convert.c         gras/DataDesc/ddt_exchange.c     \
136   gras/DataDesc/cbps.c                gras/DataDesc/datadesc.c         \
137   gras/DataDesc/datadesc_interface.h  gras/DataDesc/datadesc_private.h \
138   gras/DataDesc/ddt_parse.c           gras/DataDesc/ddt_parse.yy.c         gras/DataDesc/ddt_parse.yy.h \
139   \
140   gras/Msg/msg.c                      gras/Msg/rpc.c                       gras/Msg/timer.c                 \
141   gras/Msg/msg_interface.h            gras/Msg/msg_private.h           \
142   \
143   gras/Virtu/process.c
144
145 RL_SRC= \
146   gras/Transport/rl_transport.c          \
147   gras/Transport/transport_plugin_file.c   gras/Transport/transport_plugin_tcp.c  \
148   \
149   gras/Virtu/rl_emul.c \
150   gras/Virtu/rl_process.c        gras/Virtu/rl_time.c \
151   gras/Virtu/rl_dns.c\
152   \
153   gras/Msg/rl_msg.c
154
155 SG_SRC=  \
156   xbt/context.c                                                                \
157   \
158   surf/maxmin.c                                                              \
159   surf/trace_mgr.c                                                           \
160   surf/surf.c                                                                \
161   surf/surfxml_parse.c                                                          \
162   surf/cpu.c   surf/network.c   surf/workstation.c                           \
163   surf/surf_timer.c                                                               \
164   surf/network_dassf.c                                                       \
165   surf/workstation_KCCFLN05.c  \
166   \
167   msg/msg_config.c \
168   msg/task.c msg/host.c msg/m_process.c msg/gos.c \
169   msg/global.c msg/environment.c msg/deployment.c  \
170   \
171   gras/Transport/sg_transport.c  gras/Transport/transport_plugin_sg.c             \
172   \
173   gras/Virtu/sg_emul.c \
174   gras/Virtu/sg_process.c        gras/Virtu/sg_time.c     \
175   gras/Virtu/sg_dns.c\
176   \
177   gras/Msg/sg_msg.c
178
179 AMOK_SRC= \
180   amok/base.c \
181   amok/Bandwidth/bandwidth.c amok/Bandwidth/saturate.c \
182   amok/HostManagement/hostmanagement.c
183
184 ###
185 ### Testing infrastructure
186 ###
187
188 # Test files must be added both to the TEST_CFILES and TEST_UNITS because
189 # if I compute TEST_UNITS from TEST_CFILES, automake fails to note that they
190 # are generated. Sorry about that.
191
192 # If you add a test unit, you should regenerate simgrid_units_main.c from scratch:
193 # rm -f simgrid_units_main.c *_unit.c ; make testall
194
195 # Suites and tests run in the given order.
196
197 TEST_CFILES=xbt/cunit.c  xbt/ex.c          \
198             xbt/dynar.c xbt/dict.c xbt/set.c xbt/swag.c \
199             xbt/config.c
200 TEST_UNITS= cunit_unit.c ex_unit.c         \
201             dynar_unit.c dict_unit.c set_unit.c swag_unit.c \
202             config_unit.c
203
204 BUILT_SOURCES=../include/surf/surfxml.h surf/surfxml.c \
205               ../include/xbt/graphxml.h xbt/graphxml.c \
206               gras/DataDesc/ddt_parse.yy.c \
207               $(TEST_UNITS) simgrid_units_main.c
208
209 testall_SOURCES= $(TEST_UNITS) simgrid_units_main.c
210 testall_LDADD=libgras.la
211 TESTS=testall
212
213 EXTRA_DIST+=$(testall_SOURCES)
214
215 if MAINTAINER_MODE
216 cunit_unit.c: xbt/cunit.c
217         @top_srcdir@/tools/sg_unit_extractor.pl $^
218 ex_unit.c: xbt/ex.c
219         @top_srcdir@/tools/sg_unit_extractor.pl $^
220 dynar_unit.c: xbt/dynar.c
221         @top_srcdir@/tools/sg_unit_extractor.pl $^
222 dict_unit.c: xbt/dict.c
223         @top_srcdir@/tools/sg_unit_extractor.pl $^
224 set_unit.c: xbt/set.c
225         @top_srcdir@/tools/sg_unit_extractor.pl $^
226 swag_unit.c: xbt/swag.c
227         @top_srcdir@/tools/sg_unit_extractor.pl $^
228 config_unit.c: xbt/config.c
229         @top_srcdir@/tools/sg_unit_extractor.pl $^
230
231 simgrid_units_main.c: $(TEST_UNITS)
232
233 else
234
235 $(TEST_UNITS) simgrid_units_main.c: 
236         @echo "ERROR: Test units not generated."
237         @echo "ERROR: If you are using a CVS checkout, configure with the --enable-maintainer-mode flag"
238         @echo "ERROR: If not, please report the bug to the simgrid-devel mailing list."
239         @exit 1
240
241 endif
242
243 ###
244 ### Regenerate what needs to with flex & flexml
245 ###
246
247
248 gras/DataDesc/ddt_parse.yy.c: gras/DataDesc/ddt_parse.yy.l
249         @LEX@ -o$@ -Pgras_ddt_parse_ $^
250
251 if MAINTAINER_MODE
252 surf/surfxml.c: surf/surfxml.l
253         @LEX@ -o$@ -Psurf_parse_ $^
254 xbt/graphxml.c: xbt/graphxml.l
255         @LEX@ -o$@ -Pxbt_graph_parse_ $^
256
257 if HAVE_FLEXML
258 surf/surfxml.l: surf/surfxml.dtd
259         set -e; cd surf; flexml -b 1000000 -P surfxml -S -L surfxml.dtd
260 ../include/surf/surfxml.h: surf/surfxml.dtd
261         cd ../include/surf; flexml -P surfxml -H -L ../../src/surf/surfxml.dtd
262 xbt/graphxml.l: xbt/graphxml.dtd
263         set -e; cd xbt; flexml -b 1000000 -P graphxml -S -L graphxml.dtd
264 ../include/xbt/graphxml.h: xbt/graphxml.dtd
265         cd ../include/xbt; flexml -P graphxml -H -L ../../src/xbt/graphxml.dtd
266 else
267
268 ../include/surf/surfxml.h surf/surfxml.l: surf/surfxml.dtd
269         @echo "ERROR: src/surf/surfxml.dtd was modified, but the flexml program was not detected"
270         @echo "ERROR: Please install it, or if you didn't modify this file, try this:"
271         @echo "ERROR:   touch include/surf/surfxml.h src/surf/surfxml.l"
272         @exit 1
273 ../include/xbt/graphxml.h xbt/graphxml.l: xbt/graphxml.dtd
274         @echo "ERROR: src/xbt/graphxml.dtd was modified, but the flexml program was not detected"
275         @echo "ERROR: Please install it, or if you didn't modify this file, try this:"
276         @echo "ERROR:   touch include/xbt/graphxml.h src/xbt/graphxml.l"
277         @exit 1
278 endif
279 endif
280
281 ###
282 ### Declare the library content
283 ###
284
285 libgras_la_SOURCES= $(COMMON_SRC) $(RL_SRC) $(AMOK_SRC)
286 libgras_la_LDFLAGS = $(VERSION_INFO) @GRAS_DEP@ @LD_DYNAMIC_FLAGS@ -lm 
287
288 libsimgrid_la_SOURCES= $(COMMON_SRC) $(SG_SRC) $(AMOK_SRC)
289 libsimgrid_la_LDFLAGS = $(VERSION_INFO) @SIMGRID_DEP@ @LD_DYNAMIC_FLAGS@ -lm
290
291
292
293 include $(top_srcdir)/acmacro/dist-files.mk