Bug 2630 - Makefile.in not posix compliant
Makefile.in not posix compliant
Status: RESOLVED DUPLICATE of bug 2623
Product: Samba 3.0
Classification: Unclassified
Component: Build environment
3.0.14a
All Solaris
: P3 minor
: none
Assigned To: Tim Potter
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-04-20 04:14 UTC by Fredrik Lundholm
Modified: 2005-04-20 04:43 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fredrik Lundholm 2005-04-20 04:14:11 UTC
Things like:

dynconfig.o: dynconfig.c Makefile 
        @echo Compiling $*.c 
        @$(CC) $(FLAGS) $(PATH_FLAGS) -c $< -o $@  
 

are illegal because the dynamic macro '$<' only has a meaning
when an impleicit rule is processed. the rule above is doubltlessly
an explicit rule and for this reason, '$<' has an undefined value.
In case of smake, it expands into nothing.

>From POSIX:


    $< In an inference rule, the $< macro shall evaluate to the filename whose 
	existence allowed the inference rule to be chosen for the target. In 
	the .DEFAULT rule, the $< macro shall evaluate to the current target name.
        The meaning of the $< macro shall be otherwise unspecified. 


---
Patch follows:

--- samba-3.0.14a/source/Makefile.in.orig	Thu Apr 14 08:14:19 2005
+++ samba-3.0.14a/source/Makefile.in	Mon Apr 18 14:40:40 2005
@@ -771,29 +771,29 @@
 
 dynconfig.o: dynconfig.c Makefile
 	@echo Compiling $*.c
-	@$(CC) $(FLAGS) $(PATH_FLAGS) -c $< -o $@ 
+	@$(CC) $(FLAGS) $(PATH_FLAGS) -c dynconfig.c -o $@ 
 
 dynconfig.@PICSUFFIX@: dynconfig.c Makefile
 	@if (: >> $@ || : > $@) >/dev/null 2>&1; then rm -f $@; else \
 	  dir=`echo $@ | sed 's,/[^/]*$$,,;s,^$$,.,'` $(MAKEDIR); fi
 	@echo Compiling $*.c with @PICFLAGS@
-	@$(CC) -I. -I$(srcdir) $(FLAGS) $(PATH_FLAGS) @PICFLAGS@ -c $< -o $*.@PICSUFFIX@
+	@$(CC) -I. -I$(srcdir) $(FLAGS) $(PATH_FLAGS) @PICFLAGS@ -c dynconfig.c -o $@
 @BROKEN_CC@	-mv `echo $@ | sed -e 's%^.*/%%g' -e 's%\.@PICSUFFIX@$$%.o%'` $@
 
 lib/version.o: lib/version.c include/version.h
 	@echo Compiling $*.c
-	@$(CC) -I. -I$(srcdir) $(FLAGS) $(PATH_FLAGS) -c $< -o $@ 
+	@$(CC) -I. -I$(srcdir) $(FLAGS) $(PATH_FLAGS) -c lib/version.c -o $@ 
 
 lib/version.@PICSUFFIX@: lib/version.c include/version.h
 	@if (: >> $@ || : > $@) >/dev/null 2>&1; then rm -f $@; else \
 	  dir=`echo $@ | sed 's,/[^/]*$$,,;s,^$$,.,'` $(MAKEDIR); fi
 	@echo Compiling $*.c with @PICFLAGS@
-	@$(CC) -I. -I$(srcdir) $(FLAGS) $(PATH_FLAGS) @PICFLAGS@ -c $< -o $*.@PICSUFFIX@
+	@$(CC) -I. -I$(srcdir) $(FLAGS) $(PATH_FLAGS) @PICFLAGS@ -c lib/version.c -o $@
 @BROKEN_CC@	-mv `echo $@ | sed -e 's%^.*/%%g' -e 's%\.@PICSUFFIX@$$%.o%'` $@
 
 smbd/build_options.o: smbd/build_options.c Makefile include/config.h
include/build_env.h include/proto.h
 	@echo Compiling $*.c
-	@$(CC) $(FLAGS) $(PATH_FLAGS) -c $< -o $@
+	@$(CC) $(FLAGS) $(PATH_FLAGS) -c smbd/build_options.c -o $@
 
 smbd/build_options.c: include/config.h.in script/mkbuildoptions.awk
 	@echo Generating $@
Comment 1 Lars Müller 2005-04-20 04:43:34 UTC

*** This bug has been marked as a duplicate of 2623 ***