121 echo " --cc=foo Use compiler 'foo' instead of defaults ${CC1} or ${CC2}." |
123 echo " --cc=foo Use compiler 'foo' instead of defaults ${CC1} or ${CC2}." |
122 echo " --arch=foo Use architecture 'foo' instead of trying to autodetect." |
124 echo " --arch=foo Use architecture 'foo' instead of trying to autodetect." |
123 echo " --os=foo Use operative system 'foo' instead of trying to autodetect." |
125 echo " --os=foo Use operative system 'foo' instead of trying to autodetect." |
124 echo " --prefix=foo Use prefix 'foo' instead of default ${SUB_PREFIX}." |
126 echo " --prefix=foo Use prefix 'foo' instead of default ${SUB_PREFIX}." |
125 echo " --target=foo Use 'foo' as build target." |
127 echo " --target=foo Use 'foo' as build target." |
126 echo " Where 'foo' can be \"generic\" to have independant CAN and TIMERS driver" |
128 echo " \"generic\" for have independant CAN and TIMERS driver" |
127 echo " or" |
129 echo " \"unix\" for unix-like systems" |
|
130 echo " \"win32\" for win32 systems" |
128 echo " \"hcs12\" for HCS12 micro-controller" |
131 echo " \"hcs12\" for HCS12 micro-controller" |
129 echo " \"ecos_lpc2138_sja1000\" for eCOS + Philips ARM LPC21381 + Philips SJA1000" |
132 echo " \"ecos_lpc2138_sja1000\" for eCOS + Philips ARM LPC21381 + Philips SJA1000" |
130 echo " --can=foo Use 'foo' as CAN driver (can be either 'peak' or 'virtual')" |
133 echo " --can=foo Use 'foo' as CAN driver (can be either 'peak' or 'virtual')" |
131 echo " --timers=foo Use 'foo' as TIMERS driver (can be either 'unix' or 'xenomai')" |
134 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')" |
135 echo " --led=foo Use 'foo' as DS-305 LED driver (use 'none' to disable or 'stdout')" |
159 echo "Could not find java VM ! Jaxe XML editor disabled !" |
162 echo "Could not find java VM ! Jaxe XML editor disabled !" |
160 else |
163 else |
161 SUB_OPT_JAXE=jaxe |
164 SUB_OPT_JAXE=jaxe |
162 fi |
165 fi |
163 fi |
166 fi |
164 ########################################################################### |
|
165 # DEFAULT TARGET/DRIVERS GUESSING # |
|
166 ########################################################################### |
|
167 # If target not specified, try to gess one |
|
168 if [ "$SUB_TARGET" = "" ]; then |
|
169 SUB_TARGET=generic |
|
170 fi |
|
171 |
|
172 # If target generic, try to gess can |
|
173 if [ "$SUB_TARGET" = "generic" -a "$SUB_CAN_DRIVER" = "" ]; then |
|
174 if [ -e /usr/lib/libpcan.so ]; then |
|
175 echo "Choosing installed Peak driver as CAN driver." |
|
176 SUB_CAN_DRIVER=peak |
|
177 else |
|
178 echo "Choosing virtual CAN driver." |
|
179 SUB_CAN_DRIVER=virtual |
|
180 SUB_LED_ENABLE=YES |
|
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 |
|
192 fi |
|
193 |
|
194 # If target generic, try to gess timers |
|
195 if [ "$SUB_TARGET" = "generic" -a "$SUB_TIMERS_DRIVER" = "" ]; then |
|
196 echo "Choosing unix timers driver." |
|
197 SUB_TIMERS_DRIVER=unix |
|
198 fi |
|
199 |
|
200 if [ "$SUB_CAN_DRIVER" = "peak" ]; then |
|
201 if [ ! -e /usr/lib/libpcan.so ]; then |
|
202 echo "Peak driver hasn't been installed !" |
|
203 exit -1 |
|
204 fi |
|
205 fi |
|
206 |
167 |
207 ########################################################################### |
168 ########################################################################### |
208 # GUESS OS/ARCH # |
169 # GUESS OS/ARCH # |
209 ########################################################################### |
170 ########################################################################### |
210 |
171 |
377 # For shared library generation, it needs this |
338 # For shared library generation, it needs this |
378 SUB_PROG_CFLAGS=-fPIC |
339 SUB_PROG_CFLAGS=-fPIC |
379 fi |
340 fi |
380 |
341 |
381 ########################################################################### |
342 ########################################################################### |
|
343 # DEFAULT TARGET/DRIVERS GUESSING # |
|
344 ########################################################################### |
|
345 # If target not specified, try to gess one |
|
346 if [ "$SUB_TARGET" = "" ]; then |
|
347 if [ "$SUB_OS_NAME" = "CYGWIN" ]; then |
|
348 echo "Choosing win32 target" |
|
349 SUB_TARGET=win32 |
|
350 else |
|
351 echo "Choosing unix target" |
|
352 SUB_TARGET=unix |
|
353 fi |
|
354 fi |
|
355 |
|
356 # Try to gess can |
|
357 if [ "$SUB_CAN_DRIVER" = "" ]; then |
|
358 if [ "$SUB_TARGET" = "unix" ]; then |
|
359 if [ -e /usr/lib/libpcan.so ]; then |
|
360 echo "Choosing installed Peak driver as CAN driver." |
|
361 SUB_CAN_DRIVER=peak |
|
362 else |
|
363 echo "Choosing virtual CAN driver." |
|
364 SUB_CAN_DRIVER=virtual |
|
365 fi |
|
366 fi |
|
367 if [ "$SUB_TARGET" = "win32" ]; then |
|
368 echo "CAN driver for windows --Not Implemented--" |
|
369 fi |
|
370 fi |
|
371 |
|
372 if [ "$SUB_TARGET" = "unix" -a "$SUB_LED_DRIVER" = "" ]; then |
|
373 echo "Choosing stdout LED driver." |
|
374 SUB_LED_DRIVER=stdout |
|
375 fi |
|
376 |
|
377 if [ "$SUB_TARGET" = "unix" -a "$SUB_NVRAM_DRIVER" = "" ]; then |
|
378 echo "Choosing binary file NVRAM driver. -- not implemented --" |
|
379 # SUB_NVRAM_DRIVER=file |
|
380 fi |
|
381 |
|
382 # If target is unix, default timers also |
|
383 if [ "$SUB_TARGET" = "unix" -a "$SUB_TIMERS_DRIVER" = "" ]; then |
|
384 echo "Choosing unix timers driver." |
|
385 SUB_TIMERS_DRIVER=unix |
|
386 fi |
|
387 |
|
388 # Warn for unstalled peak driver if choosen |
|
389 if [ "$SUB_CAN_DRIVER" = "peak" ]; then |
|
390 if [ ! -e /usr/lib/libpcan.so ]; then |
|
391 echo "Peak driver hasn't been installed !" |
|
392 exit -1 |
|
393 fi |
|
394 fi |
|
395 |
|
396 ########################################################################### |
382 # TARGET/DRIVER SPECIFIC CFLAGS and OPTIONS # |
397 # TARGET/DRIVER SPECIFIC CFLAGS and OPTIONS # |
383 ########################################################################### |
398 ########################################################################### |
|
399 if [ "$SUB_TARGET" = "generic" ]; then |
|
400 if [ "$US_TO_TIMEVAL_FACTOR" = "" ]; then |
|
401 US_TO_TIMEVAL_FACTOR=1 |
|
402 fi |
|
403 if [ "$TIMEVAL" = "" ]; then |
|
404 TIMEVAL=UNS64 |
|
405 fi |
|
406 if [ "$TIMEVAL_MAX" = "" ]; then |
|
407 TIMEVAL_MAX=0xffffffffffffffff |
|
408 fi |
|
409 fi |
|
410 |
384 if [ "$SUB_TARGET" = "hcs12" ]; then |
411 if [ "$SUB_TARGET" = "hcs12" ]; then |
385 # Only if we want to compile for a µC HCS12 |
412 # Only if we want to compile for a µC HCS12 |
386 # search for gcc hcs12 compiler m6811-elf-gcc or m68hc12-gcc ? |
413 # search for gcc hcs12 compiler m6811-elf-gcc or m68hc12-gcc ? |
387 if [ "$CC" = "" ]; then |
414 if [ "$CC" = "" ]; then |
388 which m6811-elf-gcc >/dev/null 2>&1 |
415 which m6811-elf-gcc >/dev/null 2>&1 |
603 fi |
637 fi |
604 |
638 |
605 ########################################################################### |
639 ########################################################################### |
606 # CREATE MAKEFILES # |
640 # CREATE MAKEFILES # |
607 ########################################################################### |
641 ########################################################################### |
|
642 # General Makefiles |
608 MAKEFILES=Makefile.in\ |
643 MAKEFILES=Makefile.in\ |
609 \ src/Makefile.in\ |
644 \ src/Makefile.in\ |
610 \ drivers/Makefile.in\ |
645 \ drivers/Makefile.in\ |
611 \ objdictgen/Makefile.in\ |
646 \ objdictgen/Makefile.in\ |
612 \ examples/Makefile.in |
647 \ examples/Makefile.in |
613 |
648 |
|
649 # Drivers dependent Makefiles |
|
650 if [ "$SUB_TIMERS_DRIVER" != "" ]; then |
|
651 MAKEFILES=$MAKEFILES\ |
|
652 \ drivers/timers_$SUB_TIMERS_DRIVER/Makefile.in |
|
653 fi |
|
654 |
|
655 if [ "$SUB_CAN_DRIVER" != "" ]; then |
|
656 MAKEFILES=$MAKEFILES\ |
|
657 \ drivers/can_$SUB_CAN_DRIVER/Makefile.in |
|
658 fi |
|
659 |
|
660 if [ "$SUB_LED_DRIVER" != "" ]; then |
|
661 MAKEFILES=$MAKEFILES\ |
|
662 \ drivers/led_$SUB_LED_DRIVER/Makefile.in |
|
663 fi |
|
664 |
|
665 if [ "$SUB_NVRAM_DRIVER" != "" ]; then |
|
666 MAKEFILES=$MAKEFILES\ |
|
667 \ drivers/nvram_$SUB_NVRAM_DRIVER/Makefile.in |
|
668 fi |
|
669 |
|
670 # Target dependent Makefiles |
|
671 MAKEFILES=$MAKEFILES\ drivers/$SUB_TARGET/Makefile.in |
|
672 |
|
673 if [ "$SUB_TARGET" = "unix" ]; then |
|
674 MAKEFILES=$MAKEFILES\ |
|
675 \ examples/AppliMaster_Linux/Makefile.in\ |
|
676 \ examples/AppliSlave_Linux/Makefile.in\ |
|
677 \ examples/TestMasterSlave/Makefile.in |
|
678 fi |
|
679 |
614 if [ "$SUB_TARGET" = "hcs12" ]; then |
680 if [ "$SUB_TARGET" = "hcs12" ]; then |
615 MAKEFILES=$MAKEFILES\ |
681 MAKEFILES=$MAKEFILES\ |
616 \ drivers/hcs12/Makefile.in\ |
|
617 \ examples/AppliMaster_HCS12/Makefile.in\ |
682 \ examples/AppliMaster_HCS12/Makefile.in\ |
618 \ examples/AppliSlave_HCS12/Makefile.in\ |
683 \ examples/AppliSlave_HCS12/Makefile.in\ |
619 \ examples/gene_SYNC_HCS12/Makefile.in |
684 \ examples/gene_SYNC_HCS12/Makefile.in |
620 fi |
685 fi |
621 |
686 |
622 if [ "$SUB_TIMERS_DRIVER" != "" ]; then |
|
623 MAKEFILES=$MAKEFILES\ |
|
624 \ drivers/timers_$SUB_TIMERS_DRIVER/Makefile.in |
|
625 fi |
|
626 |
|
627 if [ "$SUB_CAN_DRIVER" != "" ]; then |
|
628 MAKEFILES=$MAKEFILES\ |
|
629 \ drivers/can_$SUB_CAN_DRIVER/Makefile.in |
|
630 fi |
|
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 |
|
642 if [ "$SUB_TARGET" = "generic" ]; then |
|
643 MAKEFILES=$MAKEFILES\ |
|
644 \ drivers/generic/Makefile.in\ |
|
645 \ examples/AppliMaster_Linux/Makefile.in\ |
|
646 \ examples/AppliSlave_Linux/Makefile.in\ |
|
647 \ examples/TestMasterSlave/Makefile.in |
|
648 fi |
|
649 |
|
650 if [ "$SUB_TARGET" = "ecos_lpc2138_sja1000" ]; then |
687 if [ "$SUB_TARGET" = "ecos_lpc2138_sja1000" ]; then |
651 MAKEFILES=$MAKEFILES\ |
688 MAKEFILES=$MAKEFILES\ |
652 \ drivers/ecos_lpc2138_sja1000/Makefile.in\ |
|
653 \ examples/ecos_lpc2138_sja1000/src/Makefile.in |
689 \ examples/ecos_lpc2138_sja1000/src/Makefile.in |
654 fi |
690 fi |
655 |
691 |
656 for makefile_in in $MAKEFILES; do |
692 for makefile_in in $MAKEFILES; do |
657 makefile=`echo $makefile_in | sed 's:.in$::'` |
693 makefile=`echo $makefile_in | sed 's:.in$::'` |