#96 make doesn't work

OTHER
closed
make (28)
out-of-date
Known_bugs
2013-01-25
2001-12-11
Anonymous
No

The Makefile in the attachment works well with
Cygwin's make while MinGW shows the following error-
message:

MinGW_make: *** No rule to make target `make_test.a
(make_test.o)', needed by `make_test.a'. Stop.

both make.exe are GNU Make Version 3.79.1

MinGW_make_test.zip contains the following files:

Makefile : Makefile that produces the error
make_test.c : Simple Source processed by Makefile
Cygwin_make.exe : Copy of Cygwin's make.exe
MinGW_make.exe : Copy of MinGW's make.exe
README.txt : This description

Copy of the Makefile:

# EXECUTABLE NAME(S) GIVEN BELOW
EXEFILE = make_test

# TARGETLIBRARY NAME GIVEN BELOW
TARGETLIB= make_test.a

# OBJECTS GIVEN BELOW
OBJMAIN = make_test.o
OBJS= $(TARGETLIB)($(OBJMAIN))

#------------------------------------------

$(EXEFILE): $(TARGETLIB)
$(AR) -x $(TARGETLIB) $(OBJMAIN)
$(CC) -o $@ $(OBJMAIN) $(TARGETLIB)
$(RM) $(OBJMAIN)

$(TARGETLIB): $(OBJS)
@echo library $(TARGETLIB) is now up-to-date

Discussion

  • Danny Smith

    Danny Smith - 2001-12-11

    Logged In: YES
    user_id=11494

    with your example, I get
    make: Circular make_test.a <- make_test.a dependency
    dropped.
    make: *** No rule to make target `(make_test.o', needed by
    `make_test.a'. Stop.

    with both cygwin amd mingw builds of make.

    If i change
    OBJS= $(TARGETLIB)($(OBJMAIN))
    to
    OBJS= $(TARGETLIB)$(OBJMAIN)

    I get succesful make on both, with the warning about
    circular dependency.

     
  • Nobody/Anonymous

    Logged In: NO

    I reduced the problem to a makefile containing the single
    line:

    make_test.a: make_test.a(make_test.o)

    This produces the "no rule to make target" error-message
    show in my initial report.

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

    The "circular dependency" warning in your comment comes
    from an extra blank at the END of the line:
    TARGETLIB= make_test.a

    In the Makefile this translates to:
    make_test.a: make_test.a (make_test.o)

    or with your proposal to:
    make_test.a: make_test.a make_test.o

    The later works identical on both mingw and cygwin but
    donesn't produce the library. Only make_test.o is build.

     
  • Nobody/Anonymous

    Logged In: NO

    > The "circular dependency" warning in your comment comes
    > from an extra blank at the END of the line:
    > TARGETLIB= make_test.a

    Good catch!

    Okay, I'll look at the problem when I have some time.
    Thanks for simplifying it to a nice simple testcase.

    Danny

     
  • Danny Smith

    Danny Smith - 2001-12-12

    Logged In: YES
    user_id=11494

    I have an updated make-3.79 which incorporates some of the
    recent Cygwin patches. It fixes this specific bug. It
    also has better detection of OS, so can make allowances for
    command.com vs cmd.exe if /bin/sh.exe not found. Would you
    care to help test before I make a beta release. If so,
    please send me your email address (privately) and I will
    post binary.

    Danny Smith

     
  • Luke Dunstan

    Luke Dunstan - 2002-05-22

    Logged In: YES
    user_id=30442

    Why is this a bug? Is make_test.a(make_test.o) supposed to
    have some special meaning? I get the same error with Mingw,
    MSYS and Cygwin make:

    make: *** No rule to make target `make_test.a(make_test.o)',
    needed by `make_test.a'. Stop.

     
  • Nobody/Anonymous

    Logged In: NO

    Answer to infidel:
    You should have a sourcefile named 'make_test.c' in your
    folder to get the behavior I described.
    make_test.a(make_test.o) doesn't have a special meaning
    besides of that documented in the make.html#Archives
    section.

     
  • Luke Dunstan

    Luke Dunstan - 2002-05-24

    Logged In: YES
    user_id=30442

    Ah... Ignore me then :)

     
  • Earnie Boyd

    Earnie Boyd - 2002-08-05
    • assigned_to: nobody --> earnie
    • status: open --> closed-out-of-date
     
  • Earnie Boyd

    Earnie Boyd - 2013-01-25
    • labels: binutils --> make
    • status: closed-out-of-date --> closed
    • resolution: --> out-of-date
    • category: --> Known_bugs
    • milestone: --> OTHER
     

Log in to post a comment.