1
0
forked from 0ad/0ad

profiling and run targets, descriptions in readme.txt

This was SVN commit r124.
This commit is contained in:
Simon Brenner 2003-11-30 16:41:21 +00:00
parent e9b219f8a4
commit 785a6f1290
2 changed files with 38 additions and 2 deletions

View File

@ -43,13 +43,24 @@ LIB_OBJS=$(patsubst %.cpp, $(OBJDIR)/%.o, $(LIB_SOURCES))
DEP_SOURCES=$(PS_SOURCES) $(PS_NET_SOURCES) $(GUI_SOURCES) $(LIB_SOURCES) $(TERR_SOURCES)
.PHONY: clean all Makefile MPT
.PHONY: clean all MPT run runMPT prof runProf
all: .banner $(BINDIR)/prometheus
prof: $(BINDIR)/prometheus.prof
clean:
rm -fr deps o
run: $(BINDIR)/prometheus
pushd $(BINDIR); ./prometheus; popd
runProf: $(BINDIR)/prometheus-prof
pushd $(BINDIR); ./prometheus.prof; popd
runMPT: $(BINDIR)/MessagePassingTest
pushd $(BINDIR); ./MessagePassingTest; popd
include $(patsubst %, $(DEPDIR)/%.d, $(DEP_SOURCES))
.banner:
@ -73,15 +84,31 @@ $(BINDIR)/MessagePassingTest: \
MPT: $(BINDIR)/MessagePassingTest
$(BINDIR)/prometheus: $(OBJDIR)/main.o $(PS_OBJS) $(LIB_OBJS) $(GUI_OBJS) $(TERR_OBJS)
prometheus_OBJS=$(OBJDIR)/main.o \
$(PS_OBJS) \
$(PS_NET_OBJS) \
$(LIB_OBJS) \
$(GUI_OBJS) \
$(TERR_OBJS)
$(BINDIR)/prometheus: $(prometheus_OBJS)
@mkdir -p $(dir $@)
$(CXX) $(LDFLAGS) -o $@ $^
$(BINDIR)/prometheus.prof: $(patsubst %.o, %.prof.o, $(prometheus_OBJS))
@mkdir -p $(dir $@)
$(CXX) $(LDFLAGS) -pg -o $@ $^
$(OBJDIR)/%.o: $(SRCDIR)/%.cpp
@mkdir -p $(dir $@)
@echo : $@
@$(CXX) $(CPPFLAGS) $(CFLAGS) $(CXXFLAGS) -c -o $@ $<
$(OBJDIR)/%.prof.o: $(SRCDIR)/%.cpp
@mkdir -p $(dir $@)
@echo : $@
@$(CXX) $(CPPFLAGS) $(CFLAGS) $(CXXFLAGS) -pg -c -o $@ $<
$(SRCDIR)/%.ii: $(SRCDIR)/%.cpp
@echo Generating preprocessed file $(notdir $<).ii
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -E -o $(notdir $<).ii $<

View File

@ -22,3 +22,12 @@ binaries/: The built binaries - called "prometheus"
source/linux/deps/: Automatically generated dependency information for all
source files
source/linux/o/: Object files
Makefile Targets:
all (default): build the prometheus executable
prof: build the prometheus.prof executable (instrumented version with call-counting)
clean: Remove all object, depend, and executable files
run: build prometheus and run it (from the binaries directory)
runProf: build prometheus.prof and run it