diff --git a/build/linux/dist/processing b/build/linux/dist/arduino similarity index 89% rename from build/linux/dist/processing rename to build/linux/dist/arduino index 076f67563..28a2a2f59 100755 --- a/build/linux/dist/processing +++ b/build/linux/dist/arduino @@ -1,6 +1,6 @@ #!/bin/sh -CLASSPATH=java/lib/rt.jar:lib:lib/build:lib/pde.jar:lib/core.jar:lib/antlr.jar:lib/oro.jar:lib/registry.jar:lib/mrj.jar +CLASSPATH=java/lib/rt.jar:lib:lib/build:lib/pde.jar:lib/core.jar:lib/antlr.jar:lib/oro.jar:lib/registry.jar:lib/mrj.jar:lib/RXTXcomm.jar export CLASSPATH # put the directory where this file lives in the front of the path, because @@ -9,6 +9,10 @@ export CLASSPATH PATH=`pwd`/`dirname $0`:`pwd`/java/bin:${PATH} export PATH +# put the directory with the native RXTX libs in the library path +LD_LIBRARY_PATH=`pwd`/lib:${LD_LIBRARY_PATH} +export LD_LIBRARY_PATH + # test to see if jikes is operable. i'm a crappy bash scripter # so if someone knows a more elegant way to do this, let me know. # diff --git a/build/linux/dist/bootloader/burn b/build/linux/dist/bootloader/burn new file mode 100755 index 000000000..6f1b06c77 --- /dev/null +++ b/build/linux/dist/bootloader/burn @@ -0,0 +1,30 @@ +#!/bin/sh + +# 25.06.2005 mbanzi +# +# Arduino project http://arduino.berlios.de +# +# quick and dirty script to set the proper fuses and lock bits +# while loading the bootloader onto a brand new arduino board +# +# very useful also when for some reasons the bootloader disappears +# +# TODO: cleanup and make it more user friendly +# TODO: move this (and related) scripts to platform dist/ dirs +# +# expects an STK500 compatible programmer on the specified serial port +# if you use the parallel port programmer you need to change the dprog +# parametre +# + +#BINDIR=/usr/local/avr/bin +#BINDIR=../build/macosx/work/tools/avr/bin +PORT=/dev/ttyS0 +#PORT=/dev/tty.usbserial0 +#PORT=/dev/tty.USA19QW3b1P1.1 +#PORT=/dev/tty.USA19QW1b1P1.1 + +uisp -dpart=ATmega8 -dprog=stk500 -dserial=$PORT -dspeed=115200 --wr_lock=0xFF +uisp -dpart=ATmega8 -dprog=stk500 -dserial=$PORT -dspeed=115200 --wr_fuse_l=0xdf --wr_fuse_h=0xc8 +uisp -dpart=ATmega8 -dprog=stk500 -dserial=$PORT -dspeed=115200 --erase --upload if=ATMegaBOOT.hex -v +uisp -dpart=ATmega8 -dprog=stk500 -dserial=$PORT -dspeed=115200 --wr_lock=0xCF diff --git a/build/linux/dist/jikes b/build/linux/dist/jikes deleted file mode 100755 index 21035b3da..000000000 Binary files a/build/linux/dist/jikes and /dev/null differ diff --git a/build/linux/dist/lib/librxtxI2C.so b/build/linux/dist/lib/librxtxI2C.so new file mode 100755 index 000000000..07f77edf7 Binary files /dev/null and b/build/linux/dist/lib/librxtxI2C.so differ diff --git a/build/linux/dist/lib/librxtxParallel.so b/build/linux/dist/lib/librxtxParallel.so new file mode 100755 index 000000000..ca14064ff Binary files /dev/null and b/build/linux/dist/lib/librxtxParallel.so differ diff --git a/build/linux/dist/lib/librxtxRS485.so b/build/linux/dist/lib/librxtxRS485.so new file mode 100755 index 000000000..5176ac71f Binary files /dev/null and b/build/linux/dist/lib/librxtxRS485.so differ diff --git a/build/linux/dist/lib/librxtxRaw.so b/build/linux/dist/lib/librxtxRaw.so new file mode 100755 index 000000000..19bb413c1 Binary files /dev/null and b/build/linux/dist/lib/librxtxRaw.so differ diff --git a/build/linux/dist/lib/librxtxSerial.so b/build/linux/dist/lib/librxtxSerial.so new file mode 100755 index 000000000..dd9bf81c8 Binary files /dev/null and b/build/linux/dist/lib/librxtxSerial.so differ diff --git a/build/linux/make.sh b/build/linux/make.sh index 7a5bc8374..d2608ec26 100755 --- a/build/linux/make.sh +++ b/build/linux/make.sh @@ -1,159 +1,105 @@ #!/bin/sh +# Part of the Arduino project +# http://arduino.berlios.de +# +# this is derived from the processing project +# http://www.processing.org +# +# This file is subjected to the GPL License + +# NOTE: before running this script, you must set CLASSPATH to +# your standard Java classpath, and DIRAVR to the root of your +# avr-gcc installation. + ### -- SETUP WORK DIR ------------------------------------------- -if test -d work +if test -d work then BUILD_PREPROC=false else - echo Setting up directories to build for linux... BUILD_PREPROC=true - cp -r ../shared work # needs to make the dir because of packaging goofiness + echo Setting up directories to build under Linux mkdir -p work/classes/processing/app/preproc mkdir -p work/classes/processing/app/syntax mkdir -p work/classes/processing/app/tools + mkdir -p work/lib/build + mkdir -p work/examples - #cp -r ../../lib work/libraries - cp -r ../../net work/libraries/ - cp -r ../../opengl work/libraries/ - cp -r ../../serial work/libraries/ - cp -r ../../video work/libraries/ + #need to replace this with the linux native library for RXTX + #cp ../../lib/librxtxSerial.jnilib work/ - cd work - unzip -q examples.zip - rm examples.zip - cd .. + cp dist/arduino work/ + + # copy the avr-gcc distribution + #echo Copying tools \(this may take a minute\)... - cd work - unzip -q reference.zip - rm reference.zip - cd .. - - tar --extract --file=jre.tgz --ungzip --directory=work - - #mkdir work/lib/export - mkdir work/lib/build - #mkdir work/classes - - # get the serial stuff - #echo Copying serial support from bagel dir - #cp ../../bagel/serial/RXTXcomm.jar work/lib/ - #mkdir work/lib/i386 - #cp ../../bagel/serial/librxtxSerial.so work/lib/i386/libSerial.so - #chmod +x work/librxtxSerial.so - - # get jikes and depedencies - cp dist/jikes work/ - chmod +x work/jikes - - install -m 755 dist/processing work/processing + # for now, require all linux users to install avr-gcc themselves + #cp -pR dist/tools.zip work/ + #cd work + #unzip -oq tools.zip + #rm tools.zip + #cd .. fi +echo Copying shared and core files... +cp -r ../shared/* work +cp -r ../../core work + +echo Extracting examples... +unzip -d work/examples ../shared/dist/examples.zip + +echo Copying dist files... +cp -r dist/lib work/ +cp -r dist/core work/ +cp -r dist/bootloader work/ + +### -- START BUILDING ------------------------------------------- + +# move to root 'arduino' directory cd ../.. +### -- BUILD GCC ------------------------------------------------ +# in the future we will build avr-gcc and tools (if they don't exist) -### -- BUILD CORE ---------------------------------------------- - - -echo Building processing.core - -# move to bagel inside base 'processing' directory -cd core - -# new regular version -CLASSPATH="../build/linux/work/java/lib/rt.jar" -export CLASSPATH - -perl preproc.pl -../build/linux/work/jikes -d . +D -target 1.1 *.java -zip -rq ../build/linux/work/lib/core.jar processing -rm -rf processing - - -# back to base processing dir +### -- BUILD BOOTLOADER ---------------------------------------- +cd bootloader +make +cp ATmegaBOOT.hex ../build/linux/work/bootloader cd .. - -### -- BUILD PREPROC ------------------------------------------------ - -echo Building PDE for JDK 1.3 - -cd app/preproc - -# first build the default java goop -# long path is to avoid requiring java to be in your PATH - -../../build/linux/work/java/bin/java \ - -cp ../../build/linux/work/lib/antlr.jar antlr.Tool java.g - -# now build the pde stuff that extends the java classes -../../build/linux/work/java/bin/java \ - -cp ../../build/linux/work/lib/antlr.jar antlr.Tool -glib java.g pde.g - -cd ../.. - - -### -- BUILD PDE ------------------------------------------------ +### -- BUILD PARSER --------------------------------------------- cd app -CLASSPATH="../build/linux/work/lib/core.jar:../build/linux/work/lib/mrj.jar:../build/linux/work/lib/antlr.jar:../build/linux/work/lib/oro.jar:../build/linux/work/lib/registry.jar:../build/linux/work/java/lib/rt.jar" +if $BUILD_PREPROC +then + cd preproc + # build classes/grammar for preprocessor + echo Building antlr grammar code... + # first build the default java goop + java -cp ../../build/linux/work/lib/antlr.jar antlr.Tool java.g + # now build the pde stuff that extends the java classes + java -cp ../../build/linux/work/lib/antlr.jar antlr.Tool -glib java.g pde.g + cd .. +fi -../build/linux/work/jikes -target 1.3 +D -classpath $CLASSPATH:../build/linux/work/classes -d ../build/linux/work/classes *.java preproc/*.java syntax/*.java tools/*.java +### -- BUILD PDE ------------------------------------------------ + +echo Building the PDE... + +# compile the code as java 1.3, so that the application will run and +# show the user an error, rather than crapping out with some strange +# "class not found" crap +jikes -target 1.3 +D -classpath ../build/linux/work/classes:../build/linux/work/lib/antlr.jar:../build/linux/work/lib/oro.jar:../build/linux/work/lib/registry.jar:../build/linux/work/lib/RXTXcomm.jar:../build/linux/work/lib/mrj.jar:$CLASSPATH -d ../build/linux/work/classes tools/*.java preproc/*.java syntax/*.java *.java cd ../build/linux/work/classes rm -f ../lib/pde.jar zip -0rq ../lib/pde.jar . -cd ../../../.. +cd ../.. - -### -- BUILD LIBRARIES ------------------------------------------------ - -cd build/linux - -PLATFORM=linux - -#CLASSPATH="../../build/linux/work/lib/core.jar:../../build/linux/work/java/lib/rt.jar" -CLASSPATH=../build/$PLATFORM/work/lib/core.jar:$CLASSPATH -JIKES=../build/$PLATFORM/work/jikes -CORE=../build/$PLATFORM/work/lib/core.jar -LIBRARIES=../build/$PLATFORM/work/libraries - -# move to processing/build -cd .. - - -# SERIAL LIBRARY -echo Building serial library... -cd ../serial -$JIKES -target 1.1 +D -classpath "code/RXTXcomm.jar:$CORE:$CLASSPATH" -d . *.java -rm -f library/serial.jar -zip -r0q library/serial.jar processing -rm -rf processing -mkdir -p $LIBRARIES/serial/library/ -cp library/serial.jar $LIBRARIES/serial/library/ - - -# NET LIBRARY -echo Building net library... -cd ../net -$JIKES -target 1.1 +D -d . *.java -rm -f library/net.jar -zip -r0q library/net.jar processing -rm -rf processing -mkdir -p $LIBRARIES/net/library/ -cp library/net.jar $LIBRARIES/net/library/ - - -# OPENGL LIBRARY -echo Building OpenGL library... -cd ../opengl -$JIKES -target 1.1 +D -classpath "library/jogl.jar:$CLASSPATH" -d . *.java -rm -f library/opengl.jar -zip -r0q library/opengl.jar processing -rm -rf processing -mkdir -p $LIBRARIES/opengl/library/ -cp library/opengl.jar $LIBRARIES/opengl/library/ +echo +echo Done. diff --git a/build/linux/run.sh b/build/linux/run.sh index 29ccd3aa9..78c5c0f44 100755 --- a/build/linux/run.sh +++ b/build/linux/run.sh @@ -1,3 +1,3 @@ #!/bin/sh -cd work && ./processing && cd .. +cd work && ./arduino && cd ..