Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Got bored during a meeting: fix the copyright notice of several useless files (found...
[simgrid.git] / src / Makefile.am
1 #AM_CFLAGS= -DNDEBUG 
2
3 # -DNLOG   cuts absolutely all logs at compilation time.
4 # -DNDEBUG cuts asserts and logs at "trace" and "debug" levels.
5
6
7
8 MAINTAINERCLEANFILES=Makefile.in
9 INCLUDES= -I$(top_srcdir)/include -I$(top_srcdir)/src/include
10
11 bin_SCRIPTS= smpi/smpicc smpi/smpirun
12
13 EXTRA_DIST= \
14         \
15         portable.h \
16         \
17         xbt/mallocator_private.h \
18         xbt/dynar_private.h \
19         xbt/dict_private.h \
20         xbt/heap_private.h \
21         xbt/fifo_private.h \
22         xbt/graph_private.h \
23         xbt/graphxml_parse.c \
24         xbt/graphxml.l \
25         xbt/graphxml.c \
26         xbt/graphxml.dtd \
27         xbt/context_private.h \
28         xbt/ex_interface.h \
29         \
30         surf/maxmin_private.h \
31         surf/trace_mgr_private.h \
32         surf/surf_private.h \
33         surf/cpu_private.h \
34         surf/workstation_private.h \
35         surf/surf_timer_private.h \
36         surf/surfxml_parse.c \
37         surf/surfxml.l \
38         surf/surfxml.c \
39         surf/surfxml.dtd \
40         surf/network_private.h \
41         surf/network_gtnets_private.h \
42         \
43         include/surf/maxmin.h \
44         include/surf/trace_mgr.h \
45         include/surf/surf.h \
46         include/surf/surfxml_parse_private.h \
47         \
48         include/xbt/xbt_os_time.h \
49         include/xbt/xbt_os_thread.h \
50         include/xbt/context.h \
51         \
52         msg/private.h \
53         \
54         simdag/private.h \
55         \
56         gras/DataDesc/ddt_parse.yy.l \
57         gras/Virtu/virtu_rl.h \
58         gras/Virtu/virtu_sg.h \
59         gras/Virtu/virtu_interface.h \
60         gras/Virtu/virtu_private.h \
61         gras/Transport/transport_interface.h \
62         amok/Bandwidth/bandwidth_private.h \
63         amok/amok_modinter.h \
64         \
65         include/simix/simix.h include/simix/datatypes.h \
66         simix/private.h \
67         \
68         smpi/private.h
69
70 #LIBRARY_VERSION= 0:0:0
71 #                 | | |
72 #          +------+ | +---+
73 #          |        |     |
74 #       current:revision:age
75 #          |        |     |
76 #          |        |     +- Increment if interfaces have been added
77 #          |        |        Set to zero if interfaces have been removed or
78 #          |        |        changed
79 #          |        +- Increment if source code has changed
80 #          |           Set to zero if current is incremented
81 #          +- Increment if interfaces have been added, removed or changed
82
83 VERSION_INFO= -version-info 2:0:0
84 # from `info libtool "Updating version info"` 
85 # and  `info libtool "Release numbers"` 
86 #
87 # A) For stable library (interface wise), you should use --version-info:
88 #
89 # - Begin with C:R:A = 0:0:0 (ie here, VERSION_INFO= -version-info 0:0:0)
90 # - Do not update it before public release (keep numbers small)
91 #
92 # ----------------------------------------------------------------------+
93 # +   Interface     |  code of existing  | Interface | New version info |
94 # | removal/change? | interface changed? | addition? |                  |
95 # +-----------------+--------------------+-----------+------------------+
96 # |      yes        |   must be yes ;)   |           |  C++ : 0   : 0   |
97 # |      no         |        yes         |    yes    |  C   : R++ : A++ |
98 # |      no         |        yes         |    no     |  C   : R++ : A   |
99 # |      no         |        no          |    yes    |  C   : R   : A++ |
100 # |      no         |        no          |    no     |  C   : R   : A   |
101 # +-----------------+--------------------+-----------+------------------+
102 #
103 # B) For rapidely changing library, you should go for the -release flag
104 #
105 #  It modifies the library name, and you thus cannot say that a library
106 #   using this trick is ready for a "stable" release (say, in Debian).
107
108
109 ################################################
110 # Declaration of the different modules content #
111 ################################################
112
113 XBT_SRC=\
114   \
115   xbt/snprintf.c    xbt/xbt_str.c                                            \
116   xbt/ex.c                                                                   \
117   \
118   xbt_modinter.h    gras_modinter.h                                          \
119   xbt/xbt_virtu.c                                                            \
120   \
121   xbt/xbt_os_time.c                                                          \
122   xbt/asserts.c                                                              \
123   xbt/log.c                    xbt/xbt_log_appender_file.c                   \
124   xbt/xbt_log_layout_simple.c  xbt/xbt_log_layout_format.c                   \
125   xbt/mallocator.c                                                           \
126   xbt/dynar.c                                                                \
127   xbt/dict.c        xbt/dict_elm.c               xbt/dict_cursor.c           \
128   xbt/dict_multi.c                                                           \
129   xbt/heap.c                                                                 \
130   xbt/fifo.c                                                                 \
131   xbt/swag.c                                                                 \
132   xbt/graph.c                                                                \
133   xbt/set.c                                                                  \
134   xbt/xbt_matrix.c                                                           \
135   \
136   xbt/xbt_queue.c                                                            \
137   \
138   xbt/xbt_peer.c                                                             \
139   \
140   xbt/xbt_main.c                                                             \
141   \
142   xbt/config.c                                                               \
143   xbt/cunit.c                                                                \
144   xbt/graphxml_parse.c
145
146 XBT_RL_SRC = \
147   xbt/xbt_rl_synchro.c          \
148   xbt/xbt_rl_time.c
149 XBT_SG_SRC = \
150   xbt/xbt_sg_synchro.c          \
151   xbt/xbt_sg_time.c     
152
153 SURF_SRC= \
154   surf/maxmin.c                                                              \
155   surf/fair_bottleneck.c                                                              \
156   surf/lagrange.c                                                            \
157   surf/trace_mgr.c                                                           \
158   surf/surf.c                                                                \
159   surf/surfxml_parse.c                                                       \
160   surf/cpu.c   surf/network.c   surf/workstation.c                           \
161   surf/surf_timer.c                                                          \
162   surf/workstation_KCCFLN05.c   surf/workstation_ptask_L07.c
163
164 if CONTEXT_THREADS
165   SURF_SRC += xbt/xbt_os_thread.c
166 else  
167   SURF_SRC += xbt/xbt_os_thread_stubs.c
168 endif
169
170 GTNETS_SRC= \
171   surf/gtnets/gtnets_simulator.cc \
172   surf/gtnets/gtnets_topology.cc  \
173   surf/gtnets/gtnets_interface.cc \
174   surf/network_gtnets.c
175
176 # Separated because we don't want it in libsimgrid4java
177 CTX_SRC= xbt/context.c
178 JCTX_SRC= java/jxbt_context.c java/jxbt_context.h
179
180 SIMIX_SRC= \
181   simix/smx_global.c \
182   simix/smx_deployment.c \
183   simix/smx_config.c \
184   simix/smx_environment.c \
185   simix/smx_host.c \
186   simix/smx_process.c \
187   simix/smx_action.c \
188   simix/smx_synchro.c
189
190 SMPI_SRC= \
191   smpi/smpi_base.c \
192   smpi/smpi_bench.c \
193   smpi/smpi_global.c \
194   smpi/smpi_mpi.c \
195   smpi/smpi_sender.c \
196   smpi/smpi_receiver.c \
197   smpi/smpi_util.c
198
199 MSG_SRC=  msg/msg_config.c \
200   msg/task.c msg/host.c msg/m_process.c msg/gos.c \
201   msg/global.c msg/environment.c msg/deployment.c 
202
203 JMSG_C_SRC = \
204   java/jxbt_utilities.c     java/jxbt_utilities.h      \
205   java/jmsg.c               java/jmsg.h                \
206   java/jmsg_channel.c       java/jmsg_channel.h        \
207   java/jmsg_host.c          java/jmsg_host.h           \
208   java/jmsg_parallel_task.c java/jmsg_parallel_task.h  \
209   java/jmsg_process.c       java/jmsg_process.h        \
210   java/jmsg_task.c          java/jmsg_task.h
211
212 JMSG_JAVA_SRC = \
213   java/simgrid/msg/MsgException.java                 \
214   java/simgrid/msg/JniException.java                 \
215   java/simgrid/msg/NativeException.java              \
216   java/simgrid/msg/HostNotFoundException.java        \
217   java/simgrid/msg/ProcessNotFoundException.java     \
218   \
219   java/simgrid/msg/Process.java                      \
220   java/simgrid/msg/DTDResolver.java                  \
221   java/simgrid/msg/ApplicationHandler.java           \
222   java/simgrid/msg/Channel.java                      \
223   java/simgrid/msg/Host.java                         \
224   java/simgrid/msg/Msg.java                          \
225   java/simgrid/msg/Task.java                         \
226   java/simgrid/msg/ParallelTask.java                 \
227   \
228   java/simgrid/msg/Sem.java
229
230
231 SIMDAG_SRC= simdag/sd_global.c simdag/sd_link.c simdag/sd_task.c simdag/sd_workstation.c
232
233 GRAS_COMMON_SRC= \
234   gras/gras.c  \
235   gras/Transport/transport.c          gras/Transport/transport_private.h  \
236   gras/Msg/gras_msg_mod.c             gras/Msg/gras_msg_types.c           \
237   gras/Msg/gras_msg_exchange.c        gras/Msg/gras_msg_listener.c        \
238   gras/Msg/rpc.c                      gras/Msg/timer.c                    \
239   gras/Msg/msg_interface.h            gras/Msg/msg_private.h              \
240   \
241   gras/Virtu/process.c gras/Virtu/gras_module.c  \
242   \
243   gras/DataDesc/ddt_create.c          \
244   gras/DataDesc/ddt_convert.c         gras/DataDesc/ddt_exchange.c     \
245   gras/DataDesc/cbps.c                gras/DataDesc/datadesc.c         \
246   gras/DataDesc/datadesc_interface.h  gras/DataDesc/datadesc_private.h \
247   gras/DataDesc/ddt_parse.c           gras/DataDesc/ddt_parse.yy.c         gras/DataDesc/ddt_parse.yy.h
248
249 GRAS_RL_SRC= \
250   gras/rl_stubs.c                     xbt/xbt_os_thread.c                    \
251   \
252   gras/Transport/rl_transport.c          \
253   gras/Transport/transport_plugin_file.c   gras/Transport/transport_plugin_tcp.c  \
254   \
255   gras/Virtu/rl_emul.c \
256   gras/Virtu/rl_process.c \
257   gras/Virtu/rl_dns.c\
258   \
259   gras/Msg/rl_msg.c
260
261 GRAS_RL_SRC+=$(XBT_RL_SRC)
262
263 GRAS_SG_SRC= gras/Transport/sg_transport.c  gras/Transport/transport_plugin_sg.c        \
264   \
265   gras/Virtu/sg_emul.c \
266   gras/Virtu/sg_process.c   \
267   gras/Virtu/sg_dns.c\
268   \
269   gras/Msg/sg_msg.c
270
271 GRAS_SG_SRC+=$(XBT_SG_SRC)
272
273 AMOK_SRC= \
274   amok/amok_base.c \
275   amok/Bandwidth/bandwidth.c amok/Bandwidth/saturate.c \
276   amok/PeerManagement/peermanagement.c
277
278 ##############################
279 # Deal with optional modules #
280 ##############################
281
282 if HAVE_GTNETS
283   GTNETS_USED=$(GTNETS_SRC)
284 else
285   GTNETS_USED=
286   EXTRA_DIST+=$(GTNETS_SRC)
287 endif
288
289 if HAVE_SDP
290   SDP_SRC= surf/sdp.c
291 else 
292   SDP_SRC=
293   EXTRA_DIST+=surf/sdp.c
294 endif
295
296 ###
297 ### Declare the library content
298 ###
299
300 lib_LTLIBRARIES= libsimgrid.la libgras.la libsmpi.la
301
302 libgras_la_SOURCES=  $(XBT_SRC) $(GRAS_COMMON_SRC) $(GRAS_RL_SRC) $(AMOK_SRC)
303 libgras_la_LDFLAGS = -no-undefined $(VERSION_INFO) @GRAS_DEP@ @LD_DYNAMIC_FLAGS@ -lm 
304
305 libsimgrid_la_SOURCES = $(XBT_SRC) $(SURF_SRC) $(GTNETS_USED) $(SDP_SRC) \
306                         $(SIMIX_SRC) $(CTX_SRC) \
307                         $(MSG_SRC) $(SIMDAG_SRC) \
308                         $(GRAS_COMMON_SRC) $(GRAS_SG_SRC) $(AMOK_SRC)
309 libsimgrid_la_LDFLAGS = -no-undefined $(VERSION_INFO) @SIMGRID_DEP@ @LD_DYNAMIC_FLAGS@ -lm
310
311 # Please do not add -no-undefined to libsmpi_la_LDFLAGS:
312 # smpi_simulated_main is indeed defined in user code, and undef in the
313 # library (no idea why it works under linux, but it fails under windows)
314 libsmpi_la_LIBADD = libsimgrid.la
315 libsmpi_la_SOURCES = $(SMPI_SRC)
316 libsmpi_la_LDFLAGS = $(VERSION_INFO) @SMPI_DEP@ @LD_DYNAMIC_FLAGS@ -lm
317
318 # Windows users (at least, MSVC ones) need a def file.
319 if IS_WINDOWS
320 libgras_la_LDFLAGS    += -Wl,--output-def,libgras.def
321 libsimgrid_la_LDFLAGS += -Wl,--output-def,libsimgrid.def
322 libsmpi_la_LDFLAGS    += -Wl,--output-def,libsmpi.def
323 endif
324
325 ##
326 ## Java cruft
327
328 EXTRA_DIST+=$(JMSG_JAVA_SRC)
329 if HAVE_JAVA
330 lib_LTLIBRARIES += libsimgrid4java.la
331
332 libsimgrid4java_la_SOURCES = $(XBT_SRC) $(SURF_SRC) $(GTNETS_USED) $(SDP_SRC) \
333                              $(SIMIX_SRC) $(JCTX_SRC) \
334                              $(JMSG_C_SRC) $(MSG_SRC) \
335                              $(GRAS_COMMON_SRC) $(GRAS_SG_SRC) $(AMOK_SRC)
336 libsimgrid4java_la_LDFLAGS = -no-undefined $(VERSION_INFO) @SIMGRID_DEP@ @LD_DYNAMIC_FLAGS@ -lm
337 libsimgrid4java_la_GCJFLAGS = -fjni
338
339 clean-local:
340         -rm -rf .classes
341
342 jardir = $(prefix)/jar 
343 jar_DATA =  simgrid.jar
344
345 simgrid.jar: $(JMSG_JAVA_SRC) ./surf/surfxml.dtd
346         [ -e .classes ] || mkdir .classes
347         $(JAVAC) -sourcepath java -d .classes $(JMSG_JAVA_SRC) 
348         $(JAR) cvf simgrid.jar -C .classes . ./surf/surfxml.dtd;
349 else
350 EXTRA_DIST += $(JCTX_SRC) $(JMSG_C_SRC) $(MSG_SRC)
351 endif
352
353 if GRAMINE_MODE
354 else 
355 ###
356 ### Testing infrastructure
357 ###
358
359 # Test files must be added both to the TEST_CFILES and TEST_UNITS because
360 # if I compute TEST_UNITS from TEST_CFILES, automake fails to note that they
361 # are generated. Sorry about that.
362
363 # If you add a test unit, you should regenerate simgrid_units_main.c from scratch:
364 # make clean-units ; make testall
365
366 # Suites and tests run in the given order.
367
368 noinst_PROGRAMS=testall
369 TEST_CFILES=xbt/cunit.c  xbt/ex.c          \
370             xbt/dynar.c xbt/dict.c xbt/set.c xbt/swag.c \
371             xbt/xbt_str.c                      \
372             xbt/config.c 
373 TEST_UNITS= @builddir@/cunit_unit.c @builddir@/ex_unit.c         \
374             @builddir@/dynar_unit.c @builddir@/dict_unit.c @builddir@/set_unit.c @builddir@/swag_unit.c \
375             @builddir@/xbt_str_unit.c \
376             @builddir@/config_unit.c 
377
378 BUILT_SOURCES=../include/surf/surfxml.h surf/surfxml.c \
379               ../include/xbt/graphxml.h xbt/graphxml.c \
380               gras/DataDesc/ddt_parse.yy.c \
381               $(TEST_UNITS) @builddir@/simgrid_units_main.c
382
383 testall_SOURCES= $(TEST_UNITS) @builddir@/simgrid_units_main.c
384 testall_LDADD=libgras.la
385 TESTS=testall
386 TESTS_ENVIRONMENT=$(SG_TEST_EXENV)
387
388 EXTRA_DIST+=$(testall_SOURCES)
389
390 if MAINTAINER_MODE
391 CLEANFILES=$(TEST_UNITS)
392
393 @builddir@/cunit_unit.c: xbt/cunit.c
394         @top_srcdir@/tools/sg_unit_extractor.pl $^
395 @builddir@/ex_unit.c: xbt/ex.c
396         @top_srcdir@/tools/sg_unit_extractor.pl $^
397 @builddir@/xbt_str_unit.c: xbt/xbt_str.c
398         @top_srcdir@/tools/sg_unit_extractor.pl $^
399 @builddir@/dynar_unit.c: xbt/dynar.c
400         @top_srcdir@/tools/sg_unit_extractor.pl $^
401 @builddir@/dict_unit.c: xbt/dict.c
402         @top_srcdir@/tools/sg_unit_extractor.pl $^
403 @builddir@/set_unit.c: xbt/set.c
404         @top_srcdir@/tools/sg_unit_extractor.pl $^
405 @builddir@/swag_unit.c: xbt/swag.c
406         @top_srcdir@/tools/sg_unit_extractor.pl $^
407 @builddir@/config_unit.c: xbt/config.c
408         @top_srcdir@/tools/sg_unit_extractor.pl $^
409
410 @builddir@/simgrid_units_main.c: $(TEST_UNITS)
411         @top_srcdir@/tools/sg_unit_extractor.pl @srcdir@/xbt/cunit.c
412
413 clean-units:
414         rm -f simgrid_units_main.c *_unit.c @srcdir@/simgrid_units_main.c @srcdir@/*_unit.c
415         for n in $(TEST_UNITS) ; do \
416           dep=`echo $$n|sed -e 's|.c$$|.Po|' -e 's|[^/]*/||' -e 's|^|.deps/|'`; \
417           echo "Removing dependency tracker of $$n ($$dep @srcdir@/$$dep)"; \
418           rm -vf $$dep @srcdir@/$$dep; touch $$dep; \
419         done
420 else
421
422 if BOTBUILD_MODE
423 $(TEST_UNITS) simgrid_units_main.c clean-units: 
424         @echo "WARNING: Test units not generated, but touched instead since this is a bot build."
425         touch $@
426 else 
427 $(TEST_UNITS) simgrid_units_main.c clean-units: 
428         @echo "ERROR: Test units not generated."
429         @echo "ERROR: If you are using a SVN checkout, configure with the --enable-maintainer-mode flag"
430         @echo "ERROR: If not, please report the bug to the simgrid-devel mailing list."
431         @exit 1
432 endif
433 endif
434
435 ###
436 ### Regenerate what needs to with flex & flexml
437 ###
438
439
440 gras/DataDesc/ddt_parse.yy.c: gras/DataDesc/ddt_parse.yy.l
441         set -e;@LEX@ -o$@ -Pgras_ddt_parse_ --noline $^
442
443 if MAINTAINER_MODE
444 surf/surfxml.c: surf/surfxml.l
445         set -e;mkdir -p `dirname $@`; @LEX@ -o$@ -Psurf_parse_ --noline $^
446         sed 's/#include <unistd.h>/#if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__TOS_WIN__)\n#  ifndef __STRICT_ANSI__\n#    include <io.h>\n#    include <process.h>\n#  endif\n#else\n#  include <unistd.h>\n#endif/g' -i $@
447 xbt/graphxml.c: xbt/graphxml.l
448         set -e;mkdir -p `dirname $@`; @LEX@ -o$@ -Pxbt_graph_parse_ --noline $^
449         sed 's/#include <unistd.h>/#if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__TOS_WIN__)\n#  ifndef __STRICT_ANSI__\n#    include <io.h>\n#    include <process.h>\n#  endif\n#else\n#  include <unistd.h>\n#endif/g' -i $@
450
451 if HAVE_FLEXML
452 surf/surfxml.l: $(srcdir)/surf/surfxml.dtd
453         set -e; mkdir -p surf; flexml -b 1000000 -P surfxml --sysid=surfxml.dtd -S $@ -L $^
454 $(top_srcdir)/include/surf/surfxml.h: $(srcdir)/surf/surfxml.dtd
455         set -e;                flexml            -P surfxml --sysid=surfxml.dtd -H $@ -L $^
456         sed 's/extern  *\([^ ]*[ \*]*\)/XBT_PUBLIC_DATA(\1) /' -i $@
457         sed 's/XBT_PUBLIC_DATA(\([^)]*\)) *\([^(]*\)(/XBT_PUBLIC(\1) \2(/' -i $@
458
459 xbt/graphxml.l: $(srcdir)/xbt/graphxml.dtd
460         set -e; flexml -b 1000000 -P graphxml --sysid=graphxml.dtd -S $@ -L $^
461 $(top_srcdir)/include/xbt/graphxml.h: $(srcdir)/xbt/graphxml.dtd
462         set -e; flexml            -P graphxml --sysid=graphxml.dtd -H $@ -L $^
463         sed 's/extern  *\([^ ]*[ \*]*\)/XBT_PUBLIC_DATA(\1) /' -i $@
464         sed 's/XBT_PUBLIC_DATA(\([^)]*\)) *\([^(]*\)(/XBT_PUBLIC(\1) \2(/' -i $@
465 else
466
467 $(top_srcdir)/include/surf/surfxml.h surf/surfxml.l: $(top_srcdir)/src/surf/surfxml.dtd
468         @echo "ERROR: src/surf/surfxml.dtd was modified, but the flexml program was not detected"
469         @echo "ERROR: Please install it, or if you didn't modify this file, try this:"
470         @echo "ERROR:   touch include/surf/surfxml.h src/surf/surfxml.l"
471         @exit 1
472 $(top_srcdir)/include/xbt/graphxml.h xbt/graphxml.l: $(top_srcdir)/src/xbt/graphxml.dtd
473         @echo "ERROR: src/xbt/graphxml.dtd was modified, but the flexml program was not detected"
474         @echo "ERROR: Please install it, or if you didn't modify this file, try this:"
475         @echo "ERROR:   touch include/xbt/graphxml.h src/xbt/graphxml.l"
476         @exit 1
477 endif
478 endif
479 endif
480
481 include $(top_srcdir)/acmacro/dist-files.mk