Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: MakeFile Issue

  1. #1
    Join Date
    Jul 2008
    Beans
    21

    MakeFile Issue

    Hi all,

    I was wondering if anyone could help me with a makefile problem I'm having; I don't write many. My make file looks something like
    CC=g++
    C= -c
    i2ctry2: i2ctry2.cpp i2capi.c i2c.c i2cioapi.c Crc8.c DumpMem.c Log.c i2cioapi.h i2c.h i2cdev.h i2cio.h i2capi.h Log.h Crc8.h DumpMem.h Config.h
    ${CC} $(C) $(CFLAGS) $(LDFLAGS) -o Log.o Log.c
    $(CC) $(C) $(CFLAGS) $(LDFLAGS) -o Crc8.o Crc8.c
    $(CC) $(C) $(CFLAGS) $(LDFLAGS) -o DumpMem DumpMem.c
    $(CC) $(C) $(CFLAGS) $(LDFLAGS) -o i2cioapi.o i2cioapi.c
    $(CC) $(C) $(CFLAGS) $(LDFLAGS) -o i2c.o i2c.c
    $(CC) $(C) $(CFLAGS) $(LDFLAGS) -o i2capi.o i2capi.c
    $(CC) $(C) $(CFLAGS) $(LDFLAGS) -o i2ctry2.o i2ctry2.cpp

    Where I want to compile but not link my pieces of code. I'm going to link them in a .bb file to avoid another error I'm having with bitbake. Bu when I do make i2ctry2 I get make: *** No rule to make target `i2ctry2'. Stop.
    Any suggestions?

  2. #2
    Join Date
    Jul 2008
    Beans
    13

    Re: MakeFile Issue

    hmm, it looks ok, presuming you have tabs in the right places

    I tested it with dummy files

    $ make i2ctry2
    g++ -c -o Log.o Log.c
    g++ -c -o Crc8.o Crc8.c
    g++ -c -o DumpMem DumpMem.c
    g++ -c -o i2cioapi.o i2cioapi.c
    g++ -c -o i2c.o i2c.c
    g++ -c -o i2capi.o i2capi.c
    g++ -c -o i2ctry2.o i2ctry2.cpp
    I guess its due to the paste, but each line under i2ctry2: should be tabbed in.

  3. #3
    Join Date
    May 2008
    Location
    Los Gatos, CA, USA
    Beans
    175
    Distro
    Ubuntu

    Re: MakeFile Issue

    It's hard to tell from your example, but make sure there are tabs in front of all the lines after "i2ctry2: ..." -- tabs, not spaces.
    Professional and hobbyist programmer. Current project: Odysi and SydMVC.

  4. #4
    Join Date
    Jul 2008
    Beans
    21

    Re: MakeFile Issue

    Yeah, I've got the tabs. Copy paste thing but they are there.

  5. #5
    Join Date
    May 2008
    Location
    Los Gatos, CA, USA
    Beans
    175
    Distro
    Ubuntu

    Re: MakeFile Issue

    I notice the first $(CC) is ${CC} -- could that be it?
    Professional and hobbyist programmer. Current project: Odysi and SydMVC.

  6. #6
    Join Date
    Jul 2008
    Beans
    21

    Re: MakeFile Issue

    just changed it to see and no. still gives me the same error. I also noticed I left out the .o on one object in what I posted and fixing that doesn't help either.

  7. #7
    Join Date
    May 2008
    Location
    Los Gatos, CA, USA
    Beans
    175
    Distro
    Ubuntu

    Re: MakeFile Issue

    I took the dive and learned how to contort the autotools to generate my makefiles, so I've been spoiled by them... but I don't see anything wrong with the snippet you posted. Can you post your entire makefile?
    Professional and hobbyist programmer. Current project: Odysi and SydMVC.

  8. #8
    Join Date
    Jul 2008
    Beans
    21

    Re: MakeFile Issue

    ah, that's the entire thing. Am I missing something big? Unless I add them together with

    ${CC} ${CFLAGS} i2capi.o Log.o Crc8.o DumpMem.o i2cioapi.o i2c.o i2ctry2.o

    that's it.

  9. #9
    Join Date
    May 2008
    Location
    Los Gatos, CA, USA
    Beans
    175
    Distro
    Ubuntu

    Re: MakeFile Issue

    I don't know if it matters, but try replacing all the () with {} to see if that fixes it... your CFLAGS and LDFLAGS seems to be undefined?
    Professional and hobbyist programmer. Current project: Odysi and SydMVC.

  10. #10
    Join Date
    Jul 2008
    Beans
    21

    Re: MakeFile Issue

    changed the brackets, same error. didn't realize those 2 were undefined... if I take them out I get the same error. If I make them anything else, I also get the same error. sigh.

    I have to leave for a while but thanks for the help Sidius.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •