Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Huge hack for call of smpi_simulated_main.
[simgrid.git] / src / smpi / smpicc.in
1 #! /bin/bash
2
3 CC=@CMAKE_C_COMPILER@
4 CFLAGS="-O2 -Dmain=smpi_simulated_main"
5
6 INCLUDEARGS="-I@includedir@ -I@includedir@/smpi"
7 CMAKE_LINKARGS="-L@CMAKE_LINKARGS@"
8 LINKARGS="-lsimgrid -lsmpi -lm"
9
10 CMDLINE=""
11 while [ -n "$1" ]; do
12   ARG="$1"
13   shift
14   case "${ARG}" in
15    -c)
16       LINKARGS=""
17       CMDLINE="${CMDLINE} -c "
18       ;;
19    *.c)
20       SRCFILE="$(readlink -f ${ARG} 2>/dev/null)"
21       if [ -z $SRCFILE ] ; then
22          SRCFILE="$ARG"
23       fi
24       CMDLINE="${CMDLINE} ${SRCFILE} "
25       ;;
26    *)
27       CMDLINE="${CMDLINE} ${ARG} "
28       ;;
29   esac
30 done
31
32 CMDLINE="${CC} ${CFLAGS} ${CMDLINE} ${INCLUDEARGS} ${CMAKE_LINKARGS} ${LINKARGS}"
33
34 #echo "${CMDLINE}"
35 ${CMDLINE}