I've only recently began familiarizing myself with UNIX, GCC and Make.
I've have learned a wonderful amount l since I started but feel at the moment that I am pretty hung up.
My immediate goals right now are:
-Link an object file from an asm source with an object file from a cpp source with out error
-Upload to maple
I've been making very small steps toward the first item's completion but am all out of ideas. my calls in main.cpp for delay() and SerialUSB.println() produce errors of the kind
main.cpp: In function 'void loop()':
main.cpp:27: error: 'SerialUSB' was not declared in this scope
So i assume the i am not properly linking against libmaple.a as its been said i should do. or that i haven't properly modified the include path. maybe i'm misunderstanding what is meant by " your include path should contain the directories ~/libmaple/libmaple and ~/libmaple/wirish/". Someone please set me straight. I should note that when i comment out the calls for SerialUSB.println() and delay() make does produce all the target files. Whether or not they are produced correctly, I don't know. Also, the actual program i will finally upload to Maple will be alot more dependent on libmaple than just using SerialUSB.println() and delay(). I'll be using the register map for ADC and DMA stuff. so i cant just replace them with a more standard implementation.
this is the Makefile:
###############################################################
OBJ = main.o asm.o
INC = -I~/libmaple/libmaple -I~/libmaple/wirish -I~/libmaple/wirish/wirish.h
CC = ~/libmaple/arm/bin/arm-none-eabi-gcc
program : $(OBJ)
$(CC) -Wall -L ~/libmaple/build/ -l maple \
-o program.elf
main.o : main.cpp
$(CC) -Wall $(INC) -c main.cpp
asm.o : asm.s
$(CC) -Wall $(INC) -x assembler-with-cpp asm.s
###############################################################
Yes, it's true, i don't know what i'm doing. but I am desperately trying to figure that out. Any guidance is much appreciated.