forked from M-Labs/artiq
1
0
Fork 0

firmware: clean up makefiles.

This commit is contained in:
whitequark 2017-12-27 23:04:40 +00:00
parent d7cb4963e1
commit 68f128944a
4 changed files with 12 additions and 36 deletions

View File

@ -5,7 +5,6 @@ CFLAGS += \
-I$(LIBUNWIND_DIRECTORY) \
-I$(LIBUNWIND_DIRECTORY)/../unwinder/include \
-I$(MISOC_DIRECTORY)/software/include/dyld
CFLAGS += -DNDEBUG
LDFLAGS += --eh-frame-hdr \
-L../libcompiler-rt \
@ -15,22 +14,15 @@ LDFLAGS += --eh-frame-hdr \
RUSTFLAGS += -Cpanic=unwind
all: ksupport.elf
all:: ksupport.elf
.PHONY: $(RUSTOUT)/libksupport.a
$(RUSTOUT)/libksupport.a:
$(cargo) --manifest-path $(KSUPPORT_DIRECTORY)/Cargo.toml
ksupport.elf: $(RUSTOUT)/libksupport.a glue.o
$(LD) $(LDFLAGS) -T $(KSUPPORT_DIRECTORY)/ksupport.ld -o $@ $^ \
$(link) -T $(KSUPPORT_DIRECTORY)/ksupport.ld \
-lunwind-elf -lcompiler-rt -lbase -lm
@chmod -x $@
%.o: $(KSUPPORT_DIRECTORY)/%.c
$(compile)
clean:
$(RM) *.o ksupport.elf
$(RM) -rf cargo
.PHONY: all clean

View File

@ -3,36 +3,28 @@ include $(MISOC_DIRECTORY)/software/common.mak
CFLAGS += \
-I$(LIBUNWIND_DIRECTORY) \
-I$(LIBUNWIND_DIRECTORY)/../unwinder/include \
-I$(LIBUNWIND_DIRECTORY)/../unwinder/include
LDFLAGS += -L../libbase \
-L../libunwind
RUSTFLAGS += -Cpanic=abort
all: runtime.bin runtime.fbi
all:: runtime.bin runtime.fbi
.PHONY: $(RUSTOUT)/libruntime.a
$(RUSTOUT)/libruntime.a:
$(cargo) --manifest-path $(RUNTIME_DIRECTORY)/Cargo.toml
runtime.elf: $(RUSTOUT)/libruntime.a ksupport_data.o
$(LD) $(LDFLAGS) -T $(RUNTIME_DIRECTORY)/runtime.ld -o $@ $^ \
$(link) -T $(RUNTIME_DIRECTORY)/runtime.ld \
-lunwind-bare
@chmod -x $@
ksupport_data.o: ../ksupport/ksupport.elf
$(LD) -r -b binary -o $@ $<
%.bin: %.elf
$(OBJCOPY) -O binary $< $@
@chmod -x $@
$(objcopy) -O binary
%.fbi: %.bin
@echo " MSCIMG " $@ && $(PYTHON) -m misoc.tools.mkmscimg -f -o $@ $<
clean:
$(RM) *.o runtime.elf runtime.bin runtime.fbi
$(RM) -rf cargo
.PHONY: all clean
$(mscimg) -f

View File

@ -5,25 +5,17 @@ LDFLAGS += -L../libbase
RUSTFLAGS += -Cpanic=abort
all: satman.bin satman.fbi
all:: satman.bin satman.fbi
.PHONY: $(RUSTOUT)/libsatman.a
$(RUSTOUT)/libsatman.a:
$(cargo) --manifest-path $(SATMAN_DIRECTORY)/Cargo.toml
satman.elf: $(RUSTOUT)/libsatman.a
$(LD) $(LDFLAGS) -T $(SATMAN_DIRECTORY)/satman.ld -o $@ $^
@chmod -x $@
$(link) -T $(SATMAN_DIRECTORY)/satman.ld
%.bin: %.elf
$(OBJCOPY) -O binary $< $@
@chmod -x $@
$(objcopy) -O binary
%.fbi: %.bin
@echo " MSCIMG " $@ && $(PYTHON) -m misoc.tools.mkmscimg -f -o $@ $<
clean:
$(RM) satman.elf satman.bin satman.fbi
$(RM) -rf cargo
.PHONY: all clean
$(mscimg) -f

View File

@ -15,7 +15,7 @@ requirements:
- python >=3.5.3,<3.6
- setuptools 33.1.1
- migen 0.6.dev py35_50+git82b06ee
- misoc 0.8.dev py35_35+git6845fc0a
- misoc 0.8.dev py35_39+git4126dedf
- jesd204b 0.4
- binutils-or1k-linux >=2.27
- llvm-or1k 4.0.1