Skip to content

Commit

Permalink
Do not expand variables like $(CC) when writing to a dependency file
Browse files Browse the repository at this point in the history
  • Loading branch information
paulcadman committed Nov 24, 2023
1 parent f610518 commit ee5bd23
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions runtime/Makefile.generic
Original file line number Diff line number Diff line change
Expand Up @@ -240,23 +240,23 @@ $(CLEXSOURCES) : $(BUILDDIR)%.c : %.lex

$(CDEPENDS) : $(BUILDDIR)%.d : %.c
$(CC) $(CDEPFLAGS) -MM -MT $(patsubst %.c,$(BUILDDIR)%.o,$<) $< > $@
printf "\t$(CC) -c $(CFLAGS) -o $(patsubst %.c,$(BUILDDIR)%.o,$<) $<\n" >> $@
printf "\t\$$(CC) -c \$$(CFLAGS) -o $(patsubst %.c,$(BUILDDIR)%.o,$<) $<\n" >> $@

$(CYLDEPENDS) : $(BUILDDIR)%.d : $(BUILDDIR)%.c
$(CC) $(CDEPFLAGS) -MM -MT $(patsubst %.c,%.o,$<) $< > $@
printf "\t$(CC) -c $(CFLAGS) -o $(patsubst %.c,%.o,$<) $<\n" >> $@
printf "\t\$$(CC) -c \$$(CFLAGS) -o $(patsubst %.c,%.o,$<) $<\n" >> $@

$(CPPDEPENDS) : $(BUILDDIR)%.d : %.cpp
$(CXX) $(CXXDEPFLAGS) -MM -MT $(patsubst %.cpp,$(BUILDDIR)%.o,$<) $< > $@
printf "\t$(CXX) -c $(CXXFLAGS) -o $(patsubst %.cpp,$(BUILDDIR)%.o,$<) $<\n" >> $@
printf "\t\$$(CXX) -c \$$(CXXFLAGS) -o $(patsubst %.cpp,$(BUILDDIR)%.o,$<) $<\n" >> $@

$(CXXDEPENDS) : $(BUILDDIR)%.d : %.cxx
$(CXX) $(CXXDEPFLAGS) -MM -MT $(patsubst %.cxx,$(BUILDDIR)%.o,$<) $< > $@
printf "\t$(CXX) -c $(CXXFLAGS) -o $(patsubst %.cxx,$(BUILDDIR)%.o,$<) $<\n" >> $@
printf "\t\$$(CXX) -c \$$(CXXFLAGS) -o $(patsubst %.cxx,$(BUILDDIR)%.o,$<) $<\n" >> $@

$(CCDEPENDS) : $(BUILDDIR)%.d : %.cc
$(CXX) $(CXXDEPFLAGS) -MM -MT $(patsubst %.cc,$(BUILDDIR)%.o,$<) $< > $@
printf "\t$(CXX) -c $(CXXFLAGS) -o $(patsubst %.cc,$(BUILDDIR)%.o,$<) $<\n" >> $@
printf "\t\$$(CXX) -c \$$(CXXFLAGS) -o $(patsubst %.cc,$(BUILDDIR)%.o,$<) $<\n" >> $@

$(CPROGRAMS) : % : $(ALLOBJECTS)
$(CCLD) -o $@ [email protected] $(OBJECTS) $(CCLDFLAGS)
Expand Down

0 comments on commit ee5bd23

Please sign in to comment.