michael@0: # This Source Code Form is subject to the terms of the Mozilla Public michael@0: # License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: # file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: michael@0: # Redefine this to something that makes sense for you. michael@0: MOZ_SRC=/usr/src/seamonkey-clean/mozilla michael@0: MKLINKSCRIPT=$(MOZ_SRC)/config/mklinkscript.pl michael@0: michael@0: ifdef DEBUG michael@0: CFLAGS=-g -Wall michael@0: CXXFLAGS=-g -Wall michael@0: else michael@0: CFLAGS=-O2 michael@0: CXXFLAGS=-O2 michael@0: endif michael@0: michael@0: ifdef PROFILE michael@0: CFLAGS += -pg -g michael@0: CXXFLAGS += -pg -g michael@0: endif michael@0: michael@0: TARGETS=\ michael@0: libmcount.so \ michael@0: libcygprof.so \ michael@0: addrs2text \ michael@0: garope \ michael@0: grope \ michael@0: histogram \ michael@0: mapaddrs \ michael@0: rseed \ michael@0: test \ michael@0: $(NULL) michael@0: michael@0: all: $(TARGETS) michael@0: michael@0: libmcount.so: mcount.c michael@0: $(CC) -shared $(CFLAGS) -o $@ $< michael@0: michael@0: libcygprof.so: cygprof.c michael@0: $(CC) -shared $(CFLAGS) -o $@ $< michael@0: michael@0: addrs2text: addrs2text.o michael@0: michael@0: garope: garope.cpp elf_symbol_table.o elf_utils.o michael@0: grope: grope.cpp elf_symbol_table.o elf_utils.o michael@0: histogram: histogram.cpp elf_symbol_table.o elf_utils.o michael@0: mapaddrs: mapaddrs.cpp elf_symbol_table.o elf_utils.o michael@0: rseed: rseed.c michael@0: elf_symbol_table.o: elf_symbol_table.cpp elf_symbol_table.h elf_utils.h interval_map.h michael@0: elf_utils.o: elf_utils.cpp elf_utils.h michael@0: michael@0: # Build these with -pg so we get profiling info michael@0: TEST_CFLAGS=-ffunction-sections -finstrument-functions -O2 michael@0: michael@0: test: test.o mult.o test.ldscript michael@0: $(CXX) -Wl,-T,test.ldscript -O2 -o $@ $^ michael@0: michael@0: test.ldscript: test.order $(MKLINKSCRIPT) michael@0: perl $(MKLINKSCRIPT) -o $@ $< michael@0: michael@0: # This should really be generated by one of the fine tools, above. If michael@0: # it hasn't been, create an empty ordering file. michael@0: test.order: michael@0: touch $@ michael@0: michael@0: mult.o: mult.c michael@0: $(CC) $(TEST_CFLAGS) -c -o $@ $< michael@0: michael@0: test.o: test.cpp michael@0: $(CXX) $(TEST_CFLAGS) -c -o $@ $< michael@0: michael@0: clean: michael@0: rm -f $(TARGETS) test.ldscript *.o *~ core michael@0: