<commit_before>device := stm32f100rb

llvm   := -3.4
cross  := arm-linux-gnueabi-

stdlib := startup32.ll cortex-m3.ll volatile.ll
stdlib := $(addprefix ../lib/,$(stdlib))

.SUFFIXES:

# Common rules for all targets

%.fir: %.fy
	../foundry_vm.native $^ -o $@

%.opt.fir: %.fir
	../foundry_xfrm.native $^ -std-xfrms -o $@

%.o: %.opt.bc
	llc$(llvm) -filetype=obj $^ -o $@

%.s: %.opt.bc
	llc$(llvm) -filetype=asm $^ -o $@

clean:
	rm -f *.fir *.bc *.s *.o *.bin *.elf

# (h)ost rules

%.h.bc: %.opt.fir
	../foundry_gen.native -target x86_64 $^ -o $@

%.h.opt.bc: %.h.bc
	opt$(llvm) $^ \
		-std-link-opts \
		-o $@

%.h.elf: %.h.o
	gcc $^ -o $@

# (d)evice rules

%.d.bc: %.opt.fir
	../foundry_gen.native -target thumbv7m $^ -o $@

%.d.opt.bc: $(stdlib) %.d.bc
	llvm-link$(llvm) $^ | opt$(llvm) \
		-internalize-public-api-list=_startup,__vectors__ \
		-internalize \
		-std-compile-opts \
		-globaldce \
		-o $@

%.d.elf: %.d.o<commit_msg>examples/Makefile: add rule for %.ll disassembly.<commit_after>device := stm32f100rb

llvm   := -3.4
cross  := arm-linux-gnueabi-

stdlib := startup32.ll cortex-m3.ll volatile.ll
stdlib := $(addprefix ../lib/,$(stdlib))

.SUFFIXES:

# Common rules for all targets

%.fir: %.fy
	../foundry_vm.native $^ -o $@

%.opt.fir: %.fir
	../foundry_xfrm.native $^ -std-xfrms -o $@

%.ll: %.bc
	llvm-dis$(llvm) $^ -o $@

%.o: %.opt.bc
	llc$(llvm) -filetype=obj $^ -o $@

%.s: %.opt.bc
	llc$(llvm) -filetype=asm $^ -o $@

clean:
	rm -f *.fir *.bc *.ll *.s *.o *.bin *.elf

# (h)ost rules

%.h.bc: %.opt.fir
	../foundry_gen.native -target x86_64 $^ -o $@

%.h.opt.bc: %.h.bc
	opt$(llvm) $^ \
		-std-link-opts \
		-o $@

%.h.elf: %.h.o
	gcc $^ -o $@

# (d)evice rules

%.d.bc: %.opt.fir
	../foundry_gen.native -target thumbv7m $^ -o $@

%.d.opt.bc: $(stdlib) %.d.bc
	llvm-link$(llvm) $^ | opt$(llvm) \
		-internalize-public-api-list=_startup,__vectors__ \
		-internalize \
		-std-compile-opts \
		-globaldce \
		-o $@

%.d.elf: %.d.o
{'fraction_non_alphanumeric': 0.24885028104241186, 'fraction_numerical': 0.015329586101175269, 'mean_word_length': 2.4777975133214922, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7011757', 'n_tokens_mistral': 981, 'n_tokens_neox': 888, 'n_words': 177}