Permalink
Browse files

Build Rust files too

  • Loading branch information...
antoinealb committed Apr 30, 2015
1 parent b28e23f commit 033a80ea998267cca27eac75cfd0b2bac132febd
Showing with 13 additions and 0 deletions.
  1. +13 −0 Makefile
View
@@ -47,6 +47,8 @@ STELLARISWARE_PATH=tivaware
# Program name definition for ARM GNU C compiler.
CC = ${PREFIX_ARM}-gcc
# Program name definition for Rust compiler
RUSTC = rustc
# Program name definition for ARM GNU Linker.
LD = ${PREFIX_ARM}-ld
# Program name definition for ARM GNU Object copy.
@@ -59,6 +61,9 @@ CFLAGS=-mthumb ${CPU} ${FPU} -O0 -ffunction-sections -fdata-sections -MD -std=c9
# Library stuff passed as flags!
CFLAGS+= -I ${STELLARISWARE_PATH} -DPART_$(PART) -c -DTARGET_IS_BLIZZARD_RA1
RUSTFLAGS = -C opt-level=2 -Z no-landing-pads
RUSTFLAGS+= --target thumbv7em-none-eabi -g --emit obj -L libcore-thumbv7m
# Flags for LD
LFLAGS = --gc-sections
@@ -94,7 +99,10 @@ STARTUP_FILE = LM4F_startup
LINKER_FILE = LM4F.ld
SRC = $(wildcard *.c)
RUSTSRC = runtime.rs
OBJS = $(SRC:.c=.o)
OBJS += $(RUSTSRC:.rs=.o)
#==============================================================================
# Rules to make the target
@@ -108,6 +116,11 @@ all: $(OBJS) ${PROJECT_NAME}.axf ${PROJECT_NAME}
@echo Compiling $<...
$(CC) -c $(CFLAGS) ${<} -o ${@}
%.o: %.rs
@echo
@echo Compiling $<...
$(RUSTC) $(RUSTFLAGS) -o ${@} ${<}
${PROJECT_NAME}.axf: $(OBJS)
@echo
@echo Making driverlib

0 comments on commit 033a80e

Please sign in to comment.