Jerry James writes:
Hi Robert,
Thank you for your submission.
Robert Pluim <rpluim(a)bigfoot.com> wrote:
> Modules always fail to build for me on FreeBSD, turns out that the
> Makefile needed a little tweaking (gnu make works fine). Not tested
> anywhere other than FreeBSD.
The SRC_SRCS change seems a little strange to me, but I can well believe
that some make might need to do that.
If SRC_SRCS is assigned using '=', then the ${srcdir} doesn't get
expanded when SRC_SRCS is used in the actual rule later on. With
':=' it is expanded at assignment and everything works fine.
However, the other changes look
like noops to me. Or are you saying that the *name* CC is hardwired
into FreeBSD make, and that we just need to choose something, anything,
different from CC to make it work?
make is invoked recursively by the top-level makefile something like
'cd modules/foo CC=gcc', which overrides the subdir makefile's setting
of CC. Hmm, I've just noticed that the top-level GNUmakefile
_doesn't_ do that, it just recurses into the sub-directory. I have no
idea why. [1]
Also, why the one use of ELLCC
instead of MODCC?
Oops, they should all be MODCC, patch redone and attached.
ChangeLog:
2003-01-30 Robert Pluim <rpluim(a)bigfoot.com>
* Makefile.common: FreeBSD make compatability fixes, expand
SRC_SRCS immediately, use MODCC rather than CC.
Index: Makefile.common
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/modules/common/Makefile.common,v
retrieving revision 1.2
diff -u -r1.2 Makefile.common
--- Makefile.common 2002/11/18 06:52:30 1.2
+++ Makefile.common 2003/01/31 08:43:50
@@ -27,7 +27,7 @@
## Note: This will be appended to the individual module Makefiles by configure.
-SRC_SRCS=$(SRCS:%=$(srcdir)/%)
+SRC_SRCS:=$(SRCS:%=$(srcdir)/%)
OBJS=$(SRCS:.c=.o)
SHELL=/bin/sh
@@ -47,7 +47,7 @@
srcdir=@srcdir@
VPATH=@srcdir@
-CC=@MOD_CC@
+MODCC=@MOD_CC@
MODARCHDIR=@MODARCHDIR@
MAKE_DOCFILE=@MAKE_DOCFILE@
MODCFLAGS=@MODCFLAGS@
@@ -59,13 +59,13 @@
all: $(OBJECT_TO_BUILD)
.c.o:
- $(CC) $(MODCFLAGS) -c $<
+ $(MODCC) $(MODCFLAGS) -c $<
$(MODNAME).ell: $(OBJS) $(MODNAME)_i.o
- $(CC) --mode=link --mode=verbose --mod-output=$@ $^ $(LDFLAGS)
+ $(MODCC) --mode=link --mode=verbose --mod-output=$@ $^ $(LDFLAGS)
$(MODNAME)_i.c: $(SRCS)
- ELLMAKEDOC=$(MAKE_DOCFILE) $(CC) --mode=init --mod-output=$@ \
+ ELLMAKEDOC=$(MAKE_DOCFILE) $(MODCC) --mode=init --mod-output=$@ \
--mod-name=$(MODNAME) --mod-version=$(MODVER) \
--mod-title=$(MODTITLE) $(SRC_SRCS)
Footnotes:
[1] Why do we try to stay compatible with GNU make _and_ generic make?
Why don't we just pick one and stick with it?
--
Mobile: +33 6 19 49 54 48
Tel: +33 4 92 94 05 94