Loading ...
Sorry, an error occurred while loading the content.

Re: GNU Make problem

Expand Messages
  • Dave Baker
    Hi Josh, Thanks for your reply. My makefile didn t have the $ missing on the (OBJ2) - it was just my posting. I still haven t found a way to specify a folder
    Message 1 of 18 , Jul 2, 2005
    • 0 Attachment
      Hi Josh,

      Thanks for your reply. My makefile didn't have the $
      missing on the (OBJ2) - it was just my posting. I
      still haven't found a way to specify a folder for the
      object files to the linker other to than the one where
      the source files are (no problem compiling to a
      different folder though).

      Do you have any ideas how I can specify a different
      folder for my object files ?

      Dave

      makefile snippet:

      .
      .
      OBJ = $(SRC:.c=.o)
      OBJ_NOPATH = $(notdir OBJ)
      OBJ2 = $(addprefix ./obj/,OBJ_NOPATH)

      bringup.elf: $(OBJ2) makefile
      $(CC) $(CFLAGS) $(OBJ2) -nostartfiles $(LINKER_FLAGS)

      $(OBJ) : %.o : %.c $(LDSCRIPT) makefile
      $(CC) -c $(CFLAGS) $< -o ./obj/$@


      --- joshcurtz <joshcurtz@...> wrote:


      ---------------------------------
      > bringup.elf: $(OBJ2) makefile
      > $(CC) $(CFLAGS) (OBJ2) -nostartfiles
      $(LINKER_FLAGS)
      ^^^^^^

      Did you just copy/paste incorrectly or did you really
      forget to type:
      $(OBJ2) ? You're missing the "$" above.

      Also, the way you've made the "makefile" a
      prerequisite for that
      target is a bit odd and unconventional.






      To Post a message, send it to:
      gnu-m68hc11@...

      To Unsubscribe, send a blank message to:
      gnu-m68hc11-unsubscribe@...



      ---------------------------------
      YAHOO! GROUPS LINKS


      Visit your group "gnu-m68hc11" on the web.

      To unsubscribe from this group, send an email to:
      gnu-m68hc11-unsubscribe@yahoogroups.com

      Your use of Yahoo! Groups is subject to the Yahoo!
      Terms of Service.


      ---------------------------------






      ___________________________________________________________
      How much free photo storage do you get? Store your holiday
      snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com
    • joshcurtz
      ... If you showed me how you ve defined some of the variables, i.e. CFLAGS, LINKER_FLAGS, and LDSCRIPT I might be able to help.
      Message 2 of 18 , Jul 2, 2005
      • 0 Attachment
        --- In gnu-m68hc11@yahoogroups.com, Dave Baker <dave_baker_100@y...>
        wrote:
        >
        > Do you have any ideas how I can specify a different
        > folder for my object files ?
        >
        > Dave

        If you showed me how you've defined some of the variables, i.e.
        CFLAGS, LINKER_FLAGS, and LDSCRIPT I might be able to help.
      • John Volpe
        ... This needs to be $(OBJ_NOPATH) ... Hope that helps. John
        Message 3 of 18 , Jul 2, 2005
        • 0 Attachment
          On Wednesday 29 June 2005 13:25, dave_baker_100 wrote:
          > Hi,
          >
          > I'm sure if anyone can help but I'm trying to build an image using the
          > following makefile snippet:
          >
          > .
          > .
          > OBJ = $(SRC:.c=.o)
          > OBJ_NOPATH = $(notdir OBJ)
          > OBJ2 = $(addprefix ./obj/,OBJ_NOPATH)
          ----------------------------^^^^^^^^^^
          This needs to be $(OBJ_NOPATH)

          >
          > bringup.elf: $(OBJ2) makefile
          > $(CC) $(CFLAGS) (OBJ2) -nostartfiles $(LINKER_FLAGS)
          >
          > $(OBJ) : %.o : %.c $(LDSCRIPT) makefile
          > $(CC) -c $(CFLAGS) $< -o ./obj/$@
          >
          >
          > Basically I'm trying to put my *.o files in a folder called ./obj
          > The *.o files get built but the linker can't find them.
          >
          > Does anyone know what I'm doing wrong ?
          >
          > Thanks
          > Dave
          >
          Hope that helps.

          John
        • John Volpe
          Sorry missed another one. See below........ ... Must be $(OBJ) ... John
          Message 4 of 18 , Jul 2, 2005
          • 0 Attachment
            Sorry missed another one. See below........

            On Wednesday 29 June 2005 13:25, dave_baker_100 wrote:
            > Hi,
            >
            > I'm sure if anyone can help but I'm trying to build an image using the
            > following makefile snippet:
            >
            > .
            > .
            > OBJ = $(SRC:.c=.o)
            > OBJ_NOPATH = $(notdir OBJ)
            ------------------------^^^
            Must be $(OBJ)

            > OBJ2 = $(addprefix ./obj/,OBJ_NOPATH)
            >
            > bringup.elf: $(OBJ2) makefile
            > $(CC) $(CFLAGS) (OBJ2) -nostartfiles $(LINKER_FLAGS)
            >
            > $(OBJ) : %.o : %.c $(LDSCRIPT) makefile
            > $(CC) -c $(CFLAGS) $< -o ./obj/$@
            >
            >
            > Basically I'm trying to put my *.o files in a folder called ./obj
            > The *.o files get built but the linker can't find them.
            >
            > Does anyone know what I'm doing wrong ?
            >
            > Thanks
            > Dave
            >

            John
          • Hubert Moesslein
            Hi Dave, ... OBJ_DIR := ./obj #folder for object files # these are my object files: ObjFiles = $(OBJ_DIR)/crtsx.o $(OBJ_DIR)/setting.o
            Message 5 of 18 , Jul 3, 2005
            • 0 Attachment
              Hi Dave,

              joshcurtz schrieb:
              > --- In gnu-m68hc11@yahoogroups.com, Dave Baker <dave_baker_100@y...>
              > wrote:
              >
              >>Do you have any ideas how I can specify a different
              >>folder for my object files ?
              >>
              >>Dave
              >
              >
              > If you showed me how you've defined some of the variables, i.e.
              > CFLAGS, LINKER_FLAGS, and LDSCRIPT I might be able to help.
              >
              >
              >
              >
              Try the following (snipped out of one onf my makefiles):
              >>>>>>>>>>><

              OBJ_DIR := ./obj #folder for object files


              # these are my object files:

              ObjFiles = $(OBJ_DIR)/crtsx.o \
              $(OBJ_DIR)/setting.o \
              $(OBJ_DIR)/main.o \
              $(OBJ_DIR)/init.o \
              $(OBJ_DIR)/common.o \
              $(OBJ_DIR)/irqs.o \
              $(OBJ_DIR)/display.o \
              $(OBJ_DIR)/epm.o \
              $(OBJ_DIR)/PowArray.o \
              $(OBJ_DIR)/diagnose.o \
              $(OBJ_DIR)/work.o \
              $(OBJ_DIR)/vector.o



              #implicite rules for c- and assemblerfiles:

              $(OBJ_DIR)/%.o: %.s
              $(CC) $(COptions) $<

              $(OBJ_DIR)/%.o: %.c
              $(CC) $(COptions) $<


              #dependencies
              $(OBJ_DIR)/main.o: main.c setting.h lacker.h $(ThisFile)
              $(OBJ_DIR)/init.o: init.c lacker.h $(ThisFile)
              $(OBJ_DIR)/vector.o: vector.c lacker.h $(ThisFile)
              $(OBJ_DIR)/crtsx.o: crtsx.s $(ThisFile)
              $(OBJ_DIR)/irqs.o: irqs.c setting.h lacker.h $(ThisFile)
              $(OBJ_DIR)/setting.o: setting.c setting.h eeprom.h lacker.h $(ThisFile)
              $(OBJ_DIR)/display.o: display.c lacker.h $(ThisFile)
              $(OBJ_DIR)/PowArray.o: PowArray.c $(ThisFile)
              $(OBJ_DIR)/diagnose.o: diagnose.c epm.h common.h setting.h lacker.h $(ThisFile)
              $(OBJ_DIR)/common.o: common.c epm.h common.h setting.h lacker.h $(ThisFile)
              $(OBJ_DIR)/epm.o: epm.c epm.h lacker.h $(ThisFile)
              $(OBJ_DIR)/work.o: work.c epm.h common.h setting.h lacker.h $(ThisFile)

              <<<<<<<<<<<<<<<

              Ciao
              --
              megatec electronic GmbH
              Dipl. Ing. Hubert Moesslein
              Lehenhammer 14
              92268 Etzelwang
              @ : h.moesslein@...
            • dave_baker_100
              Hubert Thanks for the makefile snippet it is a bit easier to see whats going on with this. However John Volpe s posts have got me up & running with the
              Message 6 of 18 , Jul 4, 2005
              • 0 Attachment
                Hubert

                Thanks for the makefile snippet it is a bit easier to see whats going
                on with this. However John Volpe's posts have got me up & running with
                the makefile I am using.

                Regards
                Dave

                --- In gnu-m68hc11@yahoogroups.com, Hubert Moesslein <msl@m...> wrote:
                > Hi Dave,
                >
                > joshcurtz schrieb:
                > > --- In gnu-m68hc11@yahoogroups.com, Dave Baker <dave_baker_100@y.
                ..>
                > > wrote:
                > >
                > >>Do you have any ideas how I can specify a different
                > >>folder for my object files ?
                > >>
                > >>Dave
                > >
                > >
                > > If you showed me how you've defined some of the variables, i.e.
                > > CFLAGS, LINKER_FLAGS, and LDSCRIPT I might be able to help.
                > >
                > >
                > >
                > >
                > Try the following (snipped out of one onf my makefiles):
                > >>>>>>>>>>><
                >
                > OBJ_DIR := ./obj #folder for object files
                >
                >
                > # these are my object files:
                >
                > ObjFiles = $(OBJ_DIR)/crtsx.o \
                > $(OBJ_DIR)/setting.o \
                > $(OBJ_DIR)/main.o \
                > $(OBJ_DIR)/init.o \
                > $(OBJ_DIR)/common.o \
                > $(OBJ_DIR)/irqs.o \
                > $(OBJ_DIR)/display.o \
                > $(OBJ_DIR)/epm.o \
                > $(OBJ_DIR)/PowArray.o \
                > $(OBJ_DIR)/diagnose.o \
                > $(OBJ_DIR)/work.o \
                > $(OBJ_DIR)/vector.o
                >
                >
                >
                > #implicite rules for c- and assemblerfiles:
                >
                > $(OBJ_DIR)/%.o: %.s
                > $(CC) $(COptions) $<
                >
                > $(OBJ_DIR)/%.o: %.c
                > $(CC) $(COptions) $<
                >
                >
                > #dependencies
                > $(OBJ_DIR)/main.o: main.c setting.h lacker.h $(ThisFile)
                > $(OBJ_DIR)/init.o: init.c lacker.h $(ThisFile)
                > $(OBJ_DIR)/vector.o: vector.c lacker.h $(ThisFile)
                > $(OBJ_DIR)/crtsx.o: crtsx.s $(ThisFile)
                > $(OBJ_DIR)/irqs.o: irqs.c setting.h lacker.h $(ThisFile)
                > $(OBJ_DIR)/setting.o: setting.c setting.h eeprom.h lacker.h
                $(ThisFile)
                > $(OBJ_DIR)/display.o: display.c lacker.h $(ThisFile)
                > $(OBJ_DIR)/PowArray.o: PowArray.c $(ThisFile)
                > $(OBJ_DIR)/diagnose.o: diagnose.c epm.h common.h setting.h
                lacker.h $(ThisFile)
                > $(OBJ_DIR)/common.o: common.c epm.h common.h setting.h lacker.h
                $(ThisFile)
                > $(OBJ_DIR)/epm.o: epm.c epm.h lacker.h $(ThisFile)
                > $(OBJ_DIR)/work.o: work.c epm.h common.h setting.h
                lacker.h $(ThisFile)
                >
                > <<<<<<<<<<<<<<<
                >
                > Ciao
                > --
                > megatec electronic GmbH
                > Dipl. Ing. Hubert Moesslein
                > Lehenhammer 14
                > 92268 Etzelwang
                > @ : h.moesslein@m...
              • Dave Baker
                Hi John, Many thanks for your help with my makefile. I ve added another dependancy for assembler files & want to put the *.o files in the same obj directory.
                Message 7 of 18 , Jul 5, 2005
                • 0 Attachment
                  Hi John,

                  Many thanks for your help with my makefile.

                  I've added another dependancy for assembler files &
                  want to put the *.o files in the same obj directory.
                  All the C code compiles ok but I get:

                  make: *** No rule to make target `obj/boot.o', needed
                  by `bringup.elf'. Stop.

                  So obviously the assembly code doesn't get built but I
                  can't see what the problem is.

                  Do you have any clues (makefile below)?

                  Regards
                  Dave

                  ------------------------------------------------------

                  CC=hc11-elf-gcc
                  LDSCRIPT=ram.ld
                  OBJPATH=./obj/

                  CFLAGS = -mcpu=-m68hc11 -T$(LDSCRIPT) -Wall -O -g -I.
                  -I"C:\Cygnus\hc11-elf\include\sys" \

                  LINKER_FLAGS = -Xlinker -obringup.elf -Xlinker -M
                  -Xlinker -Map=bringup.map

                  HC11_SRC = \
                  commands.c \
                  crc16.c \
                  main.c \
                  printf.c \
                  progflash.c \
                  serial.c \
                  syscalls.c \
                  xmodem.c \

                  ASSEM_SRC = \
                  boot.s \
                  fft_test.s

                  HC11_OBJ = $(HC11_SRC:.c=.o)
                  ASSEM_OBJ = $(ASSEM_SRC:.s=.o)

                  HC11_OBJ_NOPATH = $(notdir $(HC11_OBJ))
                  HC11_OBJ2 = $(addprefix $(OBJ),$(HC11_OBJ_NOPATH))
                  ASSEM_OBJ_NOPATH = $(notdir $(ASSEM_OBJ))
                  ASSEM_OBJ2 = $(addprefix
                  $(OBJPATH),$(ASSEM_OBJ_NOPATH))

                  bringup.elf: $(HC11_OBJ) $(ASSEM_OBJ2)
                  $(CC) $(CFLAGS) $(HC11_SRC) $(ASSEM_SRC)
                  -nostartfiles $(LINKER_FLAGS)

                  $(HC11_OBJ) : %.o : %.c
                  $(CC) -c $(CFLAGS) $< -o $(OBJPATH)$@

                  $(ASSEM_OBJ) : %.o : %.s
                  $(CC) -c $(CFLAGS) $< -o $(OBJPATH)$@





                  --- John Volpe <jtvolpe@...> wrote:


                  ---------------------------------
                  Sorry missed another one. See below........

                  On Wednesday 29 June 2005 13:25, dave_baker_100 wrote:
                  > Hi,
                  >
                  > I'm sure if anyone can help but I'm trying to build
                  an image using the
                  > following makefile snippet:
                  >
                  > .
                  > .
                  > OBJ = $(SRC:.c=.o)
                  > OBJ_NOPATH = $(notdir OBJ)
                  ------------------------^^^
                  Must be $(OBJ)

                  > OBJ2 = $(addprefix ./obj/,OBJ_NOPATH)
                  >
                  > bringup.elf: $(OBJ2) makefile
                  > $(CC) $(CFLAGS) (OBJ2) -nostartfiles
                  $(LINKER_FLAGS)
                  >
                  > $(OBJ) : %.o : %.c $(LDSCRIPT) makefile
                  > $(CC) -c $(CFLAGS) $< -o ./obj/$@
                  >
                  >
                  > Basically I'm trying to put my *.o files in a folder
                  called ./obj
                  > The *.o files get built but the linker can't find
                  them.
                  >
                  > Does anyone know what I'm doing wrong ?
                  >
                  > Thanks
                  > Dave
                  >

                  John


                  To Post a message, send it to:
                  gnu-m68hc11@...

                  To Unsubscribe, send a blank message to:
                  gnu-m68hc11-unsubscribe@...



                  ---------------------------------
                  YAHOO! GROUPS LINKS


                  Visit your group "gnu-m68hc11" on the web.

                  To unsubscribe from this group, send an email to:
                  gnu-m68hc11-unsubscribe@yahoogroups.com

                  Your use of Yahoo! Groups is subject to the Yahoo!
                  Terms of Service.


                  ---------------------------------






                  ___________________________________________________________
                  How much free photo storage do you get? Store your holiday
                  snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com
                • 42Bastian Schick
                  Hubert ... What is $(ThisFile), just a replacement for $@ ? -- 42Bastian Schick
                  Message 8 of 18 , Jul 5, 2005
                  • 0 Attachment
                    Hubert

                    > $(OBJ_DIR)/epm.o: epm.c epm.h lacker.h $(ThisFile)

                    What is $(ThisFile), just a replacement for $@ ?

                    --
                    42Bastian Schick
                  • Hubert Moesslein
                    ... $(Thisfile) is a variable that holds the name of the actual makefile. This ensures the rebuild of my project, if anythings changes in the makefile. ...
                    Message 9 of 18 , Jul 5, 2005
                    • 0 Attachment
                      42Bastian Schick schrieb:
                      > Hubert
                      >
                      >
                      >>$(OBJ_DIR)/epm.o: epm.c epm.h lacker.h $(ThisFile)
                      >
                      >
                      > What is $(ThisFile), just a replacement for $@ ?
                      $(Thisfile) is a variable that holds the name of the actual makefile.
                      This ensures the rebuild of my project, if anythings changes in the makefile.

                      >
                      Ciao
                      --
                      megatec electronic GmbH
                      Dipl. Ing. Hubert Moesslein
                      Lehenhammer 14
                      92268 Etzelwang
                      @ : h.moesslein@...
                    • John Volpe
                      Hi Dave, There are two ways to approach this : 1) Start with the sources and generate object dependencies based on them, or 2) start with the objects and
                      Message 10 of 18 , Jul 5, 2005
                      • 0 Attachment
                        Hi Dave,

                        There are two ways to approach this : 1) Start with the sources and generate
                        object dependencies based on them, or 2) start with the objects and generate
                        source dependencies from the objects.

                        You have started with the sources, so I have included a "corrected" makefile
                        which starts with sources. I say corrected but this is still just my opinion
                        and do not want to start a flame war over this. You can probably get as many
                        methods for doing this as people subscribed to the list.

                        I have not tried to run this but I believe that it will work. Give me a shout
                        if you need anything else.

                        John

                        CC=hc11-elf-gcc
                        LDSCRIPT=ram.ld
                        OBJPATH=./obj/

                        CFLAGS = -mcpu=-m68hc11 -T$(LDSCRIPT) -Wall -O -g -I. -I"C:
                        \Cygnus\hc11-elf\include\sys" \

                        LINKER_FLAGS = -Xlinker -obringup.elf -Xlinker -M -Xlinker -Map=bringup.map

                        HC11_SRC = \
                        commands.c \
                        crc16.c \
                        main.c \
                        printf.c \
                        progflash.c \
                        serial.c \
                        syscalls.c \
                        xmodem.c \

                        ASSEM_SRC = \
                        boot.s \
                        fft_test.s

                        #
                        # These two lines give the correct object files with paths
                        #
                        HC11_OBJ = $(addprefix $(OBJPATH),$(HC11_SRC:.c=.o))
                        ASSEM_OBJ = $(addprefix $(OBJPATH),$(ASSEM_SRC:.s=.o))

                        bringup.elf: $(HC11_OBJ) $(ASSEM_OBJ)
                        $(CC) $(CFLAGS) -nostartfiles $(LINKER_FLAGS) $(HC11_OBJ) $(ASSEM_OBJ)

                        $(HC11_OBJ) : $(OBJPATH)%.o : %.c
                        $(CC) -c $(CFLAGS) -o $@ $<

                        $(ASSEM_OBJ) : $(OBJPATH)%.o : %.s
                        $(CC) -c $(CFLAGS) -o $@ $<



                        On Tuesday 05 July 2005 03:32, Dave Baker wrote:
                        > Hi John,
                        >
                        > Many thanks for your help with my makefile.
                        >
                        > I've added another dependancy for assembler files &
                        > want to put the *.o files in the same obj directory.
                        > All the C code compiles ok but I get:
                        >
                        > make: *** No rule to make target `obj/boot.o', needed
                        > by `bringup.elf'. Stop.
                        >
                        > So obviously the assembly code doesn't get built but I
                        > can't see what the problem is.
                        >
                        > Do you have any clues (makefile below)?
                        >
                        > Regards
                        > Dave
                        >
                        > ------------------------------------------------------
                        >
                        > CC=hc11-elf-gcc
                        > LDSCRIPT=ram.ld
                        > OBJPATH=./obj/
                        >
                        > CFLAGS = -mcpu=-m68hc11 -T$(LDSCRIPT) -Wall -O -g -I.
                        > -I"C:\Cygnus\hc11-elf\include\sys" \
                        >
                        > LINKER_FLAGS = -Xlinker -obringup.elf -Xlinker -M
                        > -Xlinker -Map=bringup.map
                        >
                        > HC11_SRC = \
                        > commands.c \
                        > crc16.c \
                        > main.c \
                        > printf.c \
                        > progflash.c \
                        > serial.c \
                        > syscalls.c \
                        > xmodem.c \
                        >
                        > ASSEM_SRC = \
                        > boot.s \
                        > fft_test.s
                        >
                        > HC11_OBJ = $(HC11_SRC:.c=.o)
                        > ASSEM_OBJ = $(ASSEM_SRC:.s=.o)
                        >
                        > HC11_OBJ_NOPATH = $(notdir $(HC11_OBJ))
                        > HC11_OBJ2 = $(addprefix $(OBJ),$(HC11_OBJ_NOPATH))
                        > ASSEM_OBJ_NOPATH = $(notdir $(ASSEM_OBJ))
                        > ASSEM_OBJ2 = $(addprefix $(OBJPATH),$(ASSEM_OBJ_NOPATH))
                        >
                        > bringup.elf: $(HC11_OBJ) $(ASSEM_OBJ2)
                        > $(CC) $(CFLAGS) $(HC11_SRC) $(ASSEM_SRC)
                        > -nostartfiles $(LINKER_FLAGS)
                        >
                        > $(HC11_OBJ) : %.o : %.c
                        > $(CC) -c $(CFLAGS) $< -o $(OBJPATH)$@
                        >
                        > $(ASSEM_OBJ) : %.o : %.s
                        > $(CC) -c $(CFLAGS) $< -o $(OBJPATH)$@
                        >
                        >
                        >
                        >
                        >
                        > --- John Volpe <jtvolpe@...> wrote:
                        >
                        >
                        > ---------------------------------
                        > Sorry missed another one. See below........
                        >
                        > On Wednesday 29 June 2005 13:25, dave_baker_100 wrote:
                        > > Hi,
                        > >
                        > > I'm sure if anyone can help but I'm trying to build
                        >
                        > an image using the
                        >
                        > > following makefile snippet:
                        > >
                        > > .
                        > > .
                        > > OBJ = $(SRC:.c=.o)
                        > > OBJ_NOPATH = $(notdir OBJ)
                        >
                        > ------------------------^^^
                        > Must be $(OBJ)
                        >
                        > > OBJ2 = $(addprefix ./obj/,OBJ_NOPATH)
                        > >
                        > > bringup.elf: $(OBJ2) makefile
                        > > $(CC) $(CFLAGS) (OBJ2) -nostartfiles
                        >
                        > $(LINKER_FLAGS)
                        >
                        > > $(OBJ) : %.o : %.c $(LDSCRIPT) makefile
                        > > $(CC) -c $(CFLAGS) $< -o ./obj/$@
                        > >
                        > >
                        > > Basically I'm trying to put my *.o files in a folder
                        >
                        > called ./obj
                        >
                        > > The *.o files get built but the linker can't find
                        >
                        > them.
                        >
                        > > Does anyone know what I'm doing wrong ?
                        > >
                        > > Thanks
                        > > Dave
                        >
                        > John
                        >
                        >
                        > To Post a message, send it to:
                        > gnu-m68hc11@...
                        >
                        > To Unsubscribe, send a blank message to:
                        > gnu-m68hc11-unsubscribe@...
                        >
                        >
                        >
                        > ---------------------------------
                        > YAHOO! GROUPS LINKS
                        >
                        >
                        > Visit your group "gnu-m68hc11" on the web.
                        >
                        > To unsubscribe from this group, send an email to:
                        > gnu-m68hc11-unsubscribe@yahoogroups.com
                        >
                        > Your use of Yahoo! Groups is subject to the Yahoo!
                        > Terms of Service.
                        >
                        >
                        > ---------------------------------
                        >
                        >
                        >
                        >
                        >
                        >
                        > ___________________________________________________________
                        > How much free photo storage do you get? Store your holiday
                        > snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com
                        >
                        >
                        > To Post a message, send it to: gnu-m68hc11@...
                        >
                        > To Unsubscribe, send a blank message to:
                        > gnu-m68hc11-unsubscribe@... Yahoo! Groups Links
                        >
                        >
                        >
                      • dave_baker_100
                        Hi John, It gets worse! I m getting make: Nothing to be done for `bringup. elf . The makefile looks ok & ./obj/*.o don t exist. I m pulling my hair out! Any
                        Message 11 of 18 , Jul 5, 2005
                        • 0 Attachment
                          Hi John,

                          It gets worse! I'm getting "make: Nothing to be done for `bringup.
                          elf'." The makefile looks ok & ./obj/*.o don't exist. I'm pulling my
                          hair out! Any ideas ?

                          Thanks
                          Dave

                          --- In gnu-m68hc11@yahoogroups.com, John Volpe <jtvolpe@c...> wrote:
                          > Hi Dave,
                          >
                          > There are two ways to approach this : 1) Start with the sources and
                          generate
                          > object dependencies based on them, or 2) start with the objects and
                          generate
                          > source dependencies from the objects.
                          >
                          > You have started with the sources, so I have included a "corrected"
                          makefile
                          > which starts with sources. I say corrected but this is still just my
                          opinion
                          > and do not want to start a flame war over this. You can probably
                          get as many
                          > methods for doing this as people subscribed to the list.
                          >
                          > I have not tried to run this but I believe that it will work. Give
                          me a shout
                          > if you need anything else.
                          >
                          > John
                          >
                          > CC=hc11-elf-gcc
                          > LDSCRIPT=ram.ld
                          > OBJPATH=./obj/
                          >
                          > CFLAGS = -mcpu=-m68hc11 -T$(LDSCRIPT) -Wall -O -g -I. -I"C:
                          > \Cygnus\hc11-elf\include\sys" \
                          >
                          > LINKER_FLAGS = -Xlinker -obringup.elf -Xlinker -M -Xlinker -
                          Map=bringup.map
                          >
                          > HC11_SRC = \
                          > commands.c \
                          > crc16.c \
                          > main.c \
                          > printf.c \
                          > progflash.c \
                          > serial.c \
                          > syscalls.c \
                          > xmodem.c \
                          >
                          > ASSEM_SRC = \
                          > boot.s \
                          > fft_test.s
                          >
                          > #
                          > # These two lines give the correct object files with paths
                          > #
                          > HC11_OBJ = $(addprefix $(OBJPATH),$(HC11_SRC:.c=.o))
                          > ASSEM_OBJ = $(addprefix $(OBJPATH),$(ASSEM_SRC:.s=.o))
                          >
                          > bringup.elf: $(HC11_OBJ) $(ASSEM_OBJ)
                          > $(CC) $(CFLAGS) -nostartfiles $(LINKER_FLAGS) $(HC11_OBJ)
                          $(ASSEM_OBJ)
                          >
                          > $(HC11_OBJ) : $(OBJPATH)%.o : %.c
                          > $(CC) -c $(CFLAGS) -o $@ $<
                          >
                          > $(ASSEM_OBJ) : $(OBJPATH)%.o : %.s
                          > $(CC) -c $(CFLAGS) -o $@ $<
                          >
                          >
                          >
                          > On Tuesday 05 July 2005 03:32, Dave Baker wrote:
                          > > Hi John,
                          > >
                          > > Many thanks for your help with my makefile.
                          > >
                          > > I've added another dependancy for assembler files &
                          > > want to put the *.o files in the same obj directory.
                          > > All the C code compiles ok but I get:
                          > >
                          > > make: *** No rule to make target `obj/boot.o', needed
                          > > by `bringup.elf'. Stop.
                          > >
                          > > So obviously the assembly code doesn't get built but I
                          > > can't see what the problem is.
                          > >
                          > > Do you have any clues (makefile below)?
                          > >
                          > > Regards
                          > > Dave
                          > >
                          > > ------------------------------------------------------
                          > >
                          > > CC=hc11-elf-gcc
                          > > LDSCRIPT=ram.ld
                          > > OBJPATH=./obj/
                          > >
                          > > CFLAGS = -mcpu=-m68hc11 -T$(LDSCRIPT) -Wall -O -g -I.
                          > > -I"C:\Cygnus\hc11-elf\include\sys" \
                          > >
                          > > LINKER_FLAGS = -Xlinker -obringup.elf -Xlinker -M
                          > > -Xlinker -Map=bringup.map
                          > >
                          > > HC11_SRC = \
                          > > commands.c \
                          > > crc16.c \
                          > > main.c \
                          > > printf.c \
                          > > progflash.c \
                          > > serial.c \
                          > > syscalls.c \
                          > > xmodem.c \
                          > >
                          > > ASSEM_SRC = \
                          > > boot.s \
                          > > fft_test.s
                          > >
                          > > HC11_OBJ = $(HC11_SRC:.c=.o)
                          > > ASSEM_OBJ = $(ASSEM_SRC:.s=.o)
                          > >
                          > > HC11_OBJ_NOPATH = $(notdir $(HC11_OBJ))
                          > > HC11_OBJ2 = $(addprefix $(OBJ),$(HC11_OBJ_NOPATH))
                          > > ASSEM_OBJ_NOPATH = $(notdir $(ASSEM_OBJ))
                          > > ASSEM_OBJ2 = $(addprefix $(OBJPATH),$(ASSEM_OBJ_NOPATH))
                          > >
                          > > bringup.elf: $(HC11_OBJ) $(ASSEM_OBJ2)
                          > > $(CC) $(CFLAGS) $(HC11_SRC) $(ASSEM_SRC)
                          > > -nostartfiles $(LINKER_FLAGS)
                          > >
                          > > $(HC11_OBJ) : %.o : %.c
                          > > $(CC) -c $(CFLAGS) $< -o $(OBJPATH)$@
                          > >
                          > > $(ASSEM_OBJ) : %.o : %.s
                          > > $(CC) -c $(CFLAGS) $< -o $(OBJPATH)$@
                          > >
                          > >
                          > >
                          > >
                          > >
                          > > --- John Volpe <jtvolpe@c...> wrote:
                          > >
                          > >
                          > > ---------------------------------
                          > > Sorry missed another one. See below........
                          > >
                          > > On Wednesday 29 June 2005 13:25, dave_baker_100 wrote:
                          > > > Hi,
                          > > >
                          > > > I'm sure if anyone can help but I'm trying to build
                          > >
                          > > an image using the
                          > >
                          > > > following makefile snippet:
                          > > >
                          > > > .
                          > > > .
                          > > > OBJ = $(SRC:.c=.o)
                          > > > OBJ_NOPATH = $(notdir OBJ)
                          > >
                          > > ------------------------^^^
                          > > Must be $(OBJ)
                          > >
                          > > > OBJ2 = $(addprefix ./obj/,OBJ_NOPATH)
                          > > >
                          > > > bringup.elf: $(OBJ2) makefile
                          > > > $(CC) $(CFLAGS) (OBJ2) -nostartfiles
                          > >
                          > > $(LINKER_FLAGS)
                          > >
                          > > > $(OBJ) : %.o : %.c $(LDSCRIPT) makefile
                          > > > $(CC) -c $(CFLAGS) $< -o ./obj/$@
                          > > >
                          > > >
                          > > > Basically I'm trying to put my *.o files in a folder
                          > >
                          > > called ./obj
                          > >
                          > > > The *.o files get built but the linker can't find
                          > >
                          > > them.
                          > >
                          > > > Does anyone know what I'm doing wrong ?
                          > > >
                          > > > Thanks
                          > > > Dave
                          > >
                          > > John
                          > >
                          > >
                          > > To Post a message, send it to:
                          > > gnu-m68hc11@e...
                          > >
                          > > To Unsubscribe, send a blank message to:
                          > > gnu-m68hc11-unsubscribe@e...
                          > >
                          > >
                          > >
                          > > ---------------------------------
                          > > YAHOO! GROUPS LINKS
                          > >
                          > >
                          > > Visit your group "gnu-m68hc11" on the web.
                          > >
                          > > To unsubscribe from this group, send an email to:
                          > > gnu-m68hc11-unsubscribe@yahoogroups.com
                          > >
                          > > Your use of Yahoo! Groups is subject to the Yahoo!
                          > > Terms of Service.
                          > >
                          > >
                          > > ---------------------------------
                          > >
                          > >
                          > >
                          > >
                          > >
                          > >
                          > > ___________________________________________________________
                          > > How much free photo storage do you get? Store your holiday
                          > > snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com
                          > >
                          > >
                          > > To Post a message, send it to: gnu-m68hc11@e...
                          > >
                          > > To Unsubscribe, send a blank message to:
                          > > gnu-m68hc11-unsubscribe@e... Yahoo! Groups Links
                          > >
                          > >
                          > >
                        • Jefferson Smith
                          Well, the message means you are asking to build that file, but it is already built. Often I just do `make clean` and then see it work.
                          Message 12 of 18 , Jul 5, 2005
                          • 0 Attachment
                            Well, the message means you are asking to build that file, but it is
                            already built. Often I just do `make clean` and then see it work.


                            --- In gnu-m68hc11@yahoogroups.com, "dave_baker_100"
                            <dave_baker_100@y...> wrote:
                            > Hi John,
                            >
                            > It gets worse! I'm getting "make: Nothing to be done for `bringup.
                            > elf'." The makefile looks ok & ./obj/*.o don't exist. I'm pulling my
                            > hair out! Any ideas ?
                            >
                            > Thanks
                            > Dave
                            >
                            > --- In gnu-m68hc11@yahoogroups.com, John Volpe <jtvolpe@c...> wrote:
                            > > Hi Dave,
                            > >
                            > > There are two ways to approach this : 1) Start with the sources and
                            > generate
                            > > object dependencies based on them, or 2) start with the objects and
                            > generate
                            > > source dependencies from the objects.
                            > >
                            > > You have started with the sources, so I have included a "corrected"
                            > makefile
                            > > which starts with sources. I say corrected but this is still just my
                            > opinion
                            > > and do not want to start a flame war over this. You can probably
                            > get as many
                            > > methods for doing this as people subscribed to the list.
                            > >
                            > > I have not tried to run this but I believe that it will work. Give
                            > me a shout
                            > > if you need anything else.
                            > >
                            > > John
                            > >
                            > > CC=hc11-elf-gcc
                            > > LDSCRIPT=ram.ld
                            > > OBJPATH=./obj/
                            > >
                            > > CFLAGS = -mcpu=-m68hc11 -T$(LDSCRIPT) -Wall -O -g -I. -I"C:
                            > > \Cygnus\hc11-elf\include\sys" \
                            > >
                            > > LINKER_FLAGS = -Xlinker -obringup.elf -Xlinker -M -Xlinker -
                            > Map=bringup.map
                            > >
                            > > HC11_SRC = \
                            > > commands.c \
                            > > crc16.c \
                            > > main.c \
                            > > printf.c \
                            > > progflash.c \
                            > > serial.c \
                            > > syscalls.c \
                            > > xmodem.c \
                            > >
                            > > ASSEM_SRC = \
                            > > boot.s \
                            > > fft_test.s
                            > >
                            > > #
                            > > # These two lines give the correct object files with paths
                            > > #
                            > > HC11_OBJ = $(addprefix $(OBJPATH),$(HC11_SRC:.c=.o))
                            > > ASSEM_OBJ = $(addprefix $(OBJPATH),$(ASSEM_SRC:.s=.o))
                            > >
                            > > bringup.elf: $(HC11_OBJ) $(ASSEM_OBJ)
                            > > $(CC) $(CFLAGS) -nostartfiles $(LINKER_FLAGS) $(HC11_OBJ)
                            > $(ASSEM_OBJ)
                            > >
                            > > $(HC11_OBJ) : $(OBJPATH)%.o : %.c
                            > > $(CC) -c $(CFLAGS) -o $@ $<
                            > >
                            > > $(ASSEM_OBJ) : $(OBJPATH)%.o : %.s
                            > > $(CC) -c $(CFLAGS) -o $@ $<
                            > >
                            > >
                            > >
                            > > On Tuesday 05 July 2005 03:32, Dave Baker wrote:
                            > > > Hi John,
                            > > >
                            > > > Many thanks for your help with my makefile.
                            > > >
                            > > > I've added another dependancy for assembler files &
                            > > > want to put the *.o files in the same obj directory.
                            > > > All the C code compiles ok but I get:
                            > > >
                            > > > make: *** No rule to make target `obj/boot.o', needed
                            > > > by `bringup.elf'. Stop.
                            > > >
                            > > > So obviously the assembly code doesn't get built but I
                            > > > can't see what the problem is.
                            > > >
                            > > > Do you have any clues (makefile below)?
                            > > >
                            > > > Regards
                            > > > Dave
                            > > >
                            > > > ------------------------------------------------------
                            > > >
                            > > > CC=hc11-elf-gcc
                            > > > LDSCRIPT=ram.ld
                            > > > OBJPATH=./obj/
                            > > >
                            > > > CFLAGS = -mcpu=-m68hc11 -T$(LDSCRIPT) -Wall -O -g -I.
                            > > > -I"C:\Cygnus\hc11-elf\include\sys" \
                            > > >
                            > > > LINKER_FLAGS = -Xlinker -obringup.elf -Xlinker -M
                            > > > -Xlinker -Map=bringup.map
                            > > >
                            > > > HC11_SRC = \
                            > > > commands.c \
                            > > > crc16.c \
                            > > > main.c \
                            > > > printf.c \
                            > > > progflash.c \
                            > > > serial.c \
                            > > > syscalls.c \
                            > > > xmodem.c \
                            > > >
                            > > > ASSEM_SRC = \
                            > > > boot.s \
                            > > > fft_test.s
                            > > >
                            > > > HC11_OBJ = $(HC11_SRC:.c=.o)
                            > > > ASSEM_OBJ = $(ASSEM_SRC:.s=.o)
                            > > >
                            > > > HC11_OBJ_NOPATH = $(notdir $(HC11_OBJ))
                            > > > HC11_OBJ2 = $(addprefix $(OBJ),$(HC11_OBJ_NOPATH))
                            > > > ASSEM_OBJ_NOPATH = $(notdir $(ASSEM_OBJ))
                            > > > ASSEM_OBJ2 = $(addprefix $(OBJPATH),$(ASSEM_OBJ_NOPATH))
                            > > >
                            > > > bringup.elf: $(HC11_OBJ) $(ASSEM_OBJ2)
                            > > > $(CC) $(CFLAGS) $(HC11_SRC) $(ASSEM_SRC)
                            > > > -nostartfiles $(LINKER_FLAGS)
                            > > >
                            > > > $(HC11_OBJ) : %.o : %.c
                            > > > $(CC) -c $(CFLAGS) $< -o $(OBJPATH)$@
                            > > >
                            > > > $(ASSEM_OBJ) : %.o : %.s
                            > > > $(CC) -c $(CFLAGS) $< -o $(OBJPATH)$@
                            > > >
                            > > >
                            > > >
                            > > >
                            > > >
                            > > > --- John Volpe <jtvolpe@c...> wrote:
                            > > >
                            > > >
                            > > > ---------------------------------
                            > > > Sorry missed another one. See below........
                            > > >
                            > > > On Wednesday 29 June 2005 13:25, dave_baker_100 wrote:
                            > > > > Hi,
                            > > > >
                            > > > > I'm sure if anyone can help but I'm trying to build
                            > > >
                            > > > an image using the
                            > > >
                            > > > > following makefile snippet:
                            > > > >
                            > > > > .
                            > > > > .
                            > > > > OBJ = $(SRC:.c=.o)
                            > > > > OBJ_NOPATH = $(notdir OBJ)
                            > > >
                            > > > ------------------------^^^
                            > > > Must be $(OBJ)
                            > > >
                            > > > > OBJ2 = $(addprefix ./obj/,OBJ_NOPATH)
                            > > > >
                            > > > > bringup.elf: $(OBJ2) makefile
                            > > > > $(CC) $(CFLAGS) (OBJ2) -nostartfiles
                            > > >
                            > > > $(LINKER_FLAGS)
                            > > >
                            > > > > $(OBJ) : %.o : %.c $(LDSCRIPT) makefile
                            > > > > $(CC) -c $(CFLAGS) $< -o ./obj/$@
                            > > > >
                            > > > >
                            > > > > Basically I'm trying to put my *.o files in a folder
                            > > >
                            > > > called ./obj
                            > > >
                            > > > > The *.o files get built but the linker can't find
                            > > >
                            > > > them.
                            > > >
                            > > > > Does anyone know what I'm doing wrong ?
                            > > > >
                            > > > > Thanks
                            > > > > Dave
                            > > >
                            > > > John
                            > > >
                            > > >
                            > > > To Post a message, send it to:
                            > > > gnu-m68hc11@e...
                            > > >
                            > > > To Unsubscribe, send a blank message to:
                            > > > gnu-m68hc11-unsubscribe@e...
                            > > >
                            > > >
                            > > >
                            > > > ---------------------------------
                            > > > YAHOO! GROUPS LINKS
                            > > >
                            > > >
                            > > > Visit your group "gnu-m68hc11" on the web.
                            > > >
                            > > > To unsubscribe from this group, send an email to:
                            > > > gnu-m68hc11-unsubscribe@yahoogroups.com
                            > > >
                            > > > Your use of Yahoo! Groups is subject to the Yahoo!
                            > > > Terms of Service.
                            > > >
                            > > >
                            > > > ---------------------------------
                            > > >
                            > > >
                            > > >
                            > > >
                            > > >
                            > > >
                            > > > ___________________________________________________________
                            > > > How much free photo storage do you get? Store your holiday
                            > > > snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com
                            > > >
                            > > >
                            > > > To Post a message, send it to: gnu-m68hc11@e...
                            > > >
                            > > > To Unsubscribe, send a blank message to:
                            > > > gnu-m68hc11-unsubscribe@e... Yahoo! Groups Links
                            > > >
                            > > >
                            > > >
                          • dave_baker_100
                            Jefferson The .elf & .o files don t exist - the makefile must be incorrect... Dave ... my ... and ... and ... corrected ... just my ... probably ... Give
                            Message 13 of 18 , Jul 5, 2005
                            • 0 Attachment
                              Jefferson

                              The .elf & .o files don't exist - the makefile must be incorrect...

                              Dave

                              --- In gnu-m68hc11@yahoogroups.com, "Jefferson Smith" <imajeffs@h...>
                              wrote:
                              > Well, the message means you are asking to build that file, but it is
                              > already built. Often I just do `make clean` and then see it work.
                              >
                              >
                              > --- In gnu-m68hc11@yahoogroups.com, "dave_baker_100"
                              > <dave_baker_100@y...> wrote:
                              > > Hi John,
                              > >
                              > > It gets worse! I'm getting "make: Nothing to be done for `bringup.
                              > > elf'." The makefile looks ok & ./obj/*.o don't exist. I'm pulling
                              my
                              > > hair out! Any ideas ?
                              > >
                              > > Thanks
                              > > Dave
                              > >
                              > > --- In gnu-m68hc11@yahoogroups.com, John Volpe <jtvolpe@c...>
                              wrote:
                              > > > Hi Dave,
                              > > >
                              > > > There are two ways to approach this : 1) Start with the sources
                              and
                              > > generate
                              > > > object dependencies based on them, or 2) start with the objects
                              and
                              > > generate
                              > > > source dependencies from the objects.
                              > > >
                              > > > You have started with the sources, so I have included a
                              "corrected"
                              > > makefile
                              > > > which starts with sources. I say corrected but this is still
                              just my
                              > > opinion
                              > > > and do not want to start a flame war over this. You can
                              probably
                              > > get as many
                              > > > methods for doing this as people subscribed to the list.
                              > > >
                              > > > I have not tried to run this but I believe that it will work.
                              Give
                              > > me a shout
                              > > > if you need anything else.
                              > > >
                              > > > John
                              > > >
                              > > > CC=hc11-elf-gcc
                              > > > LDSCRIPT=ram.ld
                              > > > OBJPATH=./obj/
                              > > >
                              > > > CFLAGS = -mcpu=-m68hc11 -T$(LDSCRIPT) -Wall -O -g -I. -I"C:
                              > > > \Cygnus\hc11-elf\include\sys" \
                              > > >
                              > > > LINKER_FLAGS = -Xlinker -obringup.elf -Xlinker -M -Xlinker -
                              > > Map=bringup.map
                              > > >
                              > > > HC11_SRC = \
                              > > > commands.c \
                              > > > crc16.c \
                              > > > main.c \
                              > > > printf.c \
                              > > > progflash.c \
                              > > > serial.c \
                              > > > syscalls.c \
                              > > > xmodem.c \
                              > > >
                              > > > ASSEM_SRC = \
                              > > > boot.s \
                              > > > fft_test.s
                              > > >
                              > > > #
                              > > > # These two lines give the correct object files with paths
                              > > > #
                              > > > HC11_OBJ = $(addprefix $(OBJPATH),$(HC11_SRC:.c=.o))
                              > > > ASSEM_OBJ = $(addprefix $(OBJPATH),$(ASSEM_SRC:.s=.o))
                              > > >
                              > > > bringup.elf: $(HC11_OBJ) $(ASSEM_OBJ)
                              > > > $(CC) $(CFLAGS) -nostartfiles $(LINKER_FLAGS) $(HC11_OBJ)
                              > > $(ASSEM_OBJ)
                              > > >
                              > > > $(HC11_OBJ) : $(OBJPATH)%.o : %.c
                              > > > $(CC) -c $(CFLAGS) -o $@ $<
                              > > >
                              > > > $(ASSEM_OBJ) : $(OBJPATH)%.o : %.s
                              > > > $(CC) -c $(CFLAGS) -o $@ $<
                              > > >
                              > > >
                              > > >
                              > > > On Tuesday 05 July 2005 03:32, Dave Baker wrote:
                              > > > > Hi John,
                              > > > >
                              > > > > Many thanks for your help with my makefile.
                              > > > >
                              > > > > I've added another dependancy for assembler files &
                              > > > > want to put the *.o files in the same obj directory.
                              > > > > All the C code compiles ok but I get:
                              > > > >
                              > > > > make: *** No rule to make target `obj/boot.o', needed
                              > > > > by `bringup.elf'. Stop.
                              > > > >
                              > > > > So obviously the assembly code doesn't get built but I
                              > > > > can't see what the problem is.
                              > > > >
                              > > > > Do you have any clues (makefile below)?
                              > > > >
                              > > > > Regards
                              > > > > Dave
                              > > > >
                              > > > > ------------------------------------------------------
                              > > > >
                              > > > > CC=hc11-elf-gcc
                              > > > > LDSCRIPT=ram.ld
                              > > > > OBJPATH=./obj/
                              > > > >
                              > > > > CFLAGS = -mcpu=-m68hc11 -T$(LDSCRIPT) -Wall -O -g -I.
                              > > > > -I"C:\Cygnus\hc11-elf\include\sys" \
                              > > > >
                              > > > > LINKER_FLAGS = -Xlinker -obringup.elf -Xlinker -M
                              > > > > -Xlinker -Map=bringup.map
                              > > > >
                              > > > > HC11_SRC = \
                              > > > > commands.c \
                              > > > > crc16.c \
                              > > > > main.c \
                              > > > > printf.c \
                              > > > > progflash.c \
                              > > > > serial.c \
                              > > > > syscalls.c \
                              > > > > xmodem.c \
                              > > > >
                              > > > > ASSEM_SRC = \
                              > > > > boot.s \
                              > > > > fft_test.s
                              > > > >
                              > > > > HC11_OBJ = $(HC11_SRC:.c=.o)
                              > > > > ASSEM_OBJ = $(ASSEM_SRC:.s=.o)
                              > > > >
                              > > > > HC11_OBJ_NOPATH = $(notdir $(HC11_OBJ))
                              > > > > HC11_OBJ2 = $(addprefix $(OBJ),$(HC11_OBJ_NOPATH))
                              > > > > ASSEM_OBJ_NOPATH = $(notdir $(ASSEM_OBJ))
                              > > > > ASSEM_OBJ2 = $(addprefix $(OBJPATH),$(ASSEM_OBJ_NOPATH))
                              > > > >
                              > > > > bringup.elf: $(HC11_OBJ) $(ASSEM_OBJ2)
                              > > > > $(CC) $(CFLAGS) $(HC11_SRC) $(ASSEM_SRC)
                              > > > > -nostartfiles $(LINKER_FLAGS)
                              > > > >
                              > > > > $(HC11_OBJ) : %.o : %.c
                              > > > > $(CC) -c $(CFLAGS) $< -o $(OBJPATH)$@
                              > > > >
                              > > > > $(ASSEM_OBJ) : %.o : %.s
                              > > > > $(CC) -c $(CFLAGS) $< -o $(OBJPATH)$@
                              > > > >
                              > > > >
                              > > > >
                              > > > >
                              > > > >
                              > > > > --- John Volpe <jtvolpe@c...> wrote:
                              > > > >
                              > > > >
                              > > > > ---------------------------------
                              > > > > Sorry missed another one. See below........
                              > > > >
                              > > > > On Wednesday 29 June 2005 13:25, dave_baker_100 wrote:
                              > > > > > Hi,
                              > > > > >
                              > > > > > I'm sure if anyone can help but I'm trying to build
                              > > > >
                              > > > > an image using the
                              > > > >
                              > > > > > following makefile snippet:
                              > > > > >
                              > > > > > .
                              > > > > > .
                              > > > > > OBJ = $(SRC:.c=.o)
                              > > > > > OBJ_NOPATH = $(notdir OBJ)
                              > > > >
                              > > > > ------------------------^^^
                              > > > > Must be $(OBJ)
                              > > > >
                              > > > > > OBJ2 = $(addprefix ./obj/,OBJ_NOPATH)
                              > > > > >
                              > > > > > bringup.elf: $(OBJ2) makefile
                              > > > > > $(CC) $(CFLAGS) (OBJ2) -nostartfiles
                              > > > >
                              > > > > $(LINKER_FLAGS)
                              > > > >
                              > > > > > $(OBJ) : %.o : %.c $(LDSCRIPT) makefile
                              > > > > > $(CC) -c $(CFLAGS) $< -o ./obj/$@
                              > > > > >
                              > > > > >
                              > > > > > Basically I'm trying to put my *.o files in a folder
                              > > > >
                              > > > > called ./obj
                              > > > >
                              > > > > > The *.o files get built but the linker can't find
                              > > > >
                              > > > > them.
                              > > > >
                              > > > > > Does anyone know what I'm doing wrong ?
                              > > > > >
                              > > > > > Thanks
                              > > > > > Dave
                              > > > >
                              > > > > John
                              > > > >
                              > > > >
                              > > > > To Post a message, send it to:
                              > > > > gnu-m68hc11@e...
                              > > > >
                              > > > > To Unsubscribe, send a blank message to:
                              > > > > gnu-m68hc11-unsubscribe@e...
                              > > > >
                              > > > >
                              > > > >
                              > > > > ---------------------------------
                              > > > > YAHOO! GROUPS LINKS
                              > > > >
                              > > > >
                              > > > > Visit your group "gnu-m68hc11" on the web.
                              > > > >
                              > > > > To unsubscribe from this group, send an email to:
                              > > > > gnu-m68hc11-unsubscribe@yahoogroups.com
                              > > > >
                              > > > > Your use of Yahoo! Groups is subject to the Yahoo!
                              > > > > Terms of Service.
                              > > > >
                              > > > >
                              > > > > ---------------------------------
                              > > > >
                              > > > >
                              > > > >
                              > > > >
                              > > > >
                              > > > >
                              > > > > ___________________________________________________________
                              > > > > How much free photo storage do you get? Store your holiday
                              > > > > snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com
                              > > > >
                              > > > >
                              > > > > To Post a message, send it to: gnu-m68hc11@e...
                              > > > >
                              > > > > To Unsubscribe, send a blank message to:
                              > > > > gnu-m68hc11-unsubscribe@e... Yahoo! Groups Links
                              > > > >
                              > > > >
                              > > > >
                            • Jefferson Smith
                              To me it seems strange the lines that I think are rules to make the obj files (in another dir). I ve only done it before where I place the elf files in another
                              Message 14 of 18 , Jul 5, 2005
                              • 0 Attachment
                                To me it seems strange the lines that I think are rules to make the
                                obj files (in another dir). I've only done it before where I place the
                                elf files in another dir. I wonder if you could simplify the obj
                                target rules by making one obj file at a time per rule, just to prove
                                you can generate them in the other dir.

                                --- In gnu-m68hc11@yahoogroups.com, "dave_baker_100"
                                <dave_baker_100@y...> wrote:
                                > Jefferson
                                >
                                > The .elf & .o files don't exist - the makefile must be incorrect...
                                >
                                > Dave
                                >
                                ...
                                > > > > CC=hc11-elf-gcc
                                > > > > LDSCRIPT=ram.ld
                                > > > > OBJPATH=./obj/
                                > > > >
                                > > > > CFLAGS = -mcpu=-m68hc11 -T$(LDSCRIPT) -Wall -O -g -I. -I"C:
                                > > > > \Cygnus\hc11-elf\include\sys" \
                                > > > >
                                > > > > LINKER_FLAGS = -Xlinker -obringup.elf -Xlinker -M -Xlinker -
                                > > > Map=bringup.map
                                > > > >
                                > > > > HC11_SRC = \
                                > > > > commands.c \
                                > > > > crc16.c \
                                > > > > main.c \
                                > > > > printf.c \
                                > > > > progflash.c \
                                > > > > serial.c \
                                > > > > syscalls.c \
                                > > > > xmodem.c \
                                > > > >
                                > > > > ASSEM_SRC = \
                                > > > > boot.s \
                                > > > > fft_test.s
                                > > > >
                                > > > > #
                                > > > > # These two lines give the correct object files with paths
                                > > > > #
                                > > > > HC11_OBJ = $(addprefix $(OBJPATH),$(HC11_SRC:.c=.o))
                                > > > > ASSEM_OBJ = $(addprefix $(OBJPATH),$(ASSEM_SRC:.s=.o))
                                > > > >
                                > > > > bringup.elf: $(HC11_OBJ) $(ASSEM_OBJ)
                                > > > > $(CC) $(CFLAGS) -nostartfiles $(LINKER_FLAGS) $(HC11_OBJ)
                                > > > $(ASSEM_OBJ)
                                > > > >
                                > > > > $(HC11_OBJ) : $(OBJPATH)%.o : %.c
                                > > > > $(CC) -c $(CFLAGS) -o $@ $<
                                > > > >
                                > > > > $(ASSEM_OBJ) : $(OBJPATH)%.o : %.s
                                > > > > $(CC) -c $(CFLAGS) -o $@ $<
                                > > > >
                                > > > >
                              • John Volpe
                                Hi Dave, I just tested the Makefile and it ran under Linux. I have included an improved Makefile to be used as a test case. Create a test directory and put
                                Message 15 of 18 , Jul 5, 2005
                                • 0 Attachment
                                  Hi Dave,

                                  I just tested the Makefile and it ran under Linux. I have included an
                                  "improved" Makefile to be used as a test case. Create a test directory and
                                  put the snippet as Makefile in that directory. Create two blank files, one
                                  named test1.c and another named test2.s. Run make and tell me what happens.
                                  You can test a full make by running make clean then make.

                                  John

                                  ------ START Makefile -----------

                                  CC=hc11-elf-gcc
                                  LDSCRIPT=ram.ld
                                  OBJPATH=./obj/

                                  CFLAGS = -mcpu=-m68hc11 -T$(LDSCRIPT) -Wall -O -g -I. -I"C:
                                  \Cygnus\hc11-elf\include\sys" \

                                  LINKER_FLAGS = -Xlinker -obringup.elf -Xlinker -M -Xlinker -Map=bringup.map

                                  HC11_SRC = \
                                  test1.c

                                  ASSEM_SRC = \
                                  test2.s

                                  #
                                  # These two lines give the correct object files with paths
                                  #
                                  HC11_OBJ = $(addprefix $(OBJPATH),$(HC11_SRC:.c=.o))
                                  ASSEM_OBJ = $(addprefix $(OBJPATH),$(ASSEM_SRC:.s=.o))

                                  bringup.elf: $(OBJPATH) $(HC11_OBJ) $(ASSEM_OBJ)
                                  # $(CC) $(CFLAGS) -nostartfiles $(LINKER_FLAGS) $(HC11_OBJ) $(ASSEM_OBJ)
                                  @echo "Linking $@ from $(HC11_OBJ) $(ASSEM_OBJ)"
                                  @touch $@

                                  $(OBJPATH) :
                                  -mkdir -p $(OBJPATH)

                                  $(HC11_OBJ) : $(OBJPATH)%.o : %.c
                                  # $(CC) -c $(CFLAGS) -o $@ $<
                                  @echo "Compiling $@ from $<"
                                  @touch $@

                                  $(ASSEM_OBJ) : $(OBJPATH)%.o : %.s
                                  # $(CC) -c $(CFLAGS) -o $@ $<
                                  @echo "Compiling $@ from $<"
                                  @touch $@

                                  clean:
                                  rm -rf $(OBJPATH)

                                  ------ END Makefile -----------


                                  On Tuesday 05 July 2005 14:47, dave_baker_100 wrote:
                                  > Hi John,
                                  >
                                  > It gets worse! I'm getting "make: Nothing to be done for `bringup.
                                  > elf'." The makefile looks ok & ./obj/*.o don't exist. I'm pulling my
                                  > hair out! Any ideas ?
                                  >
                                  > Thanks
                                  > Dave
                                  >
                                  > --- In gnu-m68hc11@yahoogroups.com, John Volpe <jtvolpe@c...> wrote:
                                  > > Hi Dave,
                                  > >
                                  > > There are two ways to approach this : 1) Start with the sources and
                                  >
                                  > generate
                                  >
                                  > > object dependencies based on them, or 2) start with the objects and
                                  >
                                  > generate
                                  >
                                  > > source dependencies from the objects.
                                  > >
                                  > > You have started with the sources, so I have included a "corrected"
                                  >
                                  > makefile
                                  >
                                  > > which starts with sources. I say corrected but this is still just my
                                  >
                                  > opinion
                                  >
                                  > > and do not want to start a flame war over this. You can probably
                                  >
                                  > get as many
                                  >
                                  > > methods for doing this as people subscribed to the list.
                                  > >
                                  > > I have not tried to run this but I believe that it will work. Give
                                  >
                                  > me a shout
                                  >
                                  > > if you need anything else.
                                  > >
                                  > > John
                                  > >
                                  > > CC=hc11-elf-gcc
                                  > > LDSCRIPT=ram.ld
                                  > > OBJPATH=./obj/
                                  > >
                                  > > CFLAGS = -mcpu=-m68hc11 -T$(LDSCRIPT) -Wall -O -g -I. -I"C:
                                  > > \Cygnus\hc11-elf\include\sys" \
                                  > >
                                  > > LINKER_FLAGS = -Xlinker -obringup.elf -Xlinker -M -Xlinker -
                                  >
                                  > Map=bringup.map
                                  >
                                  > > HC11_SRC = \
                                  > > commands.c \
                                  > > crc16.c \
                                  > > main.c \
                                  > > printf.c \
                                  > > progflash.c \
                                  > > serial.c \
                                  > > syscalls.c \
                                  > > xmodem.c \
                                  > >
                                  > > ASSEM_SRC = \
                                  > > boot.s \
                                  > > fft_test.s
                                  > >
                                  > > #
                                  > > # These two lines give the correct object files with paths
                                  > > #
                                  > > HC11_OBJ = $(addprefix $(OBJPATH),$(HC11_SRC:.c=.o))
                                  > > ASSEM_OBJ = $(addprefix $(OBJPATH),$(ASSEM_SRC:.s=.o))
                                  > >
                                  > > bringup.elf: $(HC11_OBJ) $(ASSEM_OBJ)
                                  > > $(CC) $(CFLAGS) -nostartfiles $(LINKER_FLAGS) $(HC11_OBJ)
                                  >
                                  > $(ASSEM_OBJ)
                                  >
                                  > > $(HC11_OBJ) : $(OBJPATH)%.o : %.c
                                  > > $(CC) -c $(CFLAGS) -o $@ $<
                                  > >
                                  > > $(ASSEM_OBJ) : $(OBJPATH)%.o : %.s
                                  > > $(CC) -c $(CFLAGS) -o $@ $<
                                  > >
                                  > > On Tuesday 05 July 2005 03:32, Dave Baker wrote:
                                  > > > Hi John,
                                  > > >
                                  > > > Many thanks for your help with my makefile.
                                  > > >
                                  > > > I've added another dependancy for assembler files &
                                  > > > want to put the *.o files in the same obj directory.
                                  > > > All the C code compiles ok but I get:
                                  > > >
                                  > > > make: *** No rule to make target `obj/boot.o', needed
                                  > > > by `bringup.elf'. Stop.
                                  > > >
                                  > > > So obviously the assembly code doesn't get built but I
                                  > > > can't see what the problem is.
                                  > > >
                                  > > > Do you have any clues (makefile below)?
                                  > > >
                                  > > > Regards
                                  > > > Dave
                                  > > >
                                  > > > ------------------------------------------------------
                                  > > >
                                  > > > CC=hc11-elf-gcc
                                  > > > LDSCRIPT=ram.ld
                                  > > > OBJPATH=./obj/
                                  > > >
                                  > > > CFLAGS = -mcpu=-m68hc11 -T$(LDSCRIPT) -Wall -O -g -I.
                                  > > > -I"C:\Cygnus\hc11-elf\include\sys" \
                                  > > >
                                  > > > LINKER_FLAGS = -Xlinker -obringup.elf -Xlinker -M
                                  > > > -Xlinker -Map=bringup.map
                                  > > >
                                  > > > HC11_SRC = \
                                  > > > commands.c \
                                  > > > crc16.c \
                                  > > > main.c \
                                  > > > printf.c \
                                  > > > progflash.c \
                                  > > > serial.c \
                                  > > > syscalls.c \
                                  > > > xmodem.c \
                                  > > >
                                  > > > ASSEM_SRC = \
                                  > > > boot.s \
                                  > > > fft_test.s
                                  > > >
                                  > > > HC11_OBJ = $(HC11_SRC:.c=.o)
                                  > > > ASSEM_OBJ = $(ASSEM_SRC:.s=.o)
                                  > > >
                                  > > > HC11_OBJ_NOPATH = $(notdir $(HC11_OBJ))
                                  > > > HC11_OBJ2 = $(addprefix $(OBJ),$(HC11_OBJ_NOPATH))
                                  > > > ASSEM_OBJ_NOPATH = $(notdir $(ASSEM_OBJ))
                                  > > > ASSEM_OBJ2 = $(addprefix $(OBJPATH),$(ASSEM_OBJ_NOPATH))
                                  > > >
                                  > > > bringup.elf: $(HC11_OBJ) $(ASSEM_OBJ2)
                                  > > > $(CC) $(CFLAGS) $(HC11_SRC) $(ASSEM_SRC)
                                  > > > -nostartfiles $(LINKER_FLAGS)
                                  > > >
                                  > > > $(HC11_OBJ) : %.o : %.c
                                  > > > $(CC) -c $(CFLAGS) $< -o $(OBJPATH)$@
                                  > > >
                                  > > > $(ASSEM_OBJ) : %.o : %.s
                                  > > > $(CC) -c $(CFLAGS) $< -o $(OBJPATH)$@
                                  > > >
                                  > > >
                                  > > >
                                  > > >
                                  > > >
                                  > > > --- John Volpe <jtvolpe@c...> wrote:
                                  > > >
                                  > > >
                                  > > > ---------------------------------
                                  > > > Sorry missed another one. See below........
                                  > > >
                                  > > > On Wednesday 29 June 2005 13:25, dave_baker_100 wrote:
                                  > > > > Hi,
                                  > > > >
                                  > > > > I'm sure if anyone can help but I'm trying to build
                                  > > >
                                  > > > an image using the
                                  > > >
                                  > > > > following makefile snippet:
                                  > > > >
                                  > > > > .
                                  > > > > .
                                  > > > > OBJ = $(SRC:.c=.o)
                                  > > > > OBJ_NOPATH = $(notdir OBJ)
                                  > > >
                                  > > > ------------------------^^^
                                  > > > Must be $(OBJ)
                                  > > >
                                  > > > > OBJ2 = $(addprefix ./obj/,OBJ_NOPATH)
                                  > > > >
                                  > > > > bringup.elf: $(OBJ2) makefile
                                  > > > > $(CC) $(CFLAGS) (OBJ2) -nostartfiles
                                  > > >
                                  > > > $(LINKER_FLAGS)
                                  > > >
                                  > > > > $(OBJ) : %.o : %.c $(LDSCRIPT) makefile
                                  > > > > $(CC) -c $(CFLAGS) $< -o ./obj/$@
                                  > > > >
                                  > > > >
                                  > > > > Basically I'm trying to put my *.o files in a folder
                                  > > >
                                  > > > called ./obj
                                  > > >
                                  > > > > The *.o files get built but the linker can't find
                                  > > >
                                  > > > them.
                                  > > >
                                  > > > > Does anyone know what I'm doing wrong ?
                                  > > > >
                                  > > > > Thanks
                                  > > > > Dave
                                  > > >
                                  > > > John
                                  > > >
                                  > > >
                                  > > > To Post a message, send it to:
                                  > > > gnu-m68hc11@e...
                                  > > >
                                  > > > To Unsubscribe, send a blank message to:
                                  > > > gnu-m68hc11-unsubscribe@e...
                                  > > >
                                  > > >
                                  > > >
                                  > > > ---------------------------------
                                  > > > YAHOO! GROUPS LINKS
                                  > > >
                                  > > >
                                  > > > Visit your group "gnu-m68hc11" on the web.
                                  > > >
                                  > > > To unsubscribe from this group, send an email to:
                                  > > > gnu-m68hc11-unsubscribe@yahoogroups.com
                                  > > >
                                  > > > Your use of Yahoo! Groups is subject to the Yahoo!
                                  > > > Terms of Service.
                                  > > >
                                  > > >
                                  > > > ---------------------------------
                                  > > >
                                  > > >
                                  > > >
                                  > > >
                                  > > >
                                  > > >
                                  > > > ___________________________________________________________
                                  > > > How much free photo storage do you get? Store your holiday
                                  > > > snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com
                                  > > >
                                  > > >
                                  > > > To Post a message, send it to: gnu-m68hc11@e...
                                  > > >
                                  > > > To Unsubscribe, send a blank message to:
                                  > > > gnu-m68hc11-unsubscribe@e... Yahoo! Groups Links
                                  >
                                  > To Post a message, send it to: gnu-m68hc11@...
                                  >
                                  > To Unsubscribe, send a blank message to:
                                  > gnu-m68hc11-unsubscribe@... Yahoo! Groups Links
                                  >
                                  >
                                  >
                                Your message has been successfully submitted and would be delivered to recipients shortly.