[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problems with make on mingw

From: Udi Kalifon
Subject: Problems with make on mingw
Date: Wed, 23 Apr 2003 16:28:31 -0400 (EDT)

I am experiencing very strange behaviour of make in the mingw32 environment. My 
makefile works great on Linux, but behaves differently on mingw every time and 
I can't figure out the pattern.

Make seems to be ignoring the target I give it to build. I try "make swi" and 
make tells me that "nothing needs to be done for all" and stops. I try "make 
clean", and instead make starts compiling things (it starts creating ".d" files 
- sometimes it creates just one or two ".d" files, sometimes all of them, but 
never does the actual target). 

"make swi" and "make clean" should work because the makefile includes targets 
for "swi" and "clean" and the target "all" is deliberately empty to make there 
no default targets in the file. I also use a lot of conditions in the make file 
to add different flags for each target and operating system and I notice that 
make on mingw doesn't do them right. It's as if the target and the parameter 
$(MAKECMDGOALS) are blank.

What's going on here?
My makefile is attached here:

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        =
SONAME2       =
CFLAGS        = -shared -I$(PRLG_INCLUDE)
LFLAGS        = -L$(PRLG_LIB) -Wl,-soname,$(SONAME)
RM            = rm -f
SYS           = $(shell gcc -dumpmachine)
LIBS          = 

OBJS = my_tcl.o terms.o tk4pl.o tk_Config.o tk_New.o

ifeq ($(MAKECMDGOALS),swi)
LIBS   += -lpl
OBJS   += prlg-intf/tk4swi.o

ifeq ($(MAKECMDGOALS),yap)
OBJS   += prlg-intf/tk4yap.o

ifeq ($(MAKECMDGOALS),xsb)
OBJS   += prlg-intf/tk4xsb.o

ifeq ($(SYS), mingw32)
LIBS   += -ltcl84 -ltk84
TGT     = tk4pl.dll
LIBS   += -ltcl8.4 -ltk8.4
TGT     =

#calculate dependencies out of the objects
DEPS := $(patsubst %.o,%.d,$(OBJS))


swi yap xsb: $(OBJS) $(DEPS) 
        gcc -shared -o $(TGT) $(LFLAGS) $(LIBS) $(OBJS)
        ((`gcc -dumpmachine` != "mingw32")) || ln -s $(TGT) $(SONAME2)

%.o: %.c
        gcc -c $(CFLAGS) $< -o $@

%.d: %.c
        gcc -MM $(CFLAGS) $< > $@
        gcc -MM $(CFLAGS) $< | sed s/\\.o/.d/ >> $@

        $(RM) *.o *.d tk4pl.dll *.so* *~ prlg-intf/*.o prlg-intf/*.d 
-include $(DEPS)


Any thoughts?

b.t.w - I also had another problem. Make didn't find sed, which is used for the 
dependencies calculations. Although sed is installed with mingw in the /bin 
directory it wasn't recognized as an internal or exeternal command... I worked 
around that by copying sed.exe and msys-1.0.dll to the current directory. Is 
there another way to solve this?

Join Excite! -
The most personalized portal on the Web!

reply via email to

[Prev in Thread] Current Thread [Next in Thread]