configure
changeset 329 7717252e3ed9
parent 284 24bf3d692993
child 331 da55aa2f9e64
equal deleted inserted replaced
328:474aa35daa95 329:7717252e3ed9
    62 #                             DEFAULT BUILD OPTIONS                       #
    62 #                             DEFAULT BUILD OPTIONS                       #
    63 ###########################################################################
    63 ###########################################################################
    64 
    64 
    65 # Leave empty for automatic detection
    65 # Leave empty for automatic detection
    66 CC=
    66 CC=
       
    67 CXX=g++
       
    68 LD=ld
    67 
    69 
    68 #default target
    70 #default target
    69 SUB_TARGET=
    71 SUB_TARGET=
    70 
    72 
    71 # First compiler option - we will check if it exists
    73 # First compiler option - we will check if it exists
   134 		echo	"               \"lincan\" for HCS12 micro-controller"
   136 		echo	"               \"lincan\" for HCS12 micro-controller"
   135 		echo	"                                please see http://www.ocera.org/download/components/WP7/lincan-0.3.3.html"
   137 		echo	"                                please see http://www.ocera.org/download/components/WP7/lincan-0.3.3.html"
   136 		echo 	" --timers=foo  Use 'foo' as TIMERS driver (can be either 'unix' or 'xeno')"
   138 		echo 	" --timers=foo  Use 'foo' as TIMERS driver (can be either 'unix' or 'xeno')"
   137 		echo 	" --disable-dll Disable run-time dynamic linking of can, led and nvram drivers"
   139 		echo 	" --disable-dll Disable run-time dynamic linking of can, led and nvram drivers"
   138 		echo	" --disable-Ox  Disable gcc \"-Ox\" optimizations."
   140 		echo	" --disable-Ox  Disable gcc \"-Ox\" optimizations."
   139 		echo	" --debug=foo   Enable debug messages, ERR -> only errors, WAR)."
   141 		echo	" --debug=foo,foo,..   Enable debug messages, ERR -> only errors, WAR)."
   140 		echo	"                 \"PDO\" send errors and warnings through PDO messages"
   142 		echo	"                 \"PDO\" send errors and warnings through PDO messages"
   141 		echo	"                 \"ERR\" errors only, to stdout"
   143 		echo	"                 \"ERR\" print errors only, to stdout"
   142 		echo	"                 \"WAR\" errors and warnings, to stdout"
   144 		echo	"                 \"WAR\" print errors and warnings, to stdout"
       
   145 		echo	"                 \"MSG\" print messages content, to stdout"
   143 		echo
   146 		echo
   144 		echo	"Stack compilation constants"
   147 		echo	"Stack compilation constants"
   145 		echo	" --MAX_CAN_BUS_ID [=1] Number of can bus to use"
   148 		echo	" --MAX_CAN_BUS_ID [=1] Number of can bus to use"
   146 		echo	" --SDO_MAX_LENGTH_TRANSFERT [=32] max bytes to transmit by SDO"
   149 		echo	" --SDO_MAX_LENGTH_TRANSFERT [=32] max bytes to transmit by SDO"
   147 		echo	" --SDO_MAX_SIMULTANEOUS_TRANSFERTS [=4] Number of SDO that the node can manage concurrently"
   150 		echo	" --SDO_MAX_SIMULTANEOUS_TRANSFERTS [=4] Number of SDO that the node can manage concurrently"
   417 		else
   420 		else
   418 			CC=m6811-elf-gcc
   421 			CC=m6811-elf-gcc
   419 			SUB_PROG_CFLAGS=-m68hc12
   422 			SUB_PROG_CFLAGS=-m68hc12
   420 		fi
   423 		fi
   421 	fi
   424 	fi
       
   425 fi	
       
   426 
       
   427 if [ "$SUB_TARGET" = "win32" ]; then
       
   428 		LD=g++
       
   429 		SUB_PROG_CFLAGS="-mno-cygwin"
   422 fi	
   430 fi	
   423 
   431 
   424 #### CAN_DRIVER ####
   432 #### CAN_DRIVER ####
   425 
   433 
   426 if [ "$SUB_CAN_DRIVER" = "peak_linux" ]; then
   434 if [ "$SUB_CAN_DRIVER" = "peak_linux" ]; then
   605 echo "#endif /* _CONFIG_H_ */" >> include/config.h
   613 echo "#endif /* _CONFIG_H_ */" >> include/config.h
   606 
   614 
   607 ###########################################################################
   615 ###########################################################################
   608 #                           DEBUG DEFINES/CFLAGS                          #
   616 #                           DEBUG DEFINES/CFLAGS                          #
   609 ###########################################################################
   617 ###########################################################################
   610 if [ "$DEBUG" = "WAR" ]; then
   618 
   611 	SUB_PROG_CFLAGS=$SUB_PROG_CFLAGS\ -DDEBUG_WAR_CONSOLE_ON\ -DDEBUG_ERR_CONSOLE_ON\ -g
   619 save_ifs="$IFS"; IFS=','
   612 fi
   620 
   613 
   621 for DEBUG_METHOD in $DEBUG; 
   614 if [ "$DEBUG" = "ERR" ]; then
   622 	do
   615 	SUB_PROG_CFLAGS=$SUB_PROG_CFLAGS\ -DDEBUG_ERR_CONSOLE_ON\ -g
   623 	    IFS="$save_ifs"
   616 fi
   624 	    case $DEBUG_METHOD in
   617 
   625 	    	ERR)ERR=1;;
   618 if [ "$DEBUG" = "PDO" ]; then
   626 	    	WAR)WAR=1;ERR=1;;
   619 	SUB_PROG_CFLAGS=$SUB_PROG_CFLAGS\ -DDEBUG_WAR_CONSOLE_ON\ -DDEBUG_ERR_CONSOLE_ON\ -g\ -DPDO_ERROR
   627 	    	MSG)MSG=1;;
   620 fi
   628 	    	PDO)PDO=1;WAR=1;ERR=1;;
       
   629 	    	*)echo ""
       
   630 	    	  echo "$DEBUG_METHOD is not a valid debug's method"
       
   631 	    	  echo "Possible Debug's methods are : \"ERR\", \"WAR\", \"MSG\", \"PDO\""
       
   632 	    	  exit -1
       
   633 	    	  ;;
       
   634 	esac	
       
   635 done
       
   636 
       
   637 if [ $WAR ]; then
       
   638 	SUB_PROG_CFLAGS=$SUB_PROG_CFLAGS\ -DDEBUG_WAR_CONSOLE_ON;
       
   639 fi
       
   640 
       
   641 if [ $ERR ]; then
       
   642 	SUB_PROG_CFLAGS=$SUB_PROG_CFLAGS\ -DDEBUG_ERR_CONSOLE_ON;
       
   643 fi
       
   644 
       
   645 if [ $MSG ]; then
       
   646 	SUB_PROG_CFLAGS=$SUB_PROG_CFLAGS\ -DDEBUG_MSG_CONSOLE_ON;
       
   647 fi
       
   648 
       
   649 if [ $PDO ]; then
       
   650 	SUB_PROG_CFLAGS=$SUB_PROG_CFLAGS\ -DDEBUG_PDO_CONSOLE_ON;
       
   651 fi
       
   652 
       
   653 if [ $DEBUG ]; then
       
   654 	SUB_PROG_CFLAGS=$SUB_PROG_CFLAGS\ -g
       
   655 fi
       
   656 
       
   657 IFS="$save_ifs"
   621 
   658 
   622 if [ "$DISABLE_OPT" = "1" ]; then
   659 if [ "$DISABLE_OPT" = "1" ]; then
   623 	SUB_OPT_CFLAGS=
   660 	SUB_OPT_CFLAGS=
   624 else
   661 else
   625 	SUB_OPT_CFLAGS=\$\(OPT_CFLAGS\)
   662 	SUB_OPT_CFLAGS=\$\(OPT_CFLAGS\)
   668 \	examples/TestMasterSlave/Makefile.in
   705 \	examples/TestMasterSlave/Makefile.in
   669 fi
   706 fi
   670 
   707 
   671 if [ "$SUB_TARGET" = "unix" ]; then
   708 if [ "$SUB_TARGET" = "unix" ]; then
   672 	MAKEFILES=$MAKEFILES\
   709 	MAKEFILES=$MAKEFILES\
   673 \	examples/DS401_Master/Makefile.in
   710 \	examples/DS401_Master/Makefile.in\
   674 fi
   711 \	examples/DS401_Slave_Gui/Makefile.in\
   675 if [ "$SUB_TARGET" = "unix" ]; then
       
   676 	MAKEFILES=$MAKEFILES\
       
   677 \	examples/DS401_Slave_Gui/Makefile.in
       
   678 fi
       
   679 if [ "$SUB_TARGET" = "unix" ]; then
       
   680 	MAKEFILES=$MAKEFILES\
       
   681 \	examples/TestMasterMicroMod/Makefile.in
   712 \	examples/TestMasterMicroMod/Makefile.in
   682 fi
   713 fi
   683 
   714 
   684 if [ "$SUB_TARGET" = "win32" ]; then
   715 if [ "$SUB_TARGET" = "win32" ]; then
   685 	MAKEFILES=$MAKEFILES\
   716 	MAKEFILES=$MAKEFILES\
   686 \	examples/TestMasterSlave/Makefile.in
   717 \	examples/TestMasterSlave/Makefile.in\
   687 fi
   718 \	examples/TestMasterMicroMod/Makefile.in\
   688 
   719 \	examples/DS401_Master/Makefile.in\
   689 if [ "$SUB_TARGET" = "win32" ]; then
   720 \	examples/DS401_Slave_Gui/Makefile.in
   690 	MAKEFILES=$MAKEFILES\
   721 fi
   691 \	examples/TestMasterMicroMod/Makefile.in
       
   692 fi
       
   693 
       
   694 
   722 
   695 if [ "$SUB_TARGET" = "hcs12" ]; then
   723 if [ "$SUB_TARGET" = "hcs12" ]; then
   696 	MAKEFILES=$MAKEFILES\
   724 	MAKEFILES=$MAKEFILES\
   697 \	examples/gene_SYNC_HCS12/Makefile.in
   725 \	examples/gene_SYNC_HCS12/Makefile.in
   698 fi
   726 fi
   700 for makefile_in in $MAKEFILES; do
   728 for makefile_in in $MAKEFILES; do
   701 	makefile=`echo $makefile_in | sed 's:.in$::'`
   729 	makefile=`echo $makefile_in | sed 's:.in$::'`
   702 	echo "Creating $makefile"
   730 	echo "Creating $makefile"
   703 	sed < $makefile_in "
   731 	sed < $makefile_in "
   704 	s:SUB_CC:${CC}:
   732 	s:SUB_CC:${CC}:
       
   733 	s:SUB_CXX:${CXX}:
       
   734 	s:SUB_LD:${LD}:
   705 	s:SUB_PROG_CFLAGS:${SUB_PROG_CFLAGS}:
   735 	s:SUB_PROG_CFLAGS:${SUB_PROG_CFLAGS}:
   706 	s:SUB_EXE_CFLAGS:${SUB_EXE_CFLAGS}:
   736 	s:SUB_EXE_CFLAGS:${SUB_EXE_CFLAGS}:
   707 	s:SUB_PREFIX:${SUB_PREFIX}:
   737 	s:SUB_PREFIX:${SUB_PREFIX}:
   708 	s:SUB_OS_NAME:${SUB_OS_NAME}:
   738 	s:SUB_OS_NAME:${SUB_OS_NAME}:
   709 	s:SUB_ARCH_NAME:${SUB_ARCH_NAME}:
   739 	s:SUB_ARCH_NAME:${SUB_ARCH_NAME}: