Move default pins over to Getting Started defaults
[RF24-C.git] / examples / scanner / Jamfile
blob1bf541e68db85924d12c02ca9055de7455aa1859
1 # (1) Project Information
3 PROJECT_LIBS    = SPI RF24 ; 
5 # (2) Board Information
7 UPLOAD_PROTOCOL ?= stk500v1 ;
8 UPLOAD_SPEED    ?= 57600 ;
9 MCU             ?= atmega328p ;
10 F_CPU           ?= 16000000 ;
11 CORE            ?= arduino ;
12 VARIANT         ?= standard ;
13 ARDUINO_VERSION ?= 100 ;
15 # (3) USB Ports
17 PORTS           = p4 p6 p9 u0 u1 u2 ;
18 PORT_p6         = /dev/tty.usbserial-A600eHIs ;
19 PORT_p4         = /dev/tty.usbserial-A40081RP ;
20 PORT_p9         = /dev/tty.usbserial-A9007LmI ;
21 PORT_u0         = /dev/ttyUSB0 ;
22 PORT_u1         = /dev/ttyUSB1 ;
23 PORT_u2         = /dev/ttyUSB2 ;
25 # (4) Location of AVR tools
27 # This configuration assumes using avr-tools that were obtained separate from the Arduino
28 # distribution. 
30 if $(OS) = MACOSX 
32         AVR_BIN         = /usr/local/avrtools/bin ;
33         AVR_ETC         = /usr/local/avrtools/etc ;
34         AVR_INCLUDE     = /usr/local/avrtools/include ; 
36 else
38         AVR_BIN         = /usr/bin ;
39         AVR_INCLUDE     = /usr/lib/avr/include ;
40         AVR_ETC         = /etc ; 
43 # (5) Directories where Arduino core and libraries are located
45 ARDUINO_DIR     ?= /opt/Arduino ;
46 ARDUINO_CORE    = $(ARDUINO_DIR)/hardware/arduino/cores/$(CORE) $(ARDUINO_DIR)/hardware/arduino/variants/$(VARIANT) ;
47 ARDUINO_LIB     = $(ARDUINO_DIR)/libraries ;
48 SKETCH_LIB      = $(HOME)/Source/Arduino/libraries ;
51 # --------------------------------------------------
52 # Below this line usually never needs to be modified 
55 # Tool locations
57 CC              = $(AVR_BIN)/avr-gcc ;
58 C++             = $(AVR_BIN)/avr-g++ ;
59 LINK            = $(AVR_BIN)/avr-gcc ;
60 OBJCOPY         = $(AVR_BIN)/avr-objcopy ;
61 AVRDUDE         = $(AVR_BIN)/avrdude ;
63 # Flags
65 DEFINES         += F_CPU=$(F_CPU)L ARDUINO=$(ARDUINO_VERSION) VERSION_H ;
66 OPTIM           = -Os ;
67 CCFLAGS         = -Wall -Wextra -mmcu=$(MCU) -ffunction-sections -fdata-sections ;
68 C++FLAGS        = $(CCFLAGS) -fno-exceptions -fno-strict-aliasing ;
69 LINKFLAGS       = $(OPTIM) -lm -Wl,--gc-sections -mmcu=$(MCU) ;
70 AVRDUDEFLAGS    = -V -F -D -C $(AVR_ETC)/avrdude.conf -p $(MCU) -c $(UPLOAD_PROTOCOL) -b $(UPLOAD_SPEED) ;
72 # Search everywhere for headers
74 HDRS            = $(PWD) $(AVR_INCLUDE) $(ARDUINO_CORE) $(ARDUINO_LIB)/$(PROJECT_LIBS) $(ARDUINO_LIB)/$(PROJECT_LIBS)/utility $(SKETCH_LIB)/$(PROJECT_LIBS) ;
76 # Output locations
78 LOCATE_TARGET   = $(F_CPU) ;
79 LOCATE_SOURCE   = $(F_CPU) ;
82 # Custom rules
85 rule GitVersion
87         Always $(<) ;
88         Depends all : $(<) ;
91 actions GitVersion
93         echo "const char program_version[] = \"\\" > $(<)
94         git log -1 --pretty=format:%h >> $(<)
95         echo "\";" >> $(<)
98 GitVersion version.h ;
100 rule Pde
102         Depends $(<) : $(>) ;
103         MakeLocate $(<) : $(LOCATE_SOURCE) ;
104         Clean clean : $(<) ;
107 if ( $(ARDUINO_VERSION) < 100 )
109         ARDUINO_H = WProgram.h ;
111 else
113         ARDUINO_H = Arduino.h ;
116 actions Pde
118         echo "#include <$(ARDUINO_H)>" > $(<) 
119         echo "#line 1 \"$(>)\"" >> $(<)
120         cat $(>) >> $(<) 
123 rule C++Pde
125         local _CPP = $(>:B).cpp ;
126         Pde $(_CPP) : $(>) ;
127         C++ $(<) : $(_CPP) ;
130 rule UserObject
132         switch $(>:S)
133         {
134                 case .ino : C++Pde $(<) : $(>) ;
135                 case .pde : C++Pde $(<) : $(>) ;
136         }
139 rule Objects
141         local _i ;
143         for _i in [ FGristFiles $(<) ]
144         {
145                 local _b = $(_i:B)$(SUFOBJ) ;
146                 local _o = $(_b:G=$(SOURCE_GRIST:E)) ;
147                 Object $(_o) : $(_i) ;
148                 Depends obj : $(_o) ;
149         }
152 rule Main
154         MainFromObjects $(<) : $(>:B)$(SUFOBJ) ;
155         Objects $(>) ;
158 rule Hex
160         Depends $(<) : $(>) ;
161         MakeLocate $(<) : $(LOCATE_TARGET) ;
162         Depends hex : $(<) ;
163         Clean clean : $(<) ;
166 actions Hex
168         $(OBJCOPY) -O ihex -R .eeprom $(>) $(<)
171 rule Upload
173         Depends $(1) : $(2) ;
174         Depends $(2) : $(3) ;
175         NotFile $(1) ;
176         Always $(1) ;
177         Always $(2) ;
178         UploadAction $(2) : $(3) ;
181 actions UploadAction
183         $(AVRDUDE) $(AVRDUDEFLAGS) -P $(<) $(AVRDUDE_WRITE_FLASH) -U flash:w:$(>):i
187 # Targets
190 # Grab everything from the core directory
191 CORE_MODULES    = [ GLOB $(ARDUINO_CORE) : *.c *.cpp ] ;
193 # Grab everything from libraries.  To avoid this "grab everything" behaviour, you
194 # can specify specific modules to pick up in PROJECT_MODULES
195 LIB_MODULES     = [ GLOB $(ARDUINO_LIB)/$(PROJECT_LIBS) $(ARDUINO_LIB)/$(PROJECT_LIBS)/utility $(SKETCH_LIB)/$(PROJECT_LIBS) : *.cpp *.c ] ;
197 # Grab everything from the current dir
198 PROJECT_MODULES += [ GLOB $(PWD) : *.c *.cpp *.pde *.ino ] ;
200 # Main output executable
201 MAIN            = $(PWD:B).elf ;
203 Main $(MAIN) : $(CORE_MODULES) $(LIB_MODULES) $(PROJECT_MODULES) ;
204 Hex $(MAIN:B).hex : $(MAIN) ;
206 # Upload targets
207 for _p in $(PORTS)
209         Upload $(_p) : $(PORT_$(_p)) : $(MAIN:B).hex ;