aravind0220 / arduino

Automatically exported from code.google.com/p/arduino
0 stars 0 forks source link

makefile broken on Mac using Serial.begin #65

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. mkdir Broken
2. cd Broken
3. mate Broken.pde
// Broken.pde
void setup() {
}

void loop() {
}

4. cp /Applications/arduino-0016/hardware/cores/arduino/Makefile .
5. mate Makefile
INSTALL_DIR = /Application/arduino-0016
6. make

What is the expected output? What do you see instead?

Broken$ make
Makefile:242: ../../../hardware/cores/arduino/pins_arduino.d: No such file
or directory
Makefile:242: ../../../hardware/cores/arduino/wiring.d: No such file or
directory
Makefile:242: ../../../hardware/cores/arduino/wiring_analog.d: No such file
or directory
Makefile:242: ../../../hardware/cores/arduino/wiring_digital.d: No such
file or directory
Makefile:242: ../../../hardware/cores/arduino/wiring_pulse.d: No such file
or directory
Makefile:242: ../../../hardware/cores/arduino/wiring_serial.d: No such file
or directory
Makefile:242: ../../../hardware/cores/arduino/wiring_shift.d: No such file
or directory
Makefile:242: ../../../hardware/cores/arduino/WInterrupts.d: No such file
or directory
Makefile:243: ../../../hardware/cores/arduino/HardwareSerial.d: No such
file or directory
Makefile:243: ../../../hardware/cores/arduino/WMath.d: No such file or
directory
Makefile:243: ../../../hardware/cores/arduino/Print.d: No such file or
directory
make: *** No rule to make target `../../../hardware/cores/arduino/Print.d'.
 Stop.

What version of the Arduino software are you using? arduino-0016
On what operating system? Mac 10.5.7
Which Arduino board are you using?
http://www.sparkfun.com/commerce/product_info.php?products_id=666

Please provide any additional information below.

The sketch builds fine in the IDE.

Original issue reported on code.google.com by ghule...@gmail.com on 29 Jul 2009 at 5:55

GoogleCodeExporter commented 9 years ago
First of all: I get the warnings about nonexistent files on the first run. 
These warnings are not helpful and they 
obscure the real error: 

Which is that $(ARDUINO)/wiring_serial.c is in the SRC list in the Makefile, 
but the source file does not exist 
(should it have been wiring_analog.c?)

Once I fixed that problem, the example built fine and subsequent passes went 
without warning.

The warnings could be avoided by shipping the .d files. There might be other 
ways too, I'll go investigate a 
bit.

I have a attached a patch for the 0016 Makefile that fixed the problem for me.

Original comment by la2...@gmail.com on 15 Aug 2009 at 7:20

Attachments:

GoogleCodeExporter commented 9 years ago
Issue 83 has been merged into this issue.

Original comment by dmel...@gmail.com on 15 Aug 2009 at 8:47

GoogleCodeExporter commented 9 years ago
There is  another way to avoid the warning - prefix the include direcives in 
the Makefile with a hyphen (doh - 
that should have been obvious to me):

-include $(SRC:.c=.d)
-include $(CXXSRC:.cpp=.d)

The upside: with this change, the invalid SRC list from the originalk 0016 
Makefile gives the correct error:

make: *** No rule to make target 
`../arduino-0016/hardware/cores/arduino/wiring_serial.o', needed by 
`applet/core.a'.  Stop.

The downside is that errors in the dependency generation may be obscured (IMO 
an acceptable risk).

I have attached another patch with this change.

Original comment by la2...@gmail.com on 16 Aug 2009 at 10:13

Attachments:

GoogleCodeExporter commented 9 years ago
I just committed this patch and removed wiring_serial.c from the source list.  
Thanks for your help.

Original comment by dmel...@gmail.com on 16 Aug 2009 at 10:22

GoogleCodeExporter commented 9 years ago
The committed version resolves my problem.  Thanks!

Original comment by ghule...@gmail.com on 17 Aug 2009 at 5:48