mirror of
https://github.com/esp8266/Arduino.git
synced 2025-07-30 16:24:09 +03:00
Initial Arduino IDE based on Processing.
This commit is contained in:
2
build/macosx/.cvsignore
Normal file
2
build/macosx/.cvsignore
Normal file
@ -0,0 +1,2 @@
|
||||
work*
|
||||
processing-0000-macosx
|
132
build/macosx/dist.sh
Executable file
132
build/macosx/dist.sh
Executable file
@ -0,0 +1,132 @@
|
||||
#!/bin/sh
|
||||
|
||||
# part of the arduino project http://arduino.berlios.de
|
||||
# take from processing http://www.processing.org
|
||||
# by Ben Fry, Casey Reas et al
|
||||
#
|
||||
# the power of open source
|
||||
|
||||
|
||||
# prefers that fink is intalled, but not required
|
||||
if test -f /sw/bin/head
|
||||
then
|
||||
# old 4 char version.. osx only uses the two chars
|
||||
#REVISION=`head -c 4 ../../todo.txt`
|
||||
# a more useful version of head than what's included with osx
|
||||
SHORT_REVISION=`/sw/bin/head -c 4 ../../todo.txt | tail -c 2`
|
||||
REVISION=`/sw/bin/head -c 4 ../../todo.txt`
|
||||
|
||||
VERSIONED=`cat ../../app/Base.java | grep $REVISION`
|
||||
if [ -z "$VERSIONED" ]
|
||||
then
|
||||
echo Fix the revision number in Base.java
|
||||
exit
|
||||
fi
|
||||
|
||||
else
|
||||
# can't get four bytes of head (osx doesn't support -c)
|
||||
SHORT_REVISION=00
|
||||
REVISION=0000
|
||||
fi
|
||||
|
||||
|
||||
./make.sh
|
||||
|
||||
echo Creating Arduino distribution for revision $REVISION...
|
||||
|
||||
# remove any old boogers
|
||||
rm -rf arduino
|
||||
rm -rf Arduino*
|
||||
rm -rf arduino-*
|
||||
|
||||
mkdir arduino
|
||||
|
||||
|
||||
# use 'shared' files as starting point
|
||||
cp -r ../shared arduino
|
||||
|
||||
# add the libraries folder with source
|
||||
#cp -r ../../lib arduino/libraries
|
||||
|
||||
|
||||
# new style examples thing ala reas
|
||||
# not there yet in arduino
|
||||
# cd arduino
|
||||
# unzip -q examples.zip
|
||||
# rm examples.zip
|
||||
# cd ..
|
||||
|
||||
# new style reference
|
||||
# not there yet in arduino
|
||||
# cd arduino
|
||||
# unzip -q reference.zip
|
||||
# rm reference.zip
|
||||
# cd ..
|
||||
|
||||
# get ds_store file (!)
|
||||
cp dist/DS_Store arduino/.DS_Store
|
||||
|
||||
# get package from the dist dir
|
||||
cp -R dist/Arduino.app arduino/
|
||||
chmod +x arduino/Arduino.app/Contents/MacOS/JavaApplicationStub
|
||||
|
||||
# put jar files into the resource dir, leave the rest in lib
|
||||
RES=arduino/Arduino.app/Contents/Resources/Java
|
||||
mkdir -p $RES
|
||||
mv work/lib/*.jar $RES/
|
||||
|
||||
# directories used by the app
|
||||
#mkdir arduino/lib/build
|
||||
|
||||
# grab pde.jar and export from the working dir
|
||||
cp work/Arduino.app/Contents/Resources/Java/pde.jar $RES/
|
||||
|
||||
# removed dependecies from the processing core
|
||||
#cp work/lib/core.jar arduino/lib/
|
||||
|
||||
# get platform-specific goodies from the dist dir
|
||||
#cp `which jikes` arduino
|
||||
#gunzip < dist/jikes.gz > arduino/jikes
|
||||
|
||||
# not needed in arduino
|
||||
# cp dist/jikes arduino/
|
||||
# chmod a+x arduino /jikes
|
||||
|
||||
chmod a+x arduino/Arduino.app/Contents/MacOS/JavaApplicationStub
|
||||
|
||||
#cd ../..
|
||||
#javadoc -public -d doc app/*.java app/preproc/*.java app/syntax/*.java core/*.java opengl/*.java net/*.java video/*.java serial/*.java
|
||||
#cd build/macosx
|
||||
|
||||
# remove boogers
|
||||
find arduino -name "*~" -exec rm -f {} ';'
|
||||
# need to leave ds store stuff cuz one of those is important
|
||||
#find arduino -name ".DS_Store" -exec rm -f {} ';'
|
||||
find arduino -name "._*" -exec rm -f {} ';'
|
||||
find arduino -name "Thumbs.db" -exec rm -f {} ';'
|
||||
|
||||
# clean out the cvs entries
|
||||
find arduino -name "CVS" -exec rm -rf {} ';' 2> /dev/null
|
||||
find arduino -name ".cvsignore" -exec rm -rf {} ';'
|
||||
|
||||
mv arduino/Arduino.app "arduino/Arduino $SHORT_REVISION.app"
|
||||
mv arduino arduino-$REVISION
|
||||
|
||||
# don't have deluxe on my laptop right now
|
||||
#stuff -f sitx arduino-$REVISION
|
||||
|
||||
# zip it all up for release
|
||||
#NICE_FOLDER="Arduino $SHORT_REVISION"
|
||||
#DMG_NAME="arduino-$REVISION"
|
||||
#mv arduino "$NICE_FOLDER"
|
||||
#chmod +x mkdmg
|
||||
#./mkdmg "$NICE_FOLDER" "Arduino"
|
||||
#mv "$NICE_FOLDER.dmg" "$DMG_NAME.dmg"
|
||||
|
||||
# actually, could probably use:
|
||||
# open arduino-uncomp.dmg
|
||||
# rm -rf /Volumes/Arduino/Arduino*
|
||||
# mv "Arduino $REVISION" /Volumes/Arduino
|
||||
# umount /Volumes/Arduino
|
||||
|
||||
echo Done.
|
1
build/macosx/dist/Arduino.app/CVS/Entries
vendored
Normal file
1
build/macosx/dist/Arduino.app/CVS/Entries
vendored
Normal file
@ -0,0 +1 @@
|
||||
D/Contents////
|
1
build/macosx/dist/Arduino.app/CVS/Repository
vendored
Normal file
1
build/macosx/dist/Arduino.app/CVS/Repository
vendored
Normal file
@ -0,0 +1 @@
|
||||
/cvsroot/processing/processing/build/macosx/dist/Processing.app
|
1
build/macosx/dist/Arduino.app/CVS/Root
vendored
Normal file
1
build/macosx/dist/Arduino.app/CVS/Root
vendored
Normal file
@ -0,0 +1 @@
|
||||
:pserver:anonymous@cvs.sourceforge.net:/cvsroot/processing
|
77
build/macosx/dist/Arduino.app/Contents/Info.plist
vendored
Executable file
77
build/macosx/dist/Arduino.app/Contents/Info.plist
vendored
Executable file
@ -0,0 +1,77 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleAllowMixedLocalizations</key>
|
||||
<string>true</string>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleDocumentTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>arduino</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string>arduino.icns</string>
|
||||
<key>CFBundleTypeMIMETypes</key>
|
||||
<array>
|
||||
<string>text/plain</string>
|
||||
</array>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>Arduino Source File</string>
|
||||
<key>CFBundleTypeOSTypes</key>
|
||||
<array>
|
||||
<string>TEXT</string>
|
||||
</array>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Editor</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>JavaApplicationStub</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>arduino.icns</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>de.berlios.arduino</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>Arduino</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>Pde1</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>0.3</string>
|
||||
<key>Java</key>
|
||||
<dict>
|
||||
<key>ClassPath</key>
|
||||
<string>$JAVAROOT/pde.jar:lib/core.jar:$JAVAROOT/antlr.jar:$JAVAROOT/oro.jar:$JAVAROOT/registry.jar:lib/build:$JAVAROOT/RXTXcomm.jar</string>
|
||||
<key>JVMVersion</key>
|
||||
<string>1.4+</string>
|
||||
<key>MainClass</key>
|
||||
<string>processing.app.Base</string>
|
||||
<key>Properties</key>
|
||||
<dict>
|
||||
<key>apple.awt.Antialiasing</key>
|
||||
<string>true</string>
|
||||
<key>apple.awt.TextAntialiasing</key>
|
||||
<string>true</string>
|
||||
<key>apple.awt.showGrowBox</key>
|
||||
<string>true</string>
|
||||
<key>apple.awt.use-file-dialog-packages</key>
|
||||
<string>false</string>
|
||||
<key>apple.laf.useScreenMenuBar</key>
|
||||
<string>true</string>
|
||||
<key>com.apple.hwaccel</key>
|
||||
<string>true</string>
|
||||
<key>com.apple.smallTabs</key>
|
||||
<string>true</string>
|
||||
</dict>
|
||||
<key>VMOptions</key>
|
||||
<string>-Xms128M -Xmx256M</string>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
BIN
build/macosx/dist/Arduino.app/Contents/MacOS/JavaApplicationStub
vendored
Executable file
BIN
build/macosx/dist/Arduino.app/Contents/MacOS/JavaApplicationStub
vendored
Executable file
Binary file not shown.
1
build/macosx/dist/Arduino.app/Contents/PkgInfo
vendored
Executable file
1
build/macosx/dist/Arduino.app/Contents/PkgInfo
vendored
Executable file
@ -0,0 +1 @@
|
||||
APPLsnip
|
3
build/macosx/dist/Arduino.app/Contents/Resources/CVS/Entries
vendored
Normal file
3
build/macosx/dist/Arduino.app/Contents/Resources/CVS/Entries
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
D/Java////
|
||||
/processing.icns/1.2/Sun Dec 5 00:45:14 2004/-kb/
|
||||
/pde.icns/1.1/Sun Jan 30 03:41:54 2005/-kb/
|
1
build/macosx/dist/Arduino.app/Contents/Resources/CVS/Repository
vendored
Normal file
1
build/macosx/dist/Arduino.app/Contents/Resources/CVS/Repository
vendored
Normal file
@ -0,0 +1 @@
|
||||
/cvsroot/processing/processing/build/macosx/dist/Processing.app/Contents/Resources
|
1
build/macosx/dist/Arduino.app/Contents/Resources/CVS/Root
vendored
Normal file
1
build/macosx/dist/Arduino.app/Contents/Resources/CVS/Root
vendored
Normal file
@ -0,0 +1 @@
|
||||
:pserver:anonymous@cvs.sourceforge.net:/cvsroot/processing
|
1
build/macosx/dist/Arduino.app/Contents/Resources/Java/CVS/Entries
vendored
Normal file
1
build/macosx/dist/Arduino.app/Contents/Resources/Java/CVS/Entries
vendored
Normal file
@ -0,0 +1 @@
|
||||
D
|
1
build/macosx/dist/Arduino.app/Contents/Resources/Java/CVS/Repository
vendored
Normal file
1
build/macosx/dist/Arduino.app/Contents/Resources/Java/CVS/Repository
vendored
Normal file
@ -0,0 +1 @@
|
||||
/cvsroot/processing/processing/build/macosx/dist/Processing.app/Contents/Resources/Java
|
1
build/macosx/dist/Arduino.app/Contents/Resources/Java/CVS/Root
vendored
Normal file
1
build/macosx/dist/Arduino.app/Contents/Resources/Java/CVS/Root
vendored
Normal file
@ -0,0 +1 @@
|
||||
:pserver:anonymous@cvs.sourceforge.net:/cvsroot/processing
|
BIN
build/macosx/dist/Arduino.app/Contents/Resources/Java/antlr.jar
vendored
Normal file
BIN
build/macosx/dist/Arduino.app/Contents/Resources/Java/antlr.jar
vendored
Normal file
Binary file not shown.
BIN
build/macosx/dist/Arduino.app/Contents/Resources/Java/core.jar
vendored
Normal file
BIN
build/macosx/dist/Arduino.app/Contents/Resources/Java/core.jar
vendored
Normal file
Binary file not shown.
BIN
build/macosx/dist/Arduino.app/Contents/Resources/Java/mrj.jar
vendored
Executable file
BIN
build/macosx/dist/Arduino.app/Contents/Resources/Java/mrj.jar
vendored
Executable file
Binary file not shown.
BIN
build/macosx/dist/Arduino.app/Contents/Resources/Java/oro.jar
vendored
Normal file
BIN
build/macosx/dist/Arduino.app/Contents/Resources/Java/oro.jar
vendored
Normal file
Binary file not shown.
BIN
build/macosx/dist/Arduino.app/Contents/Resources/Java/pde.jar
vendored
Normal file
BIN
build/macosx/dist/Arduino.app/Contents/Resources/Java/pde.jar
vendored
Normal file
Binary file not shown.
BIN
build/macosx/dist/Arduino.app/Contents/Resources/Java/registry.jar
vendored
Normal file
BIN
build/macosx/dist/Arduino.app/Contents/Resources/Java/registry.jar
vendored
Normal file
Binary file not shown.
BIN
build/macosx/dist/Arduino.app/Contents/Resources/arduino.icns
vendored
Normal file
BIN
build/macosx/dist/Arduino.app/Contents/Resources/arduino.icns
vendored
Normal file
Binary file not shown.
BIN
build/macosx/dist/Arduino.app/Contents/Resources/pde.icns
vendored
Normal file
BIN
build/macosx/dist/Arduino.app/Contents/Resources/pde.icns
vendored
Normal file
Binary file not shown.
BIN
build/macosx/dist/DS_Store
vendored
Executable file
BIN
build/macosx/dist/DS_Store
vendored
Executable file
Binary file not shown.
419
build/macosx/dist/core/Makefile
vendored
Executable file
419
build/macosx/dist/core/Makefile
vendored
Executable file
@ -0,0 +1,419 @@
|
||||
# Hey Emacs, this is a -*- makefile -*-
|
||||
#
|
||||
# WinAVR Sample makefile written by Eric B. Weddington, J<>rg Wunsch, et al.
|
||||
# Released to the Public Domain
|
||||
# Please read the make user manual!
|
||||
#
|
||||
# Additional material for this makefile was submitted by:
|
||||
# Tim Henigan
|
||||
# Peter Fleury
|
||||
# Reiner Patommel
|
||||
# Sander Pool
|
||||
# Frederik Rouleau
|
||||
# Markus Pfaff
|
||||
#
|
||||
# On command line:
|
||||
#
|
||||
# make all = Make software.
|
||||
#
|
||||
# make clean = Clean out built project files.
|
||||
#
|
||||
# make coff = Convert ELF to AVR COFF (for use with AVR Studio 3.x or VMLAB).
|
||||
#
|
||||
# make extcoff = Convert ELF to AVR Extended COFF (for use with AVR Studio
|
||||
# 4.07 or greater).
|
||||
#
|
||||
# make program = Download the hex file to the device, using avrdude. Please
|
||||
# customize the avrdude settings below first!
|
||||
#
|
||||
# make filename.s = Just compile filename.c into the assembler code only
|
||||
#
|
||||
# To rebuild project do "make clean" then "make all".
|
||||
#
|
||||
|
||||
|
||||
# MCU name
|
||||
MCU = atmega8
|
||||
|
||||
# Output format. (can be srec, ihex, binary)
|
||||
FORMAT = ihex
|
||||
|
||||
# Target file name (without extension).
|
||||
TARGET = prog
|
||||
|
||||
|
||||
# List C source files here. (C dependencies are automatically generated.)
|
||||
#SRC = pins_arduino.c wiring.c ../avrlib/uart.c ../avrlib/buffer.c ../avrlib/timer.c ../avrlib/a2d.c $(TARGET).c
|
||||
SRC = pins_arduino.c wiring.c ../avrlib/uart.c ../avrlib/buffer.c ../avrlib/timer.c $(TARGET).c
|
||||
|
||||
# List Assembler source files here.
|
||||
# Make them always end in a capital .S. Files ending in a lowercase .s
|
||||
# will not be considered source files but generated files (assembler
|
||||
# output from the compiler), and will be deleted upon "make clean"!
|
||||
# Even though the DOS/Win* filesystem matches both .s and .S the same,
|
||||
# it will preserve the spelling of the filenames, and gcc itself does
|
||||
# care about how the name is spelled on its command-line.
|
||||
ASRC =
|
||||
|
||||
|
||||
|
||||
# Optimization level, can be [0, 1, 2, 3, s].
|
||||
# 0 = turn off optimization. s = optimize for size.
|
||||
# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
|
||||
OPT = s
|
||||
|
||||
|
||||
# List any extra directories to look for include files here.
|
||||
# Each directory must be seperated by a space.
|
||||
EXTRAINCDIRS = ../avrlib
|
||||
|
||||
|
||||
# Compiler flag to set the C Standard level.
|
||||
# c89 - "ANSI" C
|
||||
# gnu89 - c89 plus GCC extensions
|
||||
# c99 - ISO C99 standard (not yet fully implemented)
|
||||
# gnu99 - c99 plus GCC extensions
|
||||
CSTANDARD = -std=gnu99
|
||||
|
||||
# Place -D or -U options here
|
||||
CDEFS = -D F_CPU=16000000L
|
||||
|
||||
# Place -I options here
|
||||
CINCS =
|
||||
|
||||
|
||||
# Compiler flags.
|
||||
# -g: generate debugging information
|
||||
# -O*: optimization level
|
||||
# -f...: tuning, see GCC manual and avr-libc documentation
|
||||
# -Wall...: warning level
|
||||
# -Wa,...: tell GCC to pass this to the assembler.
|
||||
# -adhlns...: create assembler listing
|
||||
CFLAGS = -g
|
||||
CFLAGS += $(CDEFS) $(CINCS)
|
||||
CFLAGS += -O$(OPT)
|
||||
CFLAGS += -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums
|
||||
CFLAGS += -Wall -Wstrict-prototypes
|
||||
CFLAGS += -Wa,-adhlns=$(<:.c=.lst)
|
||||
CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
|
||||
CFLAGS += $(CSTANDARD)
|
||||
|
||||
|
||||
|
||||
# Assembler flags.
|
||||
# -Wa,...: tell GCC to pass this to the assembler.
|
||||
# -ahlms: create listing
|
||||
# -gstabs: have the assembler create line number information; note that
|
||||
# for use in COFF files, additional information about filenames
|
||||
# and function names needs to be present in the assembler source
|
||||
# files -- see avr-libc docs [FIXME: not yet described there]
|
||||
ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs
|
||||
|
||||
|
||||
|
||||
#Additional libraries.
|
||||
|
||||
# Minimalistic printf version
|
||||
PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
|
||||
|
||||
# Floating point printf version (requires MATH_LIB = -lm below)
|
||||
PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
|
||||
|
||||
PRINTF_LIB =
|
||||
|
||||
# Minimalistic scanf version
|
||||
SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
|
||||
|
||||
# Floating point + %[ scanf version (requires MATH_LIB = -lm below)
|
||||
SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
|
||||
|
||||
SCANF_LIB =
|
||||
|
||||
MATH_LIB = -lm
|
||||
|
||||
# External memory options
|
||||
|
||||
# 64 KB of external RAM, starting after internal RAM (ATmega128!),
|
||||
# used for variables (.data/.bss) and heap (malloc()).
|
||||
#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff
|
||||
|
||||
# 64 KB of external RAM, starting after internal RAM (ATmega128!),
|
||||
# only used for heap (malloc()).
|
||||
#EXTMEMOPTS = -Wl,--defsym=__heap_start=0x801100,--defsym=__heap_end=0x80ffff
|
||||
|
||||
EXTMEMOPTS =
|
||||
|
||||
# Linker flags.
|
||||
# -Wl,...: tell GCC to pass this to linker.
|
||||
# -Map: create map file
|
||||
# --cref: add cross reference to map file
|
||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
|
||||
LDFLAGS += $(EXTMEMOPTS)
|
||||
LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
|
||||
|
||||
|
||||
|
||||
|
||||
# Programming support using avrdude. Settings and variables.
|
||||
|
||||
# Programming hardware: alf avr910 avrisp bascom bsd
|
||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
|
||||
#
|
||||
# Type: avrdude -c ?
|
||||
# to get a full listing.
|
||||
#
|
||||
AVRDUDE_PROGRAMMER = stk500
|
||||
|
||||
# com1 = serial port. Use lpt1 to connect to parallel port.
|
||||
AVRDUDE_PORT = com1 # programmer connected to serial device
|
||||
|
||||
AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
|
||||
#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
|
||||
|
||||
|
||||
# Uncomment the following if you want avrdude's erase cycle counter.
|
||||
# Note that this counter needs to be initialized first using -Yn,
|
||||
# see avrdude manual.
|
||||
#AVRDUDE_ERASE_COUNTER = -y
|
||||
|
||||
# Uncomment the following if you do /not/ wish a verification to be
|
||||
# performed after programming the device.
|
||||
#AVRDUDE_NO_VERIFY = -V
|
||||
|
||||
# Increase verbosity level. Please use this when submitting bug
|
||||
# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
|
||||
# to submit bug reports.
|
||||
#AVRDUDE_VERBOSE = -v -v
|
||||
|
||||
AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
|
||||
AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
|
||||
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
# Define directories, if needed.
|
||||
DIRAVR = ../../tools/avr
|
||||
DIRAVRBIN = $(DIRAVR)/bin
|
||||
|
||||
# Define programs and commands.
|
||||
SHELL = sh
|
||||
CC = ${DIRAVRBIN}/avr-gcc
|
||||
OBJCOPY = ${DIRAVRBIN}/avr-objcopy
|
||||
OBJDUMP = ${DIRAVRBIN}/avr-objdump
|
||||
SIZE = ${DIRAVRBIN}/avr-size
|
||||
NM = ${DIRAVRBIN}/avr-nm
|
||||
AVRDUDE = avrdude
|
||||
REMOVE = rm -f
|
||||
COPY = cp
|
||||
|
||||
|
||||
|
||||
|
||||
# Define Messages
|
||||
# English
|
||||
MSG_ERRORS_NONE = Errors: none
|
||||
MSG_BEGIN = -------- begin --------
|
||||
MSG_END = -------- end --------
|
||||
MSG_SIZE_BEFORE = Size before:
|
||||
MSG_SIZE_AFTER = Size after:
|
||||
MSG_COFF = Converting to AVR COFF:
|
||||
MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
|
||||
MSG_FLASH = Creating load file for Flash:
|
||||
MSG_EEPROM = Creating load file for EEPROM:
|
||||
MSG_EXTENDED_LISTING = Creating Extended Listing:
|
||||
MSG_SYMBOL_TABLE = Creating Symbol Table:
|
||||
MSG_LINKING = Linking:
|
||||
MSG_COMPILING = Compiling:
|
||||
MSG_ASSEMBLING = Assembling:
|
||||
MSG_CLEANING = Cleaning project:
|
||||
|
||||
|
||||
|
||||
|
||||
# Define all object files.
|
||||
OBJ = $(SRC:.c=.o) $(ASRC:.S=.o)
|
||||
|
||||
# Define all listing files.
|
||||
LST = $(ASRC:.S=.lst) $(SRC:.c=.lst)
|
||||
|
||||
|
||||
# Compiler flags to generate dependency files.
|
||||
GENDEPFLAGS = -Wp,-M,-MP,-MT,$(*F).o,-MF,dep/$(@F).d
|
||||
|
||||
|
||||
# Combine all necessary flags and optional flags.
|
||||
# Add target processor to flags.
|
||||
ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
|
||||
ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Default target.
|
||||
all: begin gccversion sizebefore build sizeafter finished end
|
||||
|
||||
build: elf hex eep lss sym
|
||||
|
||||
elf: $(TARGET).elf
|
||||
hex: $(TARGET).hex
|
||||
eep: $(TARGET).eep
|
||||
lss: $(TARGET).lss
|
||||
sym: $(TARGET).sym
|
||||
|
||||
|
||||
|
||||
# Eye candy.
|
||||
# AVR Studio 3.x does not check make's exit code but relies on
|
||||
# the following magic strings to be generated by the compile job.
|
||||
begin:
|
||||
@echo
|
||||
@echo $(MSG_BEGIN)
|
||||
|
||||
finished:
|
||||
@echo $(MSG_ERRORS_NONE)
|
||||
|
||||
end:
|
||||
@echo $(MSG_END)
|
||||
@echo
|
||||
|
||||
|
||||
# Display size of file.
|
||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
|
||||
ELFSIZE = $(SIZE) -A $(TARGET).elf
|
||||
sizebefore:
|
||||
@if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); echo; fi
|
||||
|
||||
sizeafter:
|
||||
@if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); echo; fi
|
||||
|
||||
|
||||
|
||||
# Display compiler version information.
|
||||
gccversion :
|
||||
@$(CC) --version
|
||||
|
||||
|
||||
|
||||
# Program the device.
|
||||
program: $(TARGET).hex $(TARGET).eep
|
||||
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
|
||||
|
||||
|
||||
|
||||
|
||||
# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
|
||||
COFFCONVERT=$(OBJCOPY) --debugging \
|
||||
--change-section-address .data-0x800000 \
|
||||
--change-section-address .bss-0x800000 \
|
||||
--change-section-address .noinit-0x800000 \
|
||||
--change-section-address .eeprom-0x810000
|
||||
|
||||
|
||||
coff: $(TARGET).elf
|
||||
@echo
|
||||
@echo $(MSG_COFF) $(TARGET).cof
|
||||
$(COFFCONVERT) -O coff-avr $< $(TARGET).cof
|
||||
|
||||
|
||||
extcoff: $(TARGET).elf
|
||||
@echo
|
||||
@echo $(MSG_EXTENDED_COFF) $(TARGET).cof
|
||||
$(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
|
||||
|
||||
|
||||
|
||||
# Create final output files (.hex, .eep) from ELF output file.
|
||||
%.hex: %.elf
|
||||
@echo
|
||||
@echo $(MSG_FLASH) $@
|
||||
$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
|
||||
|
||||
%.eep: %.elf
|
||||
@echo
|
||||
@echo $(MSG_EEPROM) $@
|
||||
-$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
|
||||
--change-section-lma .eeprom=0 -O $(FORMAT) $< $@
|
||||
|
||||
# Create extended listing file from ELF output file.
|
||||
%.lss: %.elf
|
||||
@echo
|
||||
@echo $(MSG_EXTENDED_LISTING) $@
|
||||
$(OBJDUMP) -h -S $< > $@
|
||||
|
||||
# Create a symbol table from ELF output file.
|
||||
%.sym: %.elf
|
||||
@echo
|
||||
@echo $(MSG_SYMBOL_TABLE) $@
|
||||
$(NM) -n $< > $@
|
||||
|
||||
|
||||
|
||||
# Link: create ELF output file from object files.
|
||||
.SECONDARY : $(TARGET).elf
|
||||
.PRECIOUS : $(OBJ)
|
||||
%.elf: $(OBJ)
|
||||
@echo
|
||||
@echo $(MSG_LINKING) $@
|
||||
$(CC) $(ALL_CFLAGS) $(OBJ) --output $@ $(LDFLAGS)
|
||||
|
||||
|
||||
# Compile: create object files from C source files.
|
||||
%.o : %.c
|
||||
@echo
|
||||
@echo $(MSG_COMPILING) $<
|
||||
$(CC) -c $(ALL_CFLAGS) $< -o $@
|
||||
|
||||
|
||||
# Compile: create assembler files from C source files.
|
||||
%.s : %.c
|
||||
$(CC) -S $(ALL_CFLAGS) $< -o $@
|
||||
|
||||
|
||||
# Assemble: create object files from assembler source files.
|
||||
%.o : %.S
|
||||
@echo
|
||||
@echo $(MSG_ASSEMBLING) $<
|
||||
$(CC) -c $(ALL_ASFLAGS) $< -o $@
|
||||
|
||||
|
||||
|
||||
# Target: clean project.
|
||||
clean: begin clean_list finished end
|
||||
|
||||
clean_list :
|
||||
@echo
|
||||
@echo $(MSG_CLEANING)
|
||||
$(REMOVE) $(TARGET).hex
|
||||
$(REMOVE) $(TARGET).eep
|
||||
$(REMOVE) $(TARGET).obj
|
||||
$(REMOVE) $(TARGET).cof
|
||||
$(REMOVE) $(TARGET).elf
|
||||
$(REMOVE) $(TARGET).map
|
||||
$(REMOVE) $(TARGET).obj
|
||||
$(REMOVE) $(TARGET).a90
|
||||
$(REMOVE) $(TARGET).sym
|
||||
$(REMOVE) $(TARGET).lnk
|
||||
$(REMOVE) $(TARGET).lss
|
||||
$(REMOVE) $(OBJ)
|
||||
$(REMOVE) $(LST)
|
||||
$(REMOVE) $(SRC:.c=.s)
|
||||
$(REMOVE) $(SRC:.c=.d)
|
||||
$(REMOVE) dep/*
|
||||
|
||||
|
||||
|
||||
# Include the dependency files.
|
||||
-include $(shell mkdir dep 2>/dev/null) $(wildcard dep/*)
|
||||
|
||||
|
||||
# Listing of phony targets.
|
||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
|
||||
build elf hex eep lss sym coff extcoff \
|
||||
clean clean_list program
|
||||
|
||||
|
||||
|
BIN
build/macosx/dist/jikes
vendored
Executable file
BIN
build/macosx/dist/jikes
vendored
Executable file
Binary file not shown.
38
build/macosx/dist/lib/Makefile
vendored
Executable file
38
build/macosx/dist/lib/Makefile
vendored
Executable file
@ -0,0 +1,38 @@
|
||||
# Arduino Makefile (for Mac OS X)
|
||||
# Nick Zambetti and David A. Mellis
|
||||
# $Id: makefile.osx,v 1.6 2005/05/23 17:19:56 mellis Exp $
|
||||
|
||||
# By default, this makefile uses the serial device specified by
|
||||
# Wiring (either in the Tools | Serial Port menu or the Wiring
|
||||
# preferences file in the sketchbook directory) and passed as
|
||||
# an argument to make. To override this value, uncomment the
|
||||
# following line and change the value to the desired device.
|
||||
# SERIAL=/dev/tty.usbserial-1B1
|
||||
|
||||
# The Wiring Lite IDE runs the "compile" rule when you click the play button.
|
||||
compile:
|
||||
rm -rf tmp
|
||||
mkdir tmp
|
||||
cat ../core/wiringlite.inc > tmp/prog.c
|
||||
cat build/*.c >> tmp/prog.c
|
||||
cp ../core/* tmp/
|
||||
../tools/gnumake -s -C tmp
|
||||
|
||||
# The IDE runs the "program" rule when you hit the export button.
|
||||
# The string after the colon determines the method used to
|
||||
# program the microcontroller: program-using-bootloader or
|
||||
# program-with-isp.
|
||||
program: program-using-bootloader
|
||||
|
||||
# This rule is for uploading code using a bootloader already on
|
||||
# the microcontroller. It should run at the baud rate specified
|
||||
# in the bootloader's code, current 9600 baud.
|
||||
program-using-bootloader:
|
||||
../../tools/avr/bin/uisp -dprog=stk500 -dspeed=9600 -dserial=${SERIAL} -dpart=ATmega8 if=tmp/prog.hex --upload
|
||||
|
||||
# This rule is for uploading code using an in-system programmer,
|
||||
# e.g. the one sold by Atmel. In this case, you want to erase the
|
||||
# microcontroller, upload the code, and then verify it.
|
||||
# Atmel's isp follows the stk500 protocol and works at 115200 baud.
|
||||
program-with-isp:
|
||||
../../tools/avr/bin/uisp -dprog=stk500 -dspeed=115200 -dserial=${SERIAL} -dpart=ATmega8 if=tmp/prog.hex --erase --upload --verify
|
51
build/macosx/dist/macosx_setup.command
vendored
Executable file
51
build/macosx/dist/macosx_setup.command
vendored
Executable file
@ -0,0 +1,51 @@
|
||||
#!/bin/sh
|
||||
|
||||
# originally fixperm.sh from rxtx-2.1_6/contrib
|
||||
# with a couple additions from pathsetup.command from fink [fry]
|
||||
|
||||
# A script to fix permissions for lock files on Mac OS X
|
||||
# Contributed by Dmitry Markman <dimitry.markman@verizon.net>
|
||||
# Fri Aug 23 15:46:46 MDT 2002
|
||||
|
||||
echo ""
|
||||
echo ""
|
||||
echo "This command will take care of a couple system things"
|
||||
echo "so that you can properly use the serial port to communicate"
|
||||
echo "between hardware devices and processing."
|
||||
echo ""
|
||||
echo "If there are actually changes that need to be made, then"
|
||||
echo "enter your password when prompted. The command uses sudo,"
|
||||
echo "and you'll need to have administrator access."
|
||||
echo ""
|
||||
|
||||
echo -n "Do you want to continue? [Y/n] "
|
||||
read answer
|
||||
answer=`echo $answer | sed 's/^[yY].*$/y/'`
|
||||
if [ -z "$answer" -o "x$answer" = "xy" ]; then
|
||||
curruser=`sudo id -p | grep 'login' | sed 's/login.//'`
|
||||
|
||||
if [ ! -d /var/spool/uucp ]
|
||||
then
|
||||
sudo mkdir /var/spool/uucp
|
||||
fi
|
||||
|
||||
sudo chgrp uucp /var/spool/uucp
|
||||
sudo chmod 775 /var/spool/uucp
|
||||
|
||||
if [ ! `sudo niutil -readprop / /groups/uucp users | grep $curruser > /dev/null` ]
|
||||
then
|
||||
sudo niutil -mergeprop / /groups/uucp users $curruser
|
||||
fi
|
||||
|
||||
echo "Finished making changes, you should be all set"
|
||||
else
|
||||
echo "Ok, nevermind then."
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo ""
|
||||
echo " (All done... you can close this window now)"
|
||||
echo ""
|
||||
echo ""
|
||||
echo ""
|
||||
|
1
build/macosx/dist/serial/RXTX.pkg/CVS/Entries
vendored
Normal file
1
build/macosx/dist/serial/RXTX.pkg/CVS/Entries
vendored
Normal file
@ -0,0 +1 @@
|
||||
D/Contents////
|
1
build/macosx/dist/serial/RXTX.pkg/CVS/Repository
vendored
Normal file
1
build/macosx/dist/serial/RXTX.pkg/CVS/Repository
vendored
Normal file
@ -0,0 +1 @@
|
||||
/cvsroot/processing/processing/build/macosx/dist/serial/RXTX.pkg
|
1
build/macosx/dist/serial/RXTX.pkg/CVS/Root
vendored
Normal file
1
build/macosx/dist/serial/RXTX.pkg/CVS/Root
vendored
Normal file
@ -0,0 +1 @@
|
||||
:pserver:anonymous@cvs.sourceforge.net:/cvsroot/processing
|
1
build/macosx/dist/serial/RXTX.pkg/Contents/CVS/Entries
vendored
Normal file
1
build/macosx/dist/serial/RXTX.pkg/Contents/CVS/Entries
vendored
Normal file
@ -0,0 +1 @@
|
||||
D/Resources////
|
1
build/macosx/dist/serial/RXTX.pkg/Contents/CVS/Repository
vendored
Normal file
1
build/macosx/dist/serial/RXTX.pkg/Contents/CVS/Repository
vendored
Normal file
@ -0,0 +1 @@
|
||||
/cvsroot/processing/processing/build/macosx/dist/serial/RXTX.pkg/Contents
|
1
build/macosx/dist/serial/RXTX.pkg/Contents/CVS/Root
vendored
Normal file
1
build/macosx/dist/serial/RXTX.pkg/Contents/CVS/Root
vendored
Normal file
@ -0,0 +1 @@
|
||||
:pserver:anonymous@cvs.sourceforge.net:/cvsroot/processing
|
1
build/macosx/dist/serial/RXTX.pkg/Contents/Resources/CVS/Entries
vendored
Normal file
1
build/macosx/dist/serial/RXTX.pkg/Contents/Resources/CVS/Entries
vendored
Normal file
@ -0,0 +1 @@
|
||||
D/English.lproj////
|
1
build/macosx/dist/serial/RXTX.pkg/Contents/Resources/CVS/Repository
vendored
Normal file
1
build/macosx/dist/serial/RXTX.pkg/Contents/Resources/CVS/Repository
vendored
Normal file
@ -0,0 +1 @@
|
||||
/cvsroot/processing/processing/build/macosx/dist/serial/RXTX.pkg/Contents/Resources
|
1
build/macosx/dist/serial/RXTX.pkg/Contents/Resources/CVS/Root
vendored
Normal file
1
build/macosx/dist/serial/RXTX.pkg/Contents/Resources/CVS/Root
vendored
Normal file
@ -0,0 +1 @@
|
||||
:pserver:anonymous@cvs.sourceforge.net:/cvsroot/processing
|
1
build/macosx/dist/serial/RXTX.pkg/Contents/Resources/English.lproj/CVS/Entries
vendored
Normal file
1
build/macosx/dist/serial/RXTX.pkg/Contents/Resources/English.lproj/CVS/Entries
vendored
Normal file
@ -0,0 +1 @@
|
||||
D
|
1
build/macosx/dist/serial/RXTX.pkg/Contents/Resources/English.lproj/CVS/Repository
vendored
Normal file
1
build/macosx/dist/serial/RXTX.pkg/Contents/Resources/English.lproj/CVS/Repository
vendored
Normal file
@ -0,0 +1 @@
|
||||
/cvsroot/processing/processing/build/macosx/dist/serial/RXTX.pkg/Contents/Resources/English.lproj
|
1
build/macosx/dist/serial/RXTX.pkg/Contents/Resources/English.lproj/CVS/Root
vendored
Normal file
1
build/macosx/dist/serial/RXTX.pkg/Contents/Resources/English.lproj/CVS/Root
vendored
Normal file
@ -0,0 +1 @@
|
||||
:pserver:anonymous@cvs.sourceforge.net:/cvsroot/processing
|
BIN
build/macosx/dist/tools.zip
vendored
Normal file
BIN
build/macosx/dist/tools.zip
vendored
Normal file
Binary file not shown.
148
build/macosx/make.sh
Executable file
148
build/macosx/make.sh
Executable file
@ -0,0 +1,148 @@
|
||||
#!/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
|
||||
#
|
||||
|
||||
### -- SETUP WORK DIR -------------------------------------------
|
||||
|
||||
if test -d work
|
||||
then
|
||||
BUILD_PREPROC=false
|
||||
else
|
||||
# if test -f /sw/bin/cp
|
||||
# then
|
||||
# echo
|
||||
# else
|
||||
# echo You need to install fink with fileutils, textutils, etc
|
||||
# exit
|
||||
# fi
|
||||
|
||||
echo Setting up directories to build under Mac OS X
|
||||
BUILD_PREPROC=true
|
||||
|
||||
echo Copying shared and dist files...
|
||||
cp -r ../shared work
|
||||
cp -r ../../core work
|
||||
|
||||
# needs to make the dir because of packaging goofiness
|
||||
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
|
||||
|
||||
cp -r dist/lib work/
|
||||
cp -r dist/core work/
|
||||
|
||||
# to have a copy of this guy around for messing with
|
||||
echo Copying Arduino.app...
|
||||
|
||||
cp -pR dist/Arduino.app work/
|
||||
# cvs doesn't seem to want to honor the +x bit
|
||||
chmod +x work/Arduino.app/Contents/MacOS/JavaApplicationStub
|
||||
|
||||
# copy the avr-gcc distribution
|
||||
cp -pR dist/tools.zip work/
|
||||
cd work
|
||||
unzip -q tools.zip
|
||||
rm tools.zip
|
||||
cd ..
|
||||
|
||||
# get jikes and depedencies
|
||||
echo Copying jikes...
|
||||
cp dist/jikes work/
|
||||
chmod +x work/jikes
|
||||
fi
|
||||
|
||||
|
||||
### -- START BUILDING -------------------------------------------
|
||||
|
||||
# move to root 'processing' directory
|
||||
cd ../..
|
||||
|
||||
|
||||
### -- BUILD GCC ----------------------------------------------
|
||||
# in the future we will build avr-gcc and tools (if they don't exist)
|
||||
|
||||
# set classpath
|
||||
CLASSPATH=/System/Library/Frameworks/JavaVM.framework/Classes/classes.jar:/System/Library/Frameworks/JavaVM.framework/Classes/ui.jar:/System/Library/Java/Extensions/MRJToolkit.jar
|
||||
export CLASSPATH
|
||||
|
||||
cd app
|
||||
|
||||
### -- BUILD PARSER ---------------------------------------------
|
||||
|
||||
#BUILD_PREPROC=true
|
||||
|
||||
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/macosx/work/lib/antlr.jar antlr.Tool java.g
|
||||
# now build the pde stuff that extends the java classes
|
||||
java -cp ../../build/macosx/work/lib/antlr.jar antlr.Tool -glib java.g pde.g
|
||||
cd ..
|
||||
fi
|
||||
|
||||
### -- 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
|
||||
#../build/macosx/work/jikes -target 1.3 +D -classpath ../build/macosx/work/classes:../build/macosx/work/lib/core.jar:../build/macosx/work/lib/antlr.jar:../build/macosx/work/lib/oro.jar:../build/macosx/work/lib/registry.jar:$CLASSPATH -d ../build/macosx/work/classes *.java syntax/*.java preproc/*.java tools/*.java
|
||||
../build/macosx/work/jikes -target 1.3 +D -classpath ../build/macosx/work/classes:../build/macosx/work/lib/antlr.jar:../build/macosx/work/lib/oro.jar:../build/macosx/work/lib/registry.jar:../build/macosx/work/lib/RXTXcomm.jar:$CLASSPATH -d ../build/macosx/work/classes tools/*.java preproc/*.java syntax/*.java *.java
|
||||
|
||||
cd ../build/macosx/work/classes
|
||||
rm -f ../lib/pde.jar
|
||||
zip -0rq ../lib/pde.jar .
|
||||
cd ../..
|
||||
|
||||
# i fought the packages and the packages won
|
||||
#cd ../..
|
||||
#WORKLIB=processing/build/macosx/work/lib
|
||||
#./processing/build/macosx/work/jikes -d . -target 1.3 +D -classpath $WORKLIB/core.jar:$WORKLIB/antlr.jar:$WORKLIB/oro.jar:$WORKLIB/registry.jar:$CLASSPATH -d . processing/app/*.java processing/app/preproc/*.java processing/app/syntax/*.java processing/app/tools/*.java
|
||||
#zip -rq $WORKLIB/pde.jar processing/app/*.class processing/app/preproc/*.class processing/app/syntax/*.class processing/app/tools/*.class
|
||||
|
||||
# get the libs
|
||||
mkdir -p work/Arduino.app/Contents/Resources/Java/
|
||||
cp work/lib/*.jar work/Arduino.app/Contents/Resources/Java/
|
||||
|
||||
|
||||
### -- BUILD LIBRARIES ------------------------------------------------
|
||||
|
||||
|
||||
PLATFORM=macosx
|
||||
|
||||
|
||||
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 ..
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
CLASSPATH=../$CLASSPATH
|
||||
JIKES=../../build/$PLATFORM/work/jikes
|
||||
CORE=../../build/$PLATFORM/work/lib/core.jar
|
||||
LIBRARIES=../../build/$PLATFORM/work/libraries
|
||||
|
||||
|
||||
|
||||
echo
|
||||
echo Done.
|
144
build/macosx/mkdmg
Executable file
144
build/macosx/mkdmg
Executable file
@ -0,0 +1,144 @@
|
||||
#!/bin/zsh
|
||||
|
||||
# from http://www.kernelthread.com/mac/apme/archive/
|
||||
# (c) 1994-2005 Amit Singh
|
||||
# with modifications for p5 build process by fry
|
||||
|
||||
PATH=/bin:/sbin:/usr/bin:/usr/sbin
|
||||
SCRATCH=/tmp/.mkdmg.$$
|
||||
|
||||
# Output
|
||||
#
|
||||
croak()
|
||||
{
|
||||
echo -n "\n$1"
|
||||
}
|
||||
|
||||
# Clean up
|
||||
#
|
||||
halt()
|
||||
{
|
||||
rm -rf $SCRATCH
|
||||
# defaults write com.apple.finder ShowRemovableMediaOnDesktop 1
|
||||
# chkerror
|
||||
# FINDERPID=`ps -auxwww | grep Finder.app | grep -v grep | awk '{print $2}'`
|
||||
# chkerror
|
||||
# kill -HUP $FINDERPID 2>/dev/null >/dev/null
|
||||
# chkerror
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Check return status and bail out on error
|
||||
#
|
||||
chkerror()
|
||||
{
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
halt
|
||||
fi
|
||||
}
|
||||
|
||||
main()
|
||||
{
|
||||
|
||||
# Check if exactly one command line argument was specified
|
||||
#
|
||||
if [ $ARGC -ne 1 ]
|
||||
then
|
||||
echo "usage: mkdmg <file|directory>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if the specified file/directory exists
|
||||
#
|
||||
if [ ! -e $1 ]
|
||||
then
|
||||
echo "*** $1 does not exist."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# changed these around a bit [fry]
|
||||
DEST=`pwd`
|
||||
SRC=$DEST/$1
|
||||
NAME=`basename $SRC`
|
||||
NAME="$NAME"
|
||||
VOLNAME=$2
|
||||
|
||||
# don't add 'archive' to the end of the name [fry]
|
||||
#ARCH="$NAME Archive"
|
||||
ARCH="$NAME"
|
||||
|
||||
echo -n "Using source $SRC"
|
||||
|
||||
# Change directory to a scratch location
|
||||
#
|
||||
cd /tmp
|
||||
|
||||
# Create a scratch directory
|
||||
#
|
||||
mkdir $SCRATCH
|
||||
croak "Creating temporary directory $SCRATCH"
|
||||
|
||||
# Estimate how much space is needed to archive the file/folder
|
||||
#
|
||||
SIZE=`du -s -k $SRC | awk '{print $1}'`
|
||||
chkerror
|
||||
SIZE=`expr 5 + $SIZE / 1000`
|
||||
chkerror
|
||||
croak "Using $SIZE MB"
|
||||
|
||||
# Create a disk image, redirecting all output to /dev/null
|
||||
#
|
||||
hdiutil create "$SCRATCH/$ARCH.dmg" -volname "$VOLNAME" -megabytes $SIZE -type SPARSE -fs HFS+ 2>/dev/null >/dev/null
|
||||
chkerror
|
||||
croak "$SCRATCH/$ARCH.dmg created"
|
||||
|
||||
# Optionally disable display of removable media on Desktop
|
||||
#
|
||||
# defaults write com.apple.finder ShowRemovableMediaOnDesktop 0
|
||||
# chkerror
|
||||
# FINDERPID=`ps -auxwww | grep Finder.app | grep -v grep | awk '{print $2}'`
|
||||
# chkerror
|
||||
# kill -HUP $FINDERPID 2>/dev/null >/dev/null
|
||||
# chkerror
|
||||
#
|
||||
|
||||
# Mount sparse image
|
||||
#
|
||||
hdid $SCRATCH/$ARCH.dmg.sparseimage 2>/dev/null >/dev/null
|
||||
chkerror
|
||||
croak "$SCRATCH/$ARCH.dmg.sparseimage attached"
|
||||
|
||||
# Find out allocated device
|
||||
#
|
||||
DEV=`mount | grep "Volumes/$ARCH" | awk '{print $1}'`
|
||||
croak "Device in use is $DEV"
|
||||
|
||||
# Use ditto to copy everything to the image, preserving resource forks
|
||||
#
|
||||
# copy the contents, don't make another folder inside [fry]
|
||||
ditto -rsrcFork $SRC "/Volumes/$ARCH/$NAME" 2>/dev/null >/dev/null
|
||||
#ditto -rsrcFork $SRC "/Volumes/$ARCH" 2>/dev/null >/dev/null
|
||||
chkerror
|
||||
croak "Copied $SRC to /Volumes/$ARCH/$NAME"
|
||||
|
||||
# Detach the disk image
|
||||
hdiutil detach $DEV 2>/dev/null >/dev/null
|
||||
chkerror
|
||||
croak "$DEV detached"
|
||||
|
||||
# Compress the image (maximum compression)
|
||||
hdiutil convert "$SCRATCH/$ARCH.dmg.sparseimage" -format UDZO -o "/tmp/$ARCH.dmg" -imagekey zlib-devel=9 2>/dev/null >/dev/null
|
||||
chkerror
|
||||
croak "Disk image successfully compressed"
|
||||
|
||||
#croak "/tmp/$ARCH.dmg is ready"
|
||||
# move the folder to the destination place [fry]
|
||||
mv /tmp/$ARCH.dmg $DEST/
|
||||
|
||||
echo
|
||||
|
||||
halt
|
||||
}
|
||||
|
||||
main $1
|
9
build/macosx/run.sh
Executable file
9
build/macosx/run.sh
Executable file
@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
CLASSPATH=:lib:lib/build:lib/pde.jar:lib/antlr.jar:lib/oro.jar:lib/registry.jar
|
||||
|
||||
export CLASSPATH
|
||||
|
||||
cd work && java -Dapple.laf.useScreenMenuBar=true -Dapple.awt.showGrowBox=false processing.app.Base
|
||||
#./work/Arduino.app/Contents/MacOS/JavaApplicationStub
|
||||
|
Reference in New Issue
Block a user