>> Why does it require me to copy sed and msys-dll to the local
>STOP!! Don't do that unless you fully understand what happens. Remove
>You should work from within the MSYS environment when using MSYS tools.
>Make sure that you only have the MSYS version of make in PATH. If you
>don't want to work in the MSYS shell then make sure that the path to
>msys\1.0\bin is in your PATH in the Win32 environment you're working >in.
I _am_ working from the msys shell, and /bin is in my path. Still, I get this error:
'sed' is not recognized as an internal or external command,
operable program or batch file.
C:\msys\bin\make.exe: *** [terms.d] Error 255
What's error 255 and why does it say C:\msys\bin\ instead of /bin/make? It's from inside the msys shell.
>You should provide us with the contents of your make file. My guess is
>that your problem is you are trying to build a program foo but gcc
>outputs foo.exe. Your target needs to reflect the .exe for make to work
I implemented your suggestion to make the target the same name as the file that's created, including extension. Still, all that make is willing to do for me is create the ".d" files and then return:
C:\msys\bin\make.exe: Nothing to be done for `all'.
I attach the makefile below. To make it easier for you to understand, I'll explain what it's supposed to work like. The user types "make swi", for example. If he doesn't specify a target name like "swi" I want make to not build anything by default (so the target 'all' is deliberately empty). According to the target name, I add the appropriate libs and compiler flags (the parameter $(MAKECMDGOALS) is the target the user specified). According to the operating system type I set the target name (the parameter TGT is given the value "tk4pl.dll" if "gcc -dumpmachine" returns "mingw32"). The target "swi" then depends on $(TGT) which is how I implemented your suggestion (so if the dll exists already it won't be rebuilt when the user does "make swi" again).
I really appreciate the time and all the help I got so far from this group. I would have given up a long time already if it wasn't for you. Thanks a lot, and now here it is again my current version of the makefile:
PRLG_INCLUDE = "C:\Program Files\pl\include"
PRLG_LIB = "C:\Program Files\pl\bin"
#PRLG_INCLUDE = /usr/local/lib/pl-5.0.10/include
#PRLG_LIB = /usr/local/lib/pl-5.0.10/runtime/i686-linux
TCL_INCLUDE = "C:\msys\local\include"
TCL_LIB = "C:\msys\local\lib"
SONAME = libtk4pl.so.0
SONAME2 = libtk4pl.so
CFLAGS = -shared -isystem $(PRLG_INCLUDE)
LFLAGS = -L$(PRLG_LIB) -Wl,-soname,$(SONAME)
RM = rm -f
SYS := $(shell gcc -dumpmachine)
OBJS = my_tcl.o terms.o tk4pl.o tk_Config.o tk_New.o
CFLAGS += -DSWI
LIBS += -lpl
OBJS += prlg-intf/tk4swi.o
CFLAGS += -DYAP
OBJS += prlg-intf/tk4yap.o
CFLAGS += -DXSB
OBJS += prlg-intf/tk4xsb.o
ifeq ($(SYS), mingw32)
CFLAGS += -isystem $(TCL_INCLUDE) -DWIN_MACHINE -DBUILDING_DLL=1
LFLAGS += -L$(TCL_LIB)
LIBS += -ltcl84 -ltk84
TGT = tk4pl.dll
LIBS += -ltcl8.4 -ltk8.4
TGT = libtk4pl.so.0.0.1
#calculate dependencies out of the objects
DEPS := $(patsubst %.o,%.d,$(OBJS))
swi yap xsb: $(TGT)
$(TGT): $(OBJS) $(DEPS)
@echo debugging info: making $(TGT) <-- it never gets here
gcc -shared -o $(TGT) $(LFLAGS) $(LIBS) $(OBJS)
((`gcc -dumpmachine` != "mingw32")) || ln -s $(TGT) $(SONAME2)
gcc -c $(CFLAGS) $< -o $@
@echo debugging info: making $(DEPS)
gcc -MM $(CFLAGS) $< > $@
gcc -MM $(CFLAGS) $< | sed s/\\.o/.d/ >> $@
$(RM) *.o *.d tk4pl.dll *.so* *~ prlg-intf/*.o prlg-intf/*.d prlg-intf/*~
@echo Please specify the Prolog platform you wish to build for, like so:
@echo make swi
@echo make yap
@echo make xsb
@echo (choose only one, of course)
Join Excite! - http://www.excite.com
The most personalized portal on the Web!