Discussion:
C makefile
(too old to reply)
Zhaolin Xie
2003-11-07 18:52:17 UTC
Permalink
Hi,
I copied a makefile from a software supply and modified it to biuld my own library file. Some lines of the makefile are:
DEBUGS= -v
CFLAGS= $(DEBUGS) -DMSDOS -DETH_MSS=576 -Id:\borlandc\include \
-Ld:\borlandc\lib
MODELL= -ml
.c.obj:
d:\borlandc\bin\bcc -c $(MODELL)$(CFLAGS) $*.c
d:\borlandc\bin\tlib d:\myplace\mylib -+$*
The compiler (both Borland C++ 3.0 and 4.5) always say:
Error makefile 7: No match found for wildcard '-+$*'
Error makefile 7: Command syntax error
I changed -c to -P-c, the result was the same.
I asked the software supply and they said they didn't have such a problem.
Could you please tell me how to solve this problem and what the correct format of a makefile is to build a library file?
Thank you.
Ed Mulroy [TeamB]
2003-11-07 20:39:13 UTC
Permalink
The problem with the -+$* is inconsistent with what I have found. Look
again at the syntax in the make file. Something else is wrong. Perhaps you
have an invalid character in there which doesn't display in your editor when
you look at it. If that is so, then retyping the line and deleting the
original line would fix it.

I do not have BC++ 3.0 from around 1991 or BC++ 4.5 on my machine but here
are builds using make.exe from Turbo C 2.01 in 1989 and from the current
version of make, that which came with C++ Builder 6. They bracket the date
when the make.exe you are using was created and it is unlikely that yours
would fail to honor what they accept.

There is a bug in your tlib line. The option /C should be given to tlib so
that it creates a case-sensitive library, important because C is a case
sensitive language.

Below is a screen capture of what I did. Not shown but also tried was
with -+$* just as you used although only -+$*.obj is used below.

----------------
C:\Projects\mylib\CopyFold\1
type mylib.mak
mylib.lib : endwslsh.obj shlerr.obj
@echo Done

.cpp.obj :
bcc32 -WCR -c $<
tlib /C mylib.lib -+$*.obj

C:\Projects\mylib\CopyFold\1
make -fmylib
MAKE Version 2.0 Copyright (c) 1987, 1988 Borland International

Available memory 552509 bytes

bcc32 -WCR -c endwslsh.cpp
Borland C++ 5.6.4 for Win32 Copyright (c) 1993, 2002 Borland
endwslsh.cpp:
tlib /C mylib.lib -+endwslsh.obj
TLIB 4.5 Copyright (c) 1987, 1999 Inprise Corporation
Warning: 'endwslsh' not found in library
bcc32 -WCR -c shlerr.cpp
Borland C++ 5.6.4 for Win32 Copyright (c) 1993, 2002 Borland
shlerr.cpp:
tlib /C mylib.lib -+shlerr.obj
TLIB 4.5 Copyright (c) 1987, 1999 Inprise Corporation
Warning: 'shlerr' not found in library

C:\Projects\mylib\CopyFold\1
del *.obj
C:\Projects\mylib\CopyFold\1
del *.lib
C:\Projects\mylib\CopyFold\1
"\program files\borland\cbuilder6\bin\make" -fmylib
MAKE Version 5.2 Copyright (c) 1987, 2000 Borland
bcc32 -WCR -c endwslsh.cpp
Borland C++ 5.6.4 for Win32 Copyright (c) 1993, 2002 Borland
endwslsh.cpp:
tlib /C mylib.lib -+endwslsh.obj
TLIB 4.5 Copyright (c) 1987, 1999 Inprise Corporation
Warning: 'endwslsh' not found in library
bcc32 -WCR -c shlerr.cpp
Borland C++ 5.6.4 for Win32 Copyright (c) 1993, 2002 Borland
shlerr.cpp:
tlib /C mylib.lib -+shlerr.obj
TLIB 4.5 Copyright (c) 1987, 1999 Inprise Corporation
Warning: 'shlerr' not found in library
Done

C:\Projects\mylib\CopyFold\1
----------------

. Ed
Hi,
I copied a makefile from a software supply and modified
DEBUGS= -v
CFLAGS= $(DEBUGS) -DMSDOS -DETH_MSS=576
-Id:\borlandc\include \
-Ld:\borlandc\lib
MODELL= -ml
d:\borlandc\bin\bcc -c $(MODELL)$(CFLAGS) $*.c
d:\borlandc\bin\tlib d:\myplace\mylib -+$*
Error makefile 7: No match found for wildcard '-+$*'
Error makefile 7: Command syntax error
I changed -c to -P-c, the result was the same.
I asked the software supply and they said they didn't have
such a problem. Could you please tell me how to solve this
problem and what the correct format of a makefile is to build
a library file?
Thank you.
Continue reading on narkive:
Loading...