Author Topic: Solved: Issues with Makefile (Axon + Ubuntu)  (Read 4106 times)

0 Members and 1 Guest are viewing this topic.

Offline RyltarTopic starter

  • Full Member
  • ***
  • Posts: 72
  • Helpful? 1
Solved: Issues with Makefile (Axon + Ubuntu)
« on: April 01, 2010, 03:31:16 PM »
Hello,

I am currently working on a new robot using the Axon. When my Windows XP system still function, I was able to program the Axon easily. I am now on a Ubuntu system (9.10) and am having issues. I looked around first and found the topic "HOW-TO Axon with Ubuntu". Following the guide there, I've managed to get all the components set up. I can even talk to the Axon using minicom.

My issue arises during the building of the hex file. I try to use the default makefile included in Admin's source code and I get the following message"
Code: [Select]
glitchtech@ronin:~/Desktop/Robotics/AxonOne$ make
.dep/a2d.o.d:1: *** multiple target patterns.  Stop.

When I try to use the shorter makefile in the topic, I get this error:
Code: [Select]
glitchtech@ronin:~/Desktop/Robotics/AxonOne$ make build
Compiling a2d.c...
make: *** No rule to make target `main.o', needed by `AxonOne.bin'.  Stop.

If I remove the reference to main.o then I get:
Code: [Select]
glitchtech@ronin:~/Desktop/Robotics/AxonOne$ make
Compiling buffer.c...
Compiling rprintf.c...
Compiling timer640.c...
Compiling uart4.c...
Linking a2d.o buffer.o rprintf.o timer640.o uart4.o to AxonOne.bin...
/usr/lib/gcc/avr/4.3.3/../../../avr/lib/avr5/crtm640.o: In function `__bad_interrupt':
../../../../crt1/gcrt1.S:193: undefined reference to `main'
make: *** [AxonOne.bin] Error 1

I'm not having any luck figuring out what to do now. Anyone able to help me work these kinks out?

Thanks for any help. I guess if worse comes to worse, I can see about moving back to windows  :-\
« Last Edit: April 02, 2010, 03:42:10 PM by Ryltar »

Offline chelmi

  • Supreme Robot
  • *****
  • Posts: 496
  • Helpful? 15
Re: Issues with Makefile (Axon + Ubuntu)
« Reply #1 on: April 01, 2010, 04:53:27 PM »
do you have a main.c file in your directory?

Offline RyltarTopic starter

  • Full Member
  • ***
  • Posts: 72
  • Helpful? 1
Re: Issues with Makefile (Axon + Ubuntu)
« Reply #2 on: April 01, 2010, 05:29:05 PM »
do you have a main.c file in your directory?

Adding a main.c (main.h too) file causes the same error as removing the reference to main.o. I made sure to make clean first as well.

Code: [Select]
glitchtech@ronin:~/Desktop/Robotics/AxonOne$ make
Compiling a2d.c...
Compiling main.c...
Compiling buffer.c...
Compiling rprintf.c...
Compiling timer640.c...
Compiling uart4.c...
Linking a2d.o main.o buffer.o rprintf.o timer640.o uart4.o to AxonOne.bin...
/usr/lib/gcc/avr/4.3.3/../../../avr/lib/avr5/crtm640.o: In function `__bad_interrupt':
../../../../crt1/gcrt1.S:193: undefined reference to `main'
make: *** [AxonOne.bin] Error 1

Looking at the error, I'd almost say that there is an issue with my avr library, but what do I know... I'm still new to this.

Looking into the error "../../../../crt1/gcrt1.S:193: undefined reference to `main'", it seems like the compiler cannot find my main function (in the file AxonOne.c), though the function does exist.
« Last Edit: April 01, 2010, 05:40:02 PM by Ryltar »

Offline chelmi

  • Supreme Robot
  • *****
  • Posts: 496
  • Helpful? 15
Re: Issues with Makefile (Axon + Ubuntu)
« Reply #3 on: April 02, 2010, 09:42:02 AM »
Looking into the error "../../../../crt1/gcrt1.S:193: undefined reference to `main'", it seems like the compiler cannot find my main function (in the file AxonOne.c), though the function does exist.

Yes.

what do you have in main.c ?
Your file AxonOne.c is not part of the list of compiled files, try adding a reference to it.

Offline RyltarTopic starter

  • Full Member
  • ***
  • Posts: 72
  • Helpful? 1
Re: Issues with Makefile (Axon + Ubuntu)
« Reply #4 on: April 02, 2010, 10:36:12 AM »
I was leaving the main.c empty. I tried adding axonone to object list but no joy. So I went back and started from scratch with the latest release of the Axon source code. I was able to get it functional. I'm not sure what I would have done to fix the makefile/my code though.

Now I am going to work on getting Admin's makefile to properly program the bot with the make build command.

Thanks for your help chelmi.

Offline RyltarTopic starter

  • Full Member
  • ***
  • Posts: 72
  • Helpful? 1
Re: Issues with Makefile (Axon + Ubuntu)
« Reply #5 on: April 02, 2010, 03:41:48 PM »
Just an update on this. I'm able to program the Axon using a slightly modified version of Admin's makefile on Ubuntu. Now on to the next task: getting it to move correctly :)

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,657
  • Helpful? 169
    • Society of Robots
Re: Solved: Issues with Makefile (Axon + Ubuntu)
« Reply #6 on: April 03, 2010, 08:39:37 PM »
Quote
I'm able to program the Axon using a slightly modified version of Admin's makefile on Ubuntu.
Just in case someone else has the same problem, please share :P

Offline RyltarTopic starter

  • Full Member
  • ***
  • Posts: 72
  • Helpful? 1
Re: Solved: Issues with Makefile (Axon + Ubuntu)
« Reply #7 on: April 04, 2010, 06:42:14 PM »
Quote
I'm able to program the Axon using a slightly modified version of Admin's makefile on Ubuntu.
Just in case someone else has the same problem, please share :P

Oh heh. Probably would be a good idea. You will need to change the DEVNODE variable to match which port your USB/Axon connection is using. Make sure you follow the rest of the guide given in the first post. Couldn't have done it with out that.
« Last Edit: April 04, 2010, 06:43:38 PM by Ryltar »

 


Get Your Ad Here

data_list