92 --arch=*) SUB_ARCH_NAME=$optarg;; |
92 --arch=*) SUB_ARCH_NAME=$optarg;; |
93 --os=*) SUB_OS_NAME=$optarg;; |
93 --os=*) SUB_OS_NAME=$optarg;; |
94 --prefix=*) SUB_PREFIX=$optarg;; |
94 --prefix=*) SUB_PREFIX=$optarg;; |
95 --target=*) SUB_TARGET=$optarg;; |
95 --target=*) SUB_TARGET=$optarg;; |
96 --can=*) SUB_CAN_DRIVER=$optarg;; |
96 --can=*) SUB_CAN_DRIVER=$optarg;; |
|
97 --led=*) SUB_LED_DRIVER=$optarg;; |
|
98 --nvram=*) SUB_NVRAM_DRIVER=$optarg;; |
97 --timers=*) SUB_TIMERS_DRIVER=$optarg;; |
99 --timers=*) SUB_TIMERS_DRIVER=$optarg;; |
98 --disable-Ox) DISABLE_OPT=1; |
100 --disable-Ox) DISABLE_OPT=1; |
99 echo "On user request: Won't optimize with \"-Ox\"";; |
101 echo "On user request: Won't optimize with \"-Ox\"";; |
100 --enable-jaxe) DISABLE_JAXE=0; |
102 --enable-jaxe) DISABLE_JAXE=0; |
101 echo "On user request: Will not install jaxe";; |
103 echo "On user request: Will not install jaxe";; |
103 echo "Debug messages enabled !!";; |
105 echo "Debug messages enabled !!";; |
104 --debugPDO) DEBUG=PDO; |
106 --debugPDO) DEBUG=PDO; |
105 echo "Debug messages (PDO) enabled !!";; |
107 echo "Debug messages (PDO) enabled !!";; |
106 --enable-lss) SUB_LSS_ENABLE=YES; |
108 --enable-lss) SUB_LSS_ENABLE=YES; |
107 echo "On user request: Will enable Auto Baudrate detect Feature";; |
109 echo "On user request: Will enable Auto Baudrate detect Feature";; |
108 --enable-led) SUB_LED_ENABLE=YES; |
|
109 echo "On user request: Will enable diagnostic LED feature";; |
|
110 --enable-nvram) SUB_NVRAM_ENABLE=YES; |
|
111 echo "On user request: Will enable Non Volatile RAM Feature";; |
|
112 --desable-timers) SUB_TIMERS_ENABLE=NO; |
110 --desable-timers) SUB_TIMERS_ENABLE=NO; |
113 echo "On user request: Will enable built-in timer dispatch Feature";; |
111 echo "On user request: Will enable built-in timer dispatch Feature";; |
114 --MAX_CAN_BUS_ID=*) MAX_CAN_BUS_ID=$1;; |
112 --MAX_CAN_BUS_ID=*) MAX_CAN_BUS_ID=$1;; |
115 --SDO_MAX_LENGTH_TRANSFERT=*) SDO_MAX_LENGTH_TRANSFERT=$1;; |
113 --SDO_MAX_LENGTH_TRANSFERT=*) SDO_MAX_LENGTH_TRANSFERT=$1;; |
116 --SDO_MAX_SIMULTANEOUS_TRANSFERTS=*) SDO_MAX_SIMULTANEOUS_TRANSFERTS=$1;; |
114 --SDO_MAX_SIMULTANEOUS_TRANSFERTS=*) SDO_MAX_SIMULTANEOUS_TRANSFERTS=$1;; |
129 echo " or" |
127 echo " or" |
130 echo " \"hcs12\" for HCS12 micro-controller" |
128 echo " \"hcs12\" for HCS12 micro-controller" |
131 echo " \"ecos_lpc2138_sja1000\" for eCOS + Philips ARM LPC21381 + Philips SJA1000" |
129 echo " \"ecos_lpc2138_sja1000\" for eCOS + Philips ARM LPC21381 + Philips SJA1000" |
132 echo " --can=foo Use 'foo' as CAN driver (can be either 'peak' or 'virtual')" |
130 echo " --can=foo Use 'foo' as CAN driver (can be either 'peak' or 'virtual')" |
133 echo " --timers=foo Use 'foo' as TIMERS driver (can be either 'unix' or 'xenomai')" |
131 echo " --timers=foo Use 'foo' as TIMERS driver (can be either 'unix' or 'xenomai')" |
|
132 echo " --led=foo Use 'foo' as DS-305 LED driver (use 'none' to disable or 'stdout')" |
|
133 echo " --nvram=foo Use 'foo' as NVRAM driver (use 'none' to disable or 'file')" |
134 echo " --disable-Ox Disable gcc \"-Ox\" optimizations." |
134 echo " --disable-Ox Disable gcc \"-Ox\" optimizations." |
135 echo " --enable-jaxe Enable \"jaxe\" installation." |
135 echo " --enable-jaxe Enable \"jaxe\" installation." |
136 echo " --debug Enable debug messages." |
136 echo " --debug Enable debug messages." |
137 echo " --debugPDO Enable debug messages, using PDO." |
137 echo " --debugPDO Enable debug messages, using PDO." |
138 echo " --enable-lss Enable Auto Baudrate detect Feature" |
138 echo " --enable-lss Enable Auto Baudrate detect Feature" |
139 echo " --enable-led Enable DS-305 LED diagnistic Feature" |
|
140 echo " --enable-nvram Enable Non-volatile RAM managment Feature" |
|
141 echo " --enable-timers Enable built-in schuduler Feature" |
|
142 echo " --enable- Enable Feature" |
|
143 echo |
139 echo |
144 echo "Stack compilation constants" |
140 echo "Stack compilation constants" |
145 echo " --MAX_CAN_BUS_ID [=1] Number of can bus to use" |
141 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" |
142 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" |
143 echo " --SDO_MAX_SIMULTANEOUS_TRANSFERTS [=4] Number of SDO that the node can manage concurrently" |
181 else |
177 else |
182 echo "Choosing virtual CAN driver." |
178 echo "Choosing virtual CAN driver." |
183 SUB_CAN_DRIVER=virtual |
179 SUB_CAN_DRIVER=virtual |
184 SUB_LED_ENABLE=YES |
180 SUB_LED_ENABLE=YES |
185 fi |
181 fi |
|
182 fi |
|
183 |
|
184 if [ "$SUB_TARGET" = "generic" -a "$SUB_LED_DRIVER" = "" ]; then |
|
185 echo "Choosing stdout LED driver." |
|
186 SUB_LED_DRIVER=stdout |
|
187 fi |
|
188 |
|
189 if [ "$SUB_TARGET" = "generic" -a "$SUB_NVRAM_DRIVER" = "" ]; then |
|
190 echo "Choosing binary file NVRAM driver. -- not implemented --" |
|
191 # SUB_NVRAM_DRIVER=file |
186 fi |
192 fi |
187 |
193 |
188 # If target generic, try to gess timers |
194 # If target generic, try to gess timers |
189 if [ "$SUB_TARGET" = "generic" -a "$SUB_TIMERS_DRIVER" = "" ]; then |
195 if [ "$SUB_TARGET" = "generic" -a "$SUB_TIMERS_DRIVER" = "" ]; then |
190 echo "Choosing unix timers driver." |
196 echo "Choosing unix timers driver." |
413 SUB_LSS_ENABLE=YES |
419 SUB_LSS_ENABLE=YES |
414 SUB_LED_ENABLE=YES |
420 SUB_LED_ENABLE=YES |
415 SUB_NVRAM_ENABLE=YES |
421 SUB_NVRAM_ENABLE=YES |
416 # ecos driver implement its own timers |
422 # ecos driver implement its own timers |
417 SUB_TIMERS_ENABLE=NO |
423 SUB_TIMERS_ENABLE=NO |
418 # SUB_TIMERS_DRIVER=ecos |
|
419 # SUB_CAN_DRIVER=ecos_lpc2138_sja1000 |
|
420 |
|
421 fi |
424 fi |
422 |
425 |
423 |
426 |
424 #### CAN_DRIVER #### |
427 #### CAN_DRIVER #### |
425 |
428 |
426 if [ "$SUB_CAN_DRIVER" = "peak" ]; then |
429 if [ "$SUB_CAN_DRIVER" = "peak" ]; then |
427 SUB_EXE_CFLAGS=$SUB_EXE_CFLAGS\ -lpcan |
430 SUB_EXE_CFLAGS=$SUB_EXE_CFLAGS\ -lpcan |
428 fi |
431 fi |
429 |
432 |
430 if [ "$SUB_CAN_DRIVER" = "ecos_lpc2138_sja1000" ]; then |
|
431 SUB_EXE_CFLAGS=$SUB_EXE_CFLAGS\ |
|
432 fi |
|
433 |
|
434 |
|
435 #### TIMERS_DRIVER #### |
433 #### TIMERS_DRIVER #### |
436 |
|
437 if [ "$SUB_TIMERS_DRIVER" = "ecos" ]; then |
|
438 SUB_EXE_CFLAGS=$SUB_EXE_CFLAGS\ -llpthread |
|
439 fi |
|
440 |
434 |
441 if [ "$SUB_TIMERS_DRIVER" = "unix" ]; then |
435 if [ "$SUB_TIMERS_DRIVER" = "unix" ]; then |
442 SUB_EXE_CFLAGS=$SUB_EXE_CFLAGS\ -lpthread |
436 SUB_EXE_CFLAGS=$SUB_EXE_CFLAGS\ -lpthread |
443 fi |
437 fi |
444 |
438 |
445 if [ "$SUB_TIMERS_DRIVER" = "xeno" ]; then |
439 if [ "$SUB_TIMERS_DRIVER" = "xeno" ]; then |
446 SUB_EXE_CFLAGS=$SUB_EXE_CFLAGS\ -lnative\ |
440 SUB_EXE_CFLAGS=$SUB_EXE_CFLAGS\ -lnative\ |
447 \ -L`$XENO_CONFIG --library-dir` |
441 \ -L`$XENO_CONFIG --library-dir` |
448 SUB_PROG_CFLAGS=$SUB_PROG_CFLAGS\ `$XENO_CONFIG --xeno-cflags` |
442 SUB_PROG_CFLAGS=$SUB_PROG_CFLAGS\ `$XENO_CONFIG --xeno-cflags` |
|
443 fi |
|
444 |
|
445 #### LED_DRIVER #### |
|
446 #enable led support if a led driver have been selected. |
|
447 if [ "$SUB_LED_DRIVER" != "" ]; then |
|
448 SUB_LED_ENABLE=YES |
|
449 fi |
|
450 #if "none" driver is selected led feature is enabled but driver not compiled |
|
451 if [ "$SUB_LED_DRIVER" = "none" ]; then |
|
452 SUB_LED_DRIVER= |
|
453 fi |
|
454 #if "disable" driver is selected led feature is disabled |
|
455 if [ "$SUB_LED_DRIVER" = "disable" ]; then |
|
456 SUB_LED_ENABLE= |
|
457 SUB_LED_DRIVER= |
|
458 fi |
|
459 |
|
460 #### NVRAM_DRIVER #### |
|
461 #enable nvram support if a nvram driver have been selected. |
|
462 if [ "$SUB_NVRAM_DRIVER" != "" ]; then |
|
463 SUB_NVRAM_ENABLE=YES |
|
464 fi |
|
465 #if "none" driver is selected nvram feature is enabled but driver not compiled |
|
466 if [ "$SUB_NVRAM_DRIVER" = "none" ]; then |
|
467 SUB_NVRAM_DRIVER= |
|
468 fi |
|
469 #if "disable" driver is selected nvram feature is disabled |
|
470 if [ "$SUB_NVRAM_DRIVER" = "disable" ]; then |
|
471 SUB_NVRAM_ENABLE= |
|
472 SUB_NVRAM_DRIVER= |
449 fi |
473 fi |
450 |
474 |
451 ########################################################################### |
475 ########################################################################### |
452 # GUESS COMPILER # |
476 # GUESS COMPILER # |
453 ########################################################################### |
477 ########################################################################### |
603 if [ "$SUB_CAN_DRIVER" != "" ]; then |
627 if [ "$SUB_CAN_DRIVER" != "" ]; then |
604 MAKEFILES=$MAKEFILES\ |
628 MAKEFILES=$MAKEFILES\ |
605 \ drivers/can_$SUB_CAN_DRIVER/Makefile.in |
629 \ drivers/can_$SUB_CAN_DRIVER/Makefile.in |
606 fi |
630 fi |
607 |
631 |
|
632 if [ "$SUB_LED_DRIVER" != "" ]; then |
|
633 MAKEFILES=$MAKEFILES\ |
|
634 \ drivers/led_$SUB_LED_DRIVER/Makefile.in |
|
635 fi |
|
636 |
|
637 if [ "$SUB_NVRAM_DRIVER" != "" ]; then |
|
638 MAKEFILES=$MAKEFILES\ |
|
639 \ drivers/nvram_$SUB_NVRAM_DRIVER/Makefile.in |
|
640 fi |
|
641 |
608 if [ "$SUB_TARGET" = "generic" ]; then |
642 if [ "$SUB_TARGET" = "generic" ]; then |
609 MAKEFILES=$MAKEFILES\ |
643 MAKEFILES=$MAKEFILES\ |
610 \ drivers/generic/Makefile.in\ |
644 \ drivers/generic/Makefile.in\ |
611 \ examples/AppliMaster_Linux/Makefile.in\ |
645 \ examples/AppliMaster_Linux/Makefile.in\ |
612 \ examples/AppliSlave_Linux/Makefile.in\ |
646 \ examples/AppliSlave_Linux/Makefile.in\ |
637 s:SUB_LED_ENABLE:${SUB_LED_ENABLE}: |
671 s:SUB_LED_ENABLE:${SUB_LED_ENABLE}: |
638 s:SUB_NVRAM_ENABLE:${SUB_NVRAM_ENABLE}: |
672 s:SUB_NVRAM_ENABLE:${SUB_NVRAM_ENABLE}: |
639 s:SUB_TIMERS_ENABLE:${SUB_TIMERS_ENABLE}: |
673 s:SUB_TIMERS_ENABLE:${SUB_TIMERS_ENABLE}: |
640 s:SUB_TIMERS_DRIVER:timers_${SUB_TIMERS_DRIVER}: |
674 s:SUB_TIMERS_DRIVER:timers_${SUB_TIMERS_DRIVER}: |
641 s:SUB_CAN_DRIVER:can_${SUB_CAN_DRIVER}: |
675 s:SUB_CAN_DRIVER:can_${SUB_CAN_DRIVER}: |
|
676 s:SUB_LED_DRIVER:led_${SUB_LED_DRIVER}: |
|
677 s:SUB_NVRAM_DRIVER:nvram_${SUB_NVRAM_DRIVER}: |
642 " > $makefile |
678 " > $makefile |
643 done |
679 done |
644 |
680 |
645 echo "All done." |
681 echo "All done." |