summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-09-10 11:53:44 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:18:11 -0500
commit2cebef3a9e2f58c0260c54915440dc62e3d02594 (patch)
treec202e6e2293e40a5823f2a125d61e6b59b478cab /source4
parentfc8960ee9aec25db398d2ed4df124484f70abcfb (diff)
downloadsamba-2cebef3a9e2f58c0260c54915440dc62e3d02594.tar.gz
samba-2cebef3a9e2f58c0260c54915440dc62e3d02594.tar.bz2
samba-2cebef3a9e2f58c0260c54915440dc62e3d02594.zip
r18333: $< is broken in older BSD version:
when $@ is foo/bar.o, $< could be torture/foo/bar.c if it also exists. So better use $* which is foo/bar to get foo/bar.c metze (This used to be commit 7aad9f81d927778bd3da6a37afc0489f1fefdc58)
Diffstat (limited to 'source4')
-rw-r--r--source4/main.mk33
1 files changed, 20 insertions, 13 deletions
diff --git a/source4/main.mk b/source4/main.mk
index 270c9b3ff5..7a309a1fbe 100644
--- a/source4/main.mk
+++ b/source4/main.mk
@@ -330,26 +330,33 @@ include/includes.d: include/includes.h
@echo "Generating dependencies for $<"
@$(CC) -M -MG -MT include/includes.h.gch -MT $@ $(CFLAGS) $< -o $@
+#
+# $< is broken in older BSD versions:
+# when $@ is foo/bar.o, $< could be torture/foo/bar.c
+# if it also exists. So better use $* which is foo/bar
+# and append .c manually to get foo/bar.c
+#
.c.o:
@if test -n "$(CC_CHECKER)"; then \
- echo "Checking $< with '$(CC_CHECKER)'"; \
- $(CC_CHECKER) `$(PERL) $(srcdir)/script/cflags.pl $@` $(CFLAGS) $(PICFLAG) -c $< -o $@; \
+ echo "Checking $*.c with '$(CC_CHECKER)'"; \
+ $(CC_CHECKER) `$(PERL) $(srcdir)/script/cflags.pl $@` $(CFLAGS) $(PICFLAG) -c $*.c -o $@; \
fi
- @echo "Compiling $<"
- @$(CC) `$(PERL) $(srcdir)/script/cflags.pl $@` $(CFLAGS) $(PICFLAG) -c $< -o $@ && exit 0;\
+ @echo "Compiling $*.c"
+ @$(CC) `$(PERL) $(srcdir)/script/cflags.pl $@` $(CFLAGS) $(PICFLAG) -c $*.c -o $@ && exit 0;\
echo "The following command failed:" 1>&2;\
- echo "$(CC) `$(PERL) $(srcdir)/script/cflags.pl $@` $(CFLAGS) $(PICFLAG) -c $< -o $@" 1>&2;\
- echo "@: $@";\
- echo "<: $<";\
- echo "*: $*";\
- $(CC) `$(PERL) $(srcdir)/script/cflags.pl $@` $(CFLAGS) $(PICFLAG) -c $< -o $@ >/dev/null 2>&1
+ echo "$(CC) `$(PERL) $(srcdir)/script/cflags.pl $@` $(CFLAGS) $(PICFLAG) -c $*.c -o $@" 1>&2;\
+ echo "@: $@" 1>&2;\
+ echo "<: $<" 1>&2;\
+ echo "*: $*" 1>&2;\
+ echo "*.c: $*.c" 1>&2;\
+ $(CC) `$(PERL) $(srcdir)/script/cflags.pl $@` $(CFLAGS) $(PICFLAG) -c $*.c -o $@ >/dev/null 2>&1
.c.ho:
- @echo "Compiling $< with host compiler"
- @$(HOSTCC) `$(PERL) $(srcdir)/script/cflags.pl $@` $(CFLAGS) -c $< -o $@ && exit 0;\
+ @echo "Compiling $*.c with host compiler"
+ @$(HOSTCC) `$(PERL) $(srcdir)/script/cflags.pl $@` $(CFLAGS) -c $*.c -o $@ && exit 0;\
echo "The following command failed:" 1>&2;\
- echo "$(HOSTCC) `$(PERL) $(srcdir)/script/cflags.pl $@` $(CFLAGS) -c $< -o $@" 1>&2;\
- $(HOSTCC) `$(PERL) $(srcdir)/script/cflags.pl $@` $(CFLAGS) -c $< -o $@ >/dev/null 2>&1
+ echo "$(HOSTCC) `$(PERL) $(srcdir)/script/cflags.pl $@` $(CFLAGS) -c $*.c -o $@" 1>&2;\
+ $(HOSTCC) `$(PERL) $(srcdir)/script/cflags.pl $@` $(CFLAGS) -c $*.c -o $@ >/dev/null 2>&1
.h.h.gch:
@echo "Precompiling $<"