Louie McCrady wrote:
objectFiles = $(patsubst %.cpp,%.o,$(wildcard *.cpp))
sourceFiles = "hello"
myprog.exe : $(objectFiles)
@echo "all sources to be compiled : $(sourceFiles)"
%.o : %.cpp
@echo "Adding $< to the list to be compiled"
set sourceFiles += $<
@echo "sanity check: --- $(sourceFiles) --- $@ --- $< ---"
If you want to be really evil (i.e. break lots of Paul's rules) you can
do this:
OBJS := $(wildcard *.cpp)
OBJS := $(OBJS:.cpp=.o)
.PHONY: all
all: $(OBJS)
@echo $(SRCS) is the list of CPP files to recompile
%.o : %.cpp
$(eval SRCS += $<)
John.
--
John Graham-Cumming
[EMAIL PROTECTED]
Home: http://www.jgc.org/
Blog: http://www.jgc.org/blog/
POPFile: http://getpopfile.org/
GNU Make Standard Library: http://gmsl.sf.net/
GNU Make Debugger: http://gmd.sf.net/
Fast, Parallel Builds: http://www.electric-cloud.com/
Sign up for my Spam and Anti-spam Newsletter
at http://www.jgc.org/
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make