Skip to content

Commit

Permalink
ARM: simplify build process
Browse files Browse the repository at this point in the history
  • Loading branch information
pczarn committed Jan 16, 2014
1 parent 5d2f7d6 commit 1ad41e0
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions arch/arm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,22 @@ LINK := $(BDIR)/linker.ld $(BDIR)/loader.o $(BDIR)/main.o $(BDIR)/core.o aeabi_l

.PHONY: all run debug clean

all: boot/floppy.img
all: $(BDIR)/floppy.img

$(BDIR)/$(LCORE): $(wildcard ../../rust-core/core/*.rs)
$(RUSTC) $(RUSTCFLAGS) ../../rust-core/core/lib.rs --out-dir $(BDIR)

$(BDIR)/core.bc: $(BDIR)/$(LCORE)
cd $(@D); ar x $(<F) $(@F)

%.ll: %.bc
$(LLVM_ROOT)/bin/llvm-dis $^
sed -i 's/fixedstacksegment //g;s/arm-unknown-linux-gnueabihf/arm-none-eabi/g;s/nocapture read[a-z]*/nocapture/g' $@
%.bc: ../../../%.rs $(MODS) $(BDIR)/$(LCORE)
$(RUSTC) $(RUSTCFLAGS) --emit-llvm ../../main.rs --out-dir $(BDIR) -L $(BDIR)

%.ll: ../../../%.rs $(MODS) $(BDIR)/$(LCORE)
$(RUSTC) $(RUSTCFLAGS) --emit-llvm -S ../../main.rs --out-dir $(BDIR) -L $(BDIR)
sed -i 's/fixedstacksegment //g;s/arm-unknown-linux-gnueabihf/arm-none-eabi/g;s/nocapture read[a-z]*/nocapture/g' $@

%.s: %.ll
%.s: %.bc
$(LLC) $(LLCFLAGS) $^ -o $@
sed -i 's/.note.rustc,"aw"/.note.rustc,"a"/g' $@

%.o: %.s
$(AS) -c $< -o $@
$(AS) -c $< -o $@ -g

$(BDIR)/floppy.elf: $(LINK)
$(LD) -o $@ -T $^
Expand Down

0 comments on commit 1ad41e0

Please sign in to comment.