Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
03c26b3404cb76f02cee41adf00d6ab3e10ac449
[simgrid.git] / src / smpi / smpicc.in
1 #! /bin/bash
2
3 CC=@CMAKE_C_COMPILER@
4
5 INCLUDEARGS="@includeflag@"
6 CMAKE_LINKARGS="-L@libdir@"
7
8 if [ "@WIN32@" != "1" ]; then
9   CFLAGS="-Dmain=smpi_simulated_main__"
10   LINKARGS="-lsimgrid"
11 else
12   CFLAGS="-include @includedir@/smpi/smpi_main.h"
13   LINKARGS="@libdir@\libsimgrid.dll"
14 fi
15
16 CMDLINE=""
17 while [ -n "$1" ]; do
18   ARG="$1"
19   shift
20   case "${ARG}" in
21    -c)
22       CMAKE_LINKARGS=""
23       LINKARGS=""
24       CMDLINE="${CMDLINE} -c "
25       ;;
26    *.c)
27       SRCFILE="$(readlink -f ${ARG} 2>/dev/null)"
28       if [ -z $SRCFILE ] ; then
29          SRCFILE="$ARG"
30       fi
31       CMDLINE="${CMDLINE} ${SRCFILE} "
32       ;;
33    *)
34       CMDLINE="${CMDLINE} ${ARG} "
35       ;;
36   esac
37 done
38
39 CMDLINE="${CC} ${CFLAGS} ${CMDLINE} ${INCLUDEARGS} ${CMAKE_LINKARGS} ${LINKARGS}"
40
41 #echo "${CMDLINE}"
42 ${CMDLINE}