Bug 462004: Use automatic variables in make rules, to allow VPATH to work. r=ted.mielczarek

Note that this applies to the js/src/Makefile.ref build system, not
the global Mozilla build system.

We would like to use VPATH to find js.cpp once it moves into a 'shell'
subdirectory.  However, the rules changed by this patch use $* (the
pattern stem) to generate their source filenames, not $<, which
expands to the filename found in the VPATH.
This commit is contained in:
Jim Blandy 2008-11-11 16:54:20 -08:00
parent 3ef9bec746
commit bb13265ec3

View File

@ -70,12 +70,12 @@ endif
$(OBJDIR)/%: %.cpp
@$(MAKE_OBJDIR)
$(CXX) -o $@ $(CFLAGS) $(OPTIMIZER) $*.cpp $(LDFLAGS)
$(CXX) -o $@ $(CFLAGS) $(OPTIMIZER) $< $(LDFLAGS)
# This rule must come before the rule with no dep on header
$(OBJDIR)/%.o: %.cpp %.h
@$(MAKE_OBJDIR)
$(CXX) -o $@ -c $(CFLAGS) $(OPTIMIZER) $*.cpp
$(CXX) -o $@ -c $(CFLAGS) $(OPTIMIZER) $<
$(OBJDIR)/jsinterp.o: jsinterp.cpp jsinterp.h
@$(MAKE_OBJDIR)
@ -87,16 +87,16 @@ $(OBJDIR)/jsbuiltins.o: jsbuiltins.cpp jsinterp.h
$(OBJDIR)/%.o: %.cpp
@$(MAKE_OBJDIR)
$(CXX) -o $@ -c $(CFLAGS) $(OPTIMIZER) $*.cpp
$(CXX) -o $@ -c $(CFLAGS) $(OPTIMIZER) $<
$(OBJDIR)/%.o: %.s
@$(MAKE_OBJDIR)
$(AS) -o $@ $(ASFLAGS) $*.s
$(AS) -o $@ $(ASFLAGS) $<
# This rule must come before rule with no dep on header
$(OBJDIR)/%.obj: %.cpp %.h
@$(MAKE_OBJDIR)
$(CXX) -Fo$(OBJDIR)/ -c $(CFLAGS) $(JSDLL_CFLAGS) $(OPTIMIZER) $*.cpp
$(CXX) -Fo$(OBJDIR)/ -c $(CFLAGS) $(JSDLL_CFLAGS) $(OPTIMIZER) $<
$(OBJDIR)/jsinterp.obj: jsinterp.cpp jsinterp.h
@$(MAKE_OBJDIR)
@ -108,7 +108,7 @@ $(OBJDIR)/jsbuiltins.obj: jsbuiltins.cpp jsinterp.h
$(OBJDIR)/%.obj: %.cpp
@$(MAKE_OBJDIR)
$(CXX) -Fo$(OBJDIR)/ -c $(CFLAGS) $(JSDLL_CFLAGS) $(OPTIMIZER) $*.cpp
$(CXX) -Fo$(OBJDIR)/ -c $(CFLAGS) $(JSDLL_CFLAGS) $(OPTIMIZER) $<
$(OBJDIR)/js.obj: js.cpp
@$(MAKE_OBJDIR)