|
From: | Cyrus Klug |
Subject: | 3.80: Unix<->NT rule inference differ |
Date: | Mon, 3 Feb 2003 14:36:42 +0000 (GMT) |
Hello,
some of the Makefiles I work with are used for building in both NT and UNIX environments.
I am seeing a difference between the way GNU Make 3.80 works on these two platforms. Basically, Unix gnumake can apparently deduce a general rule from an explicit rule command, whereas NT cannot infer an implicit rule from an explicit one. My apologies if this has appeared previously.
Scenario:
I was trying to compile two libraries, say foo.lib and bar.lib (NT) and seperately on Unix foo.a and bar.a (Unix). Here is a mocked-up version of the how NT sees the Makefile:
--------------------------------------snip--------------------------
CC=cl
MAKELIB= lib.exe /OUT:$@
objFiles1= foo.obj
objFiles2= foo.obj bar.obj
lib: foo.lib bar.lib
foo.lib: $(objFiles1)
$(MAKELIB) $?
bar.lib: $(objFiles2)
$(MAKELIB) $?
foo.obj: foo.c
$(CC) -c $< -o $@
bar.obj: bar.c
----------------------snip------------------
Here is the issue: under NT, gnumake 3.80 determines that the rule for bar.obj has no command line. Contrast Unix, with essentially the same Makefile and gnumake release, the command line $(CC) -c $< -o $@ is inferred for target bar.obj based on the rule for foo.obj. This behaviour is also confirmed by looking at the debugged output for gnumake.
I know that using a suitable pattern rule would work under NT and UNIX, and I have successfully tried this, but I would like to know why the scenario I describe behaves differently.
Thanks and regards,
C.K.
[Prev in Thread] | Current Thread | [Next in Thread] |