Stanley Lee wrote:

> #for the .c.o directive below, do I need to replace it with the 
> <filename>.c <filename>.o instead of .c.o? i.e. how would I know which 
> source code to compile and build?
>
> .c.o:
>        $(CC)  $(CFLAGS) $(INC) -c $<

I'm no expert on makefiles, but perhaps you want to use
%.o : %.c

I think that means: "anyfilename.o depends on samename.c"

When linker goes looking for the dependencies listed in
your link target, $(OBJS), which in this case is a single file
named "main.o", it will use that rule to know that
main.o depends on main.c, and use the command that
follows to compile main.

> #rule to link the final executable
> $(PROG_NAME): $(OBJS)
>        $(LNK) $(DEBUG) $(LDFLAGS) $(CRT) -Wl-s$(lkr_PIC_TYPE).lkr,-m 
> -mpic16 -p$(sdcc_PIC_TYPE) $+ -o $(@) -llibio$(sdcc_PIC_TYPE).lib - 
> llibc18f.lib

I use "$< -o $@"
where you have "$+ -o $(@)".
I don't know if extra parentheses matter.

According to the make manual, $+ means all of the
dependencies  including repeats,
and $< means just the first.  As long as there is just one,
as in "%.o : %.c" it should not matter.

> prog: $(PROG_NAME)
>        piklab-prog --programmer=direct --port=/dev/parport0 
> --device=$(sdcc_PIC_TYPE) --command=program $(PROG_NAME)
>
> #would the prog directive be telling the makefile to flash the hexfile 
> to the microcontroller?

That looks like what it is doing.

> if I am using PICKIT2 programmer, would I be commanding the programmer 
> to look in /dev/usbxxx, x being number? 

I can't comment on pickit2, as I am not using it.
Also, I am not even using pic, I am using z80, so I
can't comment on the options related to pic, either.

Randy








-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to