1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/tools/reorder/Makefile Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,74 @@ 1.4 +# This Source Code Form is subject to the terms of the Mozilla Public 1.5 +# License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 +# file, You can obtain one at http://mozilla.org/MPL/2.0/. 1.7 + 1.8 +# Redefine this to something that makes sense for you. 1.9 +MOZ_SRC=/usr/src/seamonkey-clean/mozilla 1.10 +MKLINKSCRIPT=$(MOZ_SRC)/config/mklinkscript.pl 1.11 + 1.12 +ifdef DEBUG 1.13 +CFLAGS=-g -Wall 1.14 +CXXFLAGS=-g -Wall 1.15 +else 1.16 +CFLAGS=-O2 1.17 +CXXFLAGS=-O2 1.18 +endif 1.19 + 1.20 +ifdef PROFILE 1.21 +CFLAGS += -pg -g 1.22 +CXXFLAGS += -pg -g 1.23 +endif 1.24 + 1.25 +TARGETS=\ 1.26 + libmcount.so \ 1.27 + libcygprof.so \ 1.28 + addrs2text \ 1.29 + garope \ 1.30 + grope \ 1.31 + histogram \ 1.32 + mapaddrs \ 1.33 + rseed \ 1.34 + test \ 1.35 + $(NULL) 1.36 + 1.37 +all: $(TARGETS) 1.38 + 1.39 +libmcount.so: mcount.c 1.40 + $(CC) -shared $(CFLAGS) -o $@ $< 1.41 + 1.42 +libcygprof.so: cygprof.c 1.43 + $(CC) -shared $(CFLAGS) -o $@ $< 1.44 + 1.45 +addrs2text: addrs2text.o 1.46 + 1.47 +garope: garope.cpp elf_symbol_table.o elf_utils.o 1.48 +grope: grope.cpp elf_symbol_table.o elf_utils.o 1.49 +histogram: histogram.cpp elf_symbol_table.o elf_utils.o 1.50 +mapaddrs: mapaddrs.cpp elf_symbol_table.o elf_utils.o 1.51 +rseed: rseed.c 1.52 +elf_symbol_table.o: elf_symbol_table.cpp elf_symbol_table.h elf_utils.h interval_map.h 1.53 +elf_utils.o: elf_utils.cpp elf_utils.h 1.54 + 1.55 +# Build these with -pg so we get profiling info 1.56 +TEST_CFLAGS=-ffunction-sections -finstrument-functions -O2 1.57 + 1.58 +test: test.o mult.o test.ldscript 1.59 + $(CXX) -Wl,-T,test.ldscript -O2 -o $@ $^ 1.60 + 1.61 +test.ldscript: test.order $(MKLINKSCRIPT) 1.62 + perl $(MKLINKSCRIPT) -o $@ $< 1.63 + 1.64 +# This should really be generated by one of the fine tools, above. If 1.65 +# it hasn't been, create an empty ordering file. 1.66 +test.order: 1.67 + touch $@ 1.68 + 1.69 +mult.o: mult.c 1.70 + $(CC) $(TEST_CFLAGS) -c -o $@ $< 1.71 + 1.72 +test.o: test.cpp 1.73 + $(CXX) $(TEST_CFLAGS) -c -o $@ $< 1.74 + 1.75 +clean: 1.76 + rm -f $(TARGETS) test.ldscript *.o *~ core 1.77 +