mirror of https://github.com/noisymime/Arduino.git
Trying desperately to get the Windows build working.
This commit is contained in:
parent
9e8cc277ea
commit
21fe7f0a83
|
@ -1,54 +0,0 @@
|
||||||
# Arduino Makefile (for Windows XP)
|
|
||||||
# Nick Zambetti, David A. Mellis, and D. Cuartielles
|
|
||||||
# $Id: makefile.win,v 1.10 2005/08/31 02:47:04 cuartielles 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=com1
|
|
||||||
|
|
||||||
# The Wiring Lite IDE runs the "compile" rule when you click the play button.
|
|
||||||
compile:
|
|
||||||
-tools/rm tmp/*
|
|
||||||
tools/cat core/wiringlite.inc > tmp/prog.c
|
|
||||||
tools/cat lib/build/*.c >> tmp/prog.c
|
|
||||||
tools/cp core/* tmp
|
|
||||||
tools/cp lib/cyg*.dll 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,
|
|
||||||
# program-with-isp, or program-over-parallel-port.
|
|
||||||
program: program-using-bootloader-avrdude
|
|
||||||
|
|
||||||
# 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-avrdude:
|
|
||||||
tools/avrdude -p atmega8 -P ${SERIAL} -c stk500@9600 -V -q -U flash:w:tmp/prog.hex
|
|
||||||
|
|
||||||
# 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. On Windows, use
|
|
||||||
# program-using-bootloader-avrdude instead, as uisp seems to have
|
|
||||||
# problems talking to the bootloader over the serial port (though
|
|
||||||
# it appears to work fine with a Keyspan USB-to-serial adapter).
|
|
||||||
program-using-bootloader:
|
|
||||||
# cp lib/cyg*.dll .
|
|
||||||
tools/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:
|
|
||||||
# cp lib/cyg*.dll .
|
|
||||||
tools/uisp -dprog=stk500 -dspeed=115200 -dserial=${SERIAL} -dpart=ATmega8 if=tmp/prog.hex --erase --upload --verify
|
|
||||||
|
|
||||||
# This rule is for uploading code using a parallel port programmer.
|
|
||||||
program-over-parallel-port:
|
|
||||||
# cp lib/cyg*.dll .
|
|
||||||
tools/uisp -dprog=dapa -dpart=ATmega8 if=tmp/prog.hex -dlpt=0x378 --erase --upload
|
|
|
@ -1,54 +0,0 @@
|
||||||
# Arduino Makefile (for Windows XP)
|
|
||||||
# Nick Zambetti, David A. Mellis, and D. Cuartielles
|
|
||||||
# $Id: makefile.win,v 1.10 2005/08/31 02:47:04 cuartielles 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=com1
|
|
||||||
|
|
||||||
# The Wiring Lite IDE runs the "compile" rule when you click the play button.
|
|
||||||
compile:
|
|
||||||
-tools\rm tmp/*
|
|
||||||
tools\cat core/wiringlite.inc > tmp/prog.c
|
|
||||||
tools\cat lib/build/*.c >> tmp/prog.c
|
|
||||||
tools\cp core/* tmp
|
|
||||||
tools\cp lib/cyg*.dll 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,
|
|
||||||
# program-with-isp, or program-over-parallel-port.
|
|
||||||
program: program-using-bootloader-avrdude
|
|
||||||
|
|
||||||
# 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-avrdude:
|
|
||||||
tools\avrdude -p atmega8 -P ${SERIAL} -c stk500@9600 -V -q -U flash:w:tmp/prog.hex
|
|
||||||
|
|
||||||
# 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. On Windows, use
|
|
||||||
# program-using-bootloader-avrdude instead, as uisp seems to have
|
|
||||||
# problems talking to the bootloader over the serial port (though
|
|
||||||
# it appears to work fine with a Keyspan USB-to-serial adapter).
|
|
||||||
program-using-bootloader:
|
|
||||||
# cp lib/cyg*.dll .
|
|
||||||
tools\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:
|
|
||||||
# cp lib/cyg*.dll .
|
|
||||||
tools\uisp -dprog=stk500 -dspeed=115200 -dserial=${SERIAL} -dpart=ATmega8 if=tmp/prog.hex --erase --upload --verify
|
|
||||||
|
|
||||||
# This rule is for uploading code using a parallel port programmer.
|
|
||||||
program-over-parallel-port:
|
|
||||||
# cp lib/cyg*.dll .
|
|
||||||
tools\uisp -dprog=dapa -dpart=ATmega8 if=tmp/prog.hex -dlpt=0x378 --erase --upload
|
|
Binary file not shown.
Before Width: | Height: | Size: 115 B After Width: | Height: | Size: 1008 B |
Binary file not shown.
Before Width: | Height: | Size: 548 B After Width: | Height: | Size: 5.1 KiB |
|
@ -17,88 +17,80 @@ echo Creating P5 distribution for revision $REVISION...
|
||||||
echo
|
echo
|
||||||
|
|
||||||
# remove any old boogers
|
# remove any old boogers
|
||||||
rm -rf processing
|
rm -rf arduino
|
||||||
rm -rf processing-*
|
rm -rf arduino-*
|
||||||
|
|
||||||
# use 'shared' files as starting point
|
# use 'shared' files as starting point
|
||||||
cp -r ../shared processing
|
cp -r ../shared arduino
|
||||||
|
cp -r work/lib/targets arduino/lib
|
||||||
# add the libraries folder with source
|
|
||||||
cp -r ../../net processing/libraries/
|
|
||||||
cp -r ../../opengl processing/libraries/
|
|
||||||
cp -r ../../serial processing/libraries/
|
|
||||||
cp -r ../../video processing/libraries/
|
|
||||||
|
|
||||||
# new style examples thing ala reas
|
# new style examples thing ala reas
|
||||||
cd processing
|
cd arduino
|
||||||
unzip -q examples.zip
|
mkdir examples
|
||||||
rm examples.zip
|
unzip -d examples -q dist/examples.zip
|
||||||
cd ..
|
rm dist/examples.zip
|
||||||
|
rm -rf dist
|
||||||
# new style reference
|
|
||||||
cd processing
|
|
||||||
unzip -q reference.zip
|
|
||||||
# necessary for launching reference from shell/command prompt
|
|
||||||
# which is done internally to view reference
|
|
||||||
chmod +x reference/*.html
|
|
||||||
# needed by 'help' menu
|
|
||||||
chmod +x reference/environment/*.html
|
|
||||||
# get rid of the zip file
|
|
||||||
rm reference.zip
|
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
# add java (jre) files
|
# add java (jre) files
|
||||||
unzip -q -d processing jre.zip
|
unzip -q -d arduino jre.zip
|
||||||
|
|
||||||
|
# copy tools from work/
|
||||||
|
cp -r work/tools arduino
|
||||||
|
|
||||||
# directories used by the app
|
# directories used by the app
|
||||||
#mkdir processing/lib/build
|
#mkdir arduino/lib/build
|
||||||
|
|
||||||
# grab pde.jar and export from the working dir
|
# grab pde.jar and export from the working dir
|
||||||
cp work/lib/pde.jar processing/lib/
|
cp work/lib/pde.jar arduino/lib/
|
||||||
cp work/lib/core.jar processing/lib/
|
cp work/java/lib/rt.jar arduino/lib/
|
||||||
#cp -r work/lib/export processing/lib/
|
#cp work/lib/core.jar arduino/lib/
|
||||||
#rm -rf processing/lib/export/CVS
|
#cp -r work/lib/export arduino/lib/
|
||||||
|
#rm -rf arduino/lib/export/CVS
|
||||||
|
|
||||||
# get jikes and depedencies
|
# get jikes and depedencies
|
||||||
#gunzip < dist/jikes.gz > processing/jikes.exe
|
#gunzip < dist/jikes.gz > arduino/jikes.exe
|
||||||
cp dist/jikes.exe processing/
|
cp dist/jikes.exe arduino/
|
||||||
chmod +x processing/jikes.exe
|
chmod +x arduino/jikes.exe
|
||||||
|
|
||||||
cp dist/ICE_JNIRegistry.dll processing/
|
cp dist/ICE_JNIRegistry.dll arduino/
|
||||||
chmod +x processing/ICE_JNIRegistry.dll
|
chmod +x arduino/ICE_JNIRegistry.dll
|
||||||
|
cp work/rxtxSerial.dll arduino/
|
||||||
|
chmod +x arduino/rxtxSerial.dll
|
||||||
|
cp work/*.dll arduino
|
||||||
|
chmod +x arduino/*.dll
|
||||||
|
|
||||||
# get platform-specific goodies from the dist dir
|
# get platform-specific goodies from the dist dir
|
||||||
cp launcher/processing.exe processing/
|
cp launcher/arduino.exe arduino/
|
||||||
cp dist/run.bat processing/
|
#cp dist/run.bat arduino/
|
||||||
|
|
||||||
# convert notes.txt to windows LFs
|
# convert notes.txt to windows LFs
|
||||||
# the 2> is because the app is a little chatty
|
# the 2> is because the app is a little chatty
|
||||||
unix2dos processing/revisions.txt 2> /dev/null
|
unix2dos arduino/revisions.txt 2> /dev/null
|
||||||
unix2dos processing/lib/preferences.txt 2> /dev/null
|
unix2dos arduino/lib/preferences.txt 2> /dev/null
|
||||||
unix2dos processing/lib/keywords.txt 2> /dev/null
|
unix2dos arduino/lib/keywords.txt 2> /dev/null
|
||||||
rm -f processing/*.bak
|
rm -f arduino/*.bak
|
||||||
rm -f processing/lib/*.bak
|
rm -f arduino/lib/*.bak
|
||||||
|
|
||||||
# remove boogers
|
# remove boogers
|
||||||
find processing -name "*~" -exec rm -f {} ';'
|
find arduino -name "*~" -exec rm -f {} ';'
|
||||||
find processing -name ".DS_Store" -exec rm -f {} ';'
|
find arduino -name ".DS_Store" -exec rm -f {} ';'
|
||||||
find processing -name "._*" -exec rm -f {} ';'
|
find arduino -name "._*" -exec rm -f {} ';'
|
||||||
find processing -name "Thumbs.db" -exec rm -f {} ';'
|
find arduino -name "Thumbs.db" -exec rm -f {} ';'
|
||||||
|
|
||||||
# chmod +x the crew
|
# chmod +x the crew
|
||||||
find processing -name "*.dll" -exec chmod +x {} ';'
|
find arduino -name "*.dll" -exec chmod +x {} ';'
|
||||||
find processing -name "*.exe" -exec chmod +x {} ';'
|
find arduino -name "*.exe" -exec chmod +x {} ';'
|
||||||
find processing -name "*.html" -exec chmod +x {} ';'
|
find arduino -name "*.html" -exec chmod +x {} ';'
|
||||||
|
|
||||||
# clean out the cvs entries
|
# clean out the svn entries
|
||||||
find processing -name "CVS" -exec rm -rf {} ';' 2> /dev/null
|
find arduino -name ".svn" -exec rm -rf {} ';' 2> /dev/null
|
||||||
find processing -name ".cvsignore" -exec rm -rf {} ';'
|
|
||||||
|
|
||||||
# zip it all up for release
|
# zip it all up for release
|
||||||
echo Packaging standard release...
|
echo Packaging standard release...
|
||||||
echo
|
echo
|
||||||
P5=processing-$REVISION
|
P5=arduino-$REVISION
|
||||||
mv processing $P5
|
mv arduino $P5
|
||||||
zip -rq $P5.zip $P5
|
zip -rq $P5.zip $P5
|
||||||
# nah, keep the new directory around
|
# nah, keep the new directory around
|
||||||
#rm -rf $P5
|
#rm -rf $P5
|
||||||
|
|
Binary file not shown.
|
@ -6,7 +6,7 @@ REM --- (which means 128 megabytes) to something higher.
|
||||||
set SAVEDCP=%CLASSPATH%
|
set SAVEDCP=%CLASSPATH%
|
||||||
set SAVEDPATH=%PATH%
|
set SAVEDPATH=%PATH%
|
||||||
|
|
||||||
set 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;%windir%\system32\qtjava.zip;%windir%\system\qtjava.zip
|
set 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
|
||||||
set PATH=java\bin;%PATH%
|
set PATH=java\bin;%PATH%
|
||||||
|
|
||||||
start javaw -ms128m -mx128m processing.app.Base
|
start javaw -ms128m -mx128m processing.app.Base
|
||||||
|
|
Binary file not shown.
|
@ -1,9 +1,9 @@
|
||||||
CXXFLAGS = -mwindows -mno-cygwin -O2 -Wall
|
CXXFLAGS = -mwindows -mno-cygwin -O2 -Wall
|
||||||
OBJS = launcher.o launcher-rc.o
|
OBJS = launcher.o launcher-rc.o
|
||||||
|
|
||||||
processing.exe: $(OBJS)
|
arduino.exe: $(OBJS)
|
||||||
$(LINK.cc) $(CXXFLAGS) -o $@ $(OBJS)
|
$(LINK.cc) $(CXXFLAGS) -o $@ $(OBJS)
|
||||||
cp processing.exe ../work/
|
cp arduino.exe ../work/
|
||||||
|
|
||||||
$(OBJS): Makefile
|
$(OBJS): Makefile
|
||||||
|
|
||||||
|
@ -11,4 +11,4 @@ launcher-rc.o: launcher.rc
|
||||||
windres -i $< -o $@
|
windres -i $< -o $@
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(RM) $(OBJS) processing.exe
|
$(RM) $(OBJS) arduino.exe
|
||||||
|
|
|
@ -12,6 +12,8 @@ else
|
||||||
cp -r ../shared work
|
cp -r ../shared work
|
||||||
rm -rf work/CVS
|
rm -rf work/CVS
|
||||||
rm -f work/.DS_Store
|
rm -f work/.DS_Store
|
||||||
|
cp ../../lib/*.dll work
|
||||||
|
cp dist/lib/*.dll work
|
||||||
|
|
||||||
# needs to make the dir because of packaging goofiness
|
# needs to make the dir because of packaging goofiness
|
||||||
mkdir -p work/classes/arduino/app/preproc
|
mkdir -p work/classes/arduino/app/preproc
|
||||||
|
@ -80,7 +82,7 @@ else
|
||||||
# take care of the examples
|
# take care of the examples
|
||||||
mkdir work/examples
|
mkdir work/examples
|
||||||
cd work/examples
|
cd work/examples
|
||||||
cp ../shared/dist/examples.zip .
|
cp ../../../shared/dist/examples.zip .
|
||||||
echo Extracting examples ...
|
echo Extracting examples ...
|
||||||
unzip -q -d . examples.zip
|
unzip -q -d . examples.zip
|
||||||
rm -f examples.zip
|
rm -f examples.zip
|
||||||
|
@ -112,12 +114,14 @@ cd app/preproc
|
||||||
|
|
||||||
# first build the default java goop
|
# first build the default java goop
|
||||||
../../build/windows/work/java/bin/java \
|
../../build/windows/work/java/bin/java \
|
||||||
-cp "..\\..\\build\\windows\\work\\lib\\antlr.jar" antlr.Tool java.g
|
-cp "..\\..\\build\\windows\\work\\lib\\antlr.jar" antlr.Tool StdCParser.g
|
||||||
|
|
||||||
# now build the pde stuff that extends the java classes
|
# now build the pde stuff that extends the java classes
|
||||||
../../build/windows/work/java/bin/java \
|
../../build/windows/work/java/bin/java \
|
||||||
-cp "..\\..\\build\\windows\\work\\lib\\antlr.jar" antlr.Tool \
|
-cp "..\\..\\build\\windows\\work\\lib\\antlr.jar" antlr.Tool -glib StdCParser.g WParser.g
|
||||||
-glib java.g pde.g
|
../../build/windows/work/java/bin/java \
|
||||||
|
-cp "..\\..\\build\\windows\\work\\lib\\antlr.jar" antlr.Tool WTreeParser.g
|
||||||
|
../../build/windows/work/java/bin/java \
|
||||||
|
-cp "..\\..\\build\\windows\\work\\lib\\antlr.jar" antlr.Tool -glib WTreeParser.g WEmitter.g
|
||||||
|
|
||||||
# back to base arduino dir
|
# back to base arduino dir
|
||||||
cd ../..
|
cd ../..
|
||||||
|
@ -127,7 +131,7 @@ fi
|
||||||
### -- BUILD BOOTLOADER -----------------------------------------
|
### -- BUILD BOOTLOADER -----------------------------------------
|
||||||
|
|
||||||
cd bootloader
|
cd bootloader
|
||||||
export AVRDIR=../build/windows/work/tools/avr
|
export DIRAVR=../build/windows/work/tools/avr
|
||||||
make
|
make
|
||||||
cp ATmegaBOOT.hex ../build/windows/work/bootloader
|
cp ATmegaBOOT.hex ../build/windows/work/bootloader
|
||||||
cd ..
|
cd ..
|
||||||
|
@ -136,13 +140,14 @@ cd ..
|
||||||
|
|
||||||
cd app
|
cd app
|
||||||
|
|
||||||
CLASSPATH="..\\build\\windows\\work\\lib\\RXTXcomm.jar;..\\build\\windows\\work\\lib\\core.jar;..\\build\\windows\\work\\lib\\mrj.jar;..\\build\\windows\\work\\lib\antlr.jar;..\\build\\windows\\work\\lib\\oro.jar;..\\build\\windows\\work\\lib\\registry.jar;..\\build\\windows\\work\\java\\lib\\rt.jar"
|
CLASSPATH="..\\build\\windows\\work\\lib\\RXTXcomm.jar;..\\build\\windows\\work\\lib\\mrj.jar;..\\build\\windows\\work\\lib\antlr.jar;..\\build\\windows\\work\\lib\\oro.jar;..\\build\\windows\\work\\lib\\registry.jar;..\\build\\windows\\work\\java\\lib\\rt.jar"
|
||||||
|
|
||||||
# compile the code as java 1.3, so that the application will run and
|
# 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
|
# show the user an error, rather than crapping out with some strange
|
||||||
# "class not found" crap
|
# "class not found" crap
|
||||||
../build/windows/work/jikes -target 1.3 +D -classpath "$CLASSPATH;..\\build\\windows\\work\\classes" -d ..\\build\\windows\\work\\classes *.java preproc/*.java syntax/*.java tools/*.java
|
# need to do this twice because otherwise dependencies aren't resolved right.
|
||||||
#/cygdrive/c/jdk-1.4.2_05/bin/javac.exe -classpath $CLASSPATH -d ..\\build\\windows\\work\\classes *.java jeditsyntax/*.java preprocessor/*.java
|
../build/windows/work/jikes -target 1.3 +D -classpath "$CLASSPATH;..\\build\\windows\\work\\classes" -d ..\\build\\windows\\work\\classes preproc/*.java syntax/*.java tools/*.java *.java
|
||||||
|
../build/windows/work/jikes -target 1.3 +D -classpath "$CLASSPATH;..\\build\\windows\\work\\classes" -d ..\\build\\windows\\work\\classes preproc/*.java syntax/*.java tools/*.java *.java
|
||||||
|
|
||||||
cd ../build/windows/work/classes
|
cd ../build/windows/work/classes
|
||||||
rm -f ../lib/pde.jar
|
rm -f ../lib/pde.jar
|
||||||
|
@ -152,27 +157,6 @@ zip -0rq ../lib/pde.jar .
|
||||||
cd ../..
|
cd ../..
|
||||||
|
|
||||||
|
|
||||||
### -- BUILD LIBRARIES ------------------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
PLATFORM=windows
|
|
||||||
|
|
||||||
|
|
||||||
CLASSPATH="..\\build\\$PLATFORM\\work\\lib\\core.jar;..\\build\\$PLATFORM\\work\\java\\lib\\rt.jar"
|
|
||||||
JIKES=../build/$PLATFORM/work/jikes
|
|
||||||
CORE="..\\build\\$PLATFORM\\work\\lib\\core.jar"
|
|
||||||
LIBRARIES="..\\build\\$PLATFORM\\work\\libraries"
|
|
||||||
|
|
||||||
# move to arduino/build
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CLASSPATH="..\\..\\build\\$PLATFORM\\work\\lib\\core.jar;..\\..\\build\\$PLATFORM\\work\\java\\lib\\rt.jar"
|
|
||||||
JIKES=../../build/$PLATFORM/work/jikes
|
|
||||||
CORE=..\\..\\build\\$PLATFORM\\work\\lib\\core.jar
|
|
||||||
LIBRARIES=..\\..\\build\\$PLATFORM\\work\\libraries
|
|
||||||
|
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo Done.
|
echo Done.
|
||||||
|
|
|
@ -1,421 +0,0 @@
|
||||||
# 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
|
|
||||||
SRC = pins_arduino.c wiring.c ../lib/avrlib/uart.c ../lib/avrlib/buffer.c ../lib/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 = ../lib/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
|
|
||||||
all: begin gccversion build 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
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,421 +0,0 @@
|
||||||
# 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
|
|
||||||
SRC = pins_arduino.c wiring.c ../lib/avrlib/uart.c ../lib/avrlib/buffer.c ../lib/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 = ../lib/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
|
|
||||||
all: begin gccversion build 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
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue