Hi

Sadly makefiles are hard to read. I usually write generic makefiles so i
only need to do it once ;)

Stanley Lee wrote:
> PROG_NAME = LED_toggle.hex
> OBJS = main.o
> all: $(PROG_NAME)
> 
> #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 $<
As someone said earlier, this rule just tells make how to produce the
corresponding .o file from a .c file. The .o files are listed in the
ONJS variable. If you have have split up your project to more than one
file you just need to add them with whitespaces to the OBJS variable
lie: OBJS main.o my_special_ad_routines.o somethin_else.o etc.


> 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? if I am using PICKIT2 programmer, would I be
> commanding the programmer to look in /dev/usbxxx, x being number?

if you used piklab before to flash your pic, just look what commandline
it used to do so. You can see them in the output window. Then copy this
line to the makefile and your done. Thats how i did it.
Also look at piklab-prog --programmer-list to see wether your programmer
is supported.
For the pickit2 i think you just need the replace the
--programmer=direct --port=/dev/parport0 with
--programmer=direct=pickit2 maybe togehter with the right port.


-------------------------------------------------------------------------
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