[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 = libtk4pl.so.0
SONAME2 = libtk4pl.so
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)
CFLAGS += -DSWI
LIBS += -lpl
OBJS += prlg-intf/tk4swi.o
endif
ifeq ($(MAKECMDGOALS),yap)
CFLAGS += -DYAP
OBJS += prlg-intf/tk4yap.o
endif
ifeq ($(MAKECMDGOALS),xsb)
CFLAGS += -DXSB
OBJS += prlg-intf/tk4xsb.o
endif
ifeq ($(SYS), mingw32)
CFLAGS += -I$(TCL_INCLUDE) -DWIN_MACHINE -DBUILDING_DLL=1
LFLAGS += -L$(TCL_LIB)
LIBS += -ltcl84 -ltk84
TGT = tk4pl.dll
else
LIBS += -ltcl8.4 -ltk8.4
TGT = libtk4pl.so.0.0.1
endif
#calculate dependencies out of the objects
DEPS := $(patsubst %.o,%.d,$(OBJS))
all:
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/ >> $@
clean:
$(RM) *.o *.d tk4pl.dll *.so* *~ prlg-intf/*.o prlg-intf/*.d
prlg-intf/*~
-include $(DEPS)
---------------------------
Any thoughts?
Thanks,
Udi.
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! - http://www.excite.com
The most personalized portal on the Web!
- Problems with make on mingw,
Udi Kalifon <=