Skip to content

Commit

Permalink
Add a make target for profiling
Browse files Browse the repository at this point in the history
  • Loading branch information
shinh committed Mar 28, 2011
1 parent aab7695 commit e1e81de
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Makefile
@@ -1,4 +1,5 @@
GCCFLAGS=-g -Iinclude -Wall -MMD -fno-omit-frame-pointer -O PROFILE_FLAGS=
GCCFLAGS=-g -Iinclude -Wall -MMD -fno-omit-frame-pointer -O $(PROFILE_FLAGS)
CXXFLAGS=$(GCCFLAGS) -W -Werror CXXFLAGS=$(GCCFLAGS) -W -Werror
CFLAGS=$(GCCFLAGS) -fPIC CFLAGS=$(GCCFLAGS) -fPIC


Expand Down Expand Up @@ -29,6 +30,9 @@ endif


all: $(EXES) all: $(EXES)


profile:
make clean all PROFILE_FLAGS=-pg

mach: $(MAC_TARGETS) mach: $(MAC_TARGETS)


check: all mach check: all mach
Expand All @@ -48,13 +52,13 @@ $(MACTXTS): %.txt: %.bin
# touch $@ # touch $@


extract: extract.o fat.o extract: extract.o fat.o
$(CXX) $^ -o $@ -g -I. -W -Wall $(CXX) $^ -o $@ -g -I. -W -Wall $(PROFILE_FLAGS)


macho2elf: macho2elf.o mach-o.o fat.o log.o macho2elf: macho2elf.o mach-o.o fat.o log.o
$(CXX) $^ -o $@ -g $(CXX) $^ -o $@ -g $(PROFILE_FLAGS)


ld-mac: ld-mac.o mach-o.o fat.o log.o ld-mac: ld-mac.o mach-o.o fat.o log.o
$(CXX) $^ -o $@ -g -ldl -lpthread $(CXX) $^ -o $@ -g -ldl -lpthread $(PROFILE_FLAGS)


# TODO(hamaji): autotoolize? # TODO(hamaji): autotoolize?
libmac/libmac.so: libmac/mac.o libmac/libmac.so: libmac/mac.o
Expand Down

0 comments on commit e1e81de

Please sign in to comment.