Skip to content

Commit

Permalink
Tools: profiling target added to Makefile.
Browse files Browse the repository at this point in the history
The profiling target compiles the raytracer with the right options,
runs the sample file and write the profile output to:
build/profiling/profile.txt
You can use it with "make profiling".
  • Loading branch information
ddejean committed Dec 18, 2011
1 parent 4b5b133 commit 978743d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Makefile
Expand Up @@ -26,7 +26,7 @@ QCXXTESTGEN=@echo -e "\tTESTGEN\t " $@; $(CXXTESTGEN)

### Options
CFLAGS=-Wall -Wextra -Werror
OPTFLAGS=-O2 -mavx
OPTFLAGS=-Ofast
LDFLAGS=-lSDL -Lbuild/ $(addprefix -l, $(LIB_NAMES))
ARFLAGS=-cq

Expand All @@ -52,7 +52,13 @@ coverage: littleray test build/coverage
--output-file build/littleray.info
genhtml build/littleray.info --output-directory build/coverage/


profiling: CFLAGS+=-pg
profiling: LDFLAGS+=-pg
profiling: littleray build/profiling
build/littleray scene.xml
mv gmon.out build/profiling
cd build/profiling; gprof ../littleray > profile.txt

#######################################
##### Dependency files management #####
#######################################
Expand Down Expand Up @@ -188,7 +194,7 @@ build/Maths/%.o: Maths/%.cpp build/Maths
##### Build directories management #####
########################################

BUILD_DIRS=build build/coverage \
BUILD_DIRS=build build/coverage build/profiling \
$(addprefix build/, $(TEST_DIRS)) \
$(addprefix build/, $(LIB_NAMES))

Expand Down

0 comments on commit 978743d

Please sign in to comment.