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
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.
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.
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
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
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.
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.
Logged In: YES
user_id=30442
Ah... Ignore me then :)