all: test profile.o: profile.c gcc -c $< -o $@ test.instrumented: test.c profile.o gcc -finstrument-functions -Wall $+ -o $@ -ffunction-sections -fdata-sections # gcc -finstrument-functions -Wall $+ -o test -Wl,--verbose -Wl,-T,linker.script -ffunction-sections -Wl,--print-map custom.script: test.instrumented ./$< > symbol_list.txt ./generate_sections.py $< symbol_list.txt > $@ test: custom.script test.c gcc -Tcustom.script test.c -ffunction-sections -fdata-sections -o $@ clean: rm -f test *.o *~ custom.script test.instrumented nm: test nm --numeric-sort test