Here're the file contents:

###############################################################################

.PHONY: rebuild clean

###############################################################################

SourceFiles := $(wildcard SourceFiles/*.cpp)

ObjectFiles := $(patsubst SourceFiles/%, IntermediateFiles/%,$(patsubst 
%.cpp, %.o, $(SourceFiles)))

###############################################################################

# Builds the project.

###############################################################################

rebuild: $(ObjectFiles)

ar rcs IntermediateFiles/lib $^

###############################################################################

# Removes files generated by this script.

###############################################################################

clean:

if [ -d IntermediateFiles ]; then rm IntermediateFiles/ -R; fi

###############################################################################

# Ensures that intermediate files folder exists.

###############################################################################

IntermediateFiles:

if [ ! -d IntermediateFiles ]; then mkdir IntermediateFiles; fi

###############################################################################

# Compiles a source file.

###############################################################################

IntermediateFiles/%.o: SourceFiles/%.cpp | IntermediateFiles

gcc -c $< -o $@




_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to