Commit f7088f3d authored by Benoit Rat's avatar Benoit Rat Committed by Grzegorz Daniluk

rt: Improve Makefile

parent 273250b7
......@@ -5,7 +5,7 @@ LIBSOFTPLL_DIR = ../userspace/ptp-noposix/softpll
OBJS = main.o dev/uart.o dev/timer.o lib/mprintf.o dev/ad9516.o ipc/minipc-mem-server.o ipc/rt_ipc.o $(LIBSOFTPLL_DIR)/softpll_ng.o
CFLAGS_PLATFORM = -mmultiply-enabled -mbarrel-shift-enabled -Idev
LDFLAGS_PLATFORM = -mmultiply-enabled -mbarrel-shift-enabled -nostdlib -T target/lm32/ram.ld
LDFLAGS_PLATFORM = -mmultiply-enabled -mbarrel-shift-enabled -nostdlib -T target/lm32/ram.ld
OBJS_PLATFORM=target/lm32/crt0.o target/lm32/irq.o
CC=$(CROSS_COMPILE)gcc
......@@ -15,7 +15,7 @@ CFLAGS= $(CFLAGS_PLATFORM) -ffunction-sections -fdata-sections -O3 -Iinclude -in
LDFLAGS= $(LDFLAGS_PLATFORM) -Wl,--gc-sections -O3 -Iinclude -ffreestanding
SIZE = $(CROSS_COMPILE)size
OBJS += $(OBJS_PLATFORM)
REVISION=$(shell git rev-parse HEAD)
REVISION=$(shell git describe --always --dirty=+ | sed 's/wr-switch-sw-//')
OUTPUT=rt_cpu
......@@ -24,15 +24,17 @@ all: $(OBJS)
echo "const char *build_revision = \"$(REVISION)\";" > revision.c
echo "const char *build_date = __DATE__ \" \" __TIME__;" >> revision.c
$(CC) $(CFLAGS) -c revision.c
${CC} -o $(OUTPUT).elf $(OBJS) revision.o $(LDFLAGS)
${CC} -o $(OUTPUT).elf $(OBJS) revision.o $(LDFLAGS)
${OBJCOPY} -O binary $(OUTPUT).elf $(OUTPUT).bin
cp $(OUTPUT).bin ../binaries
clean:
rm -f $(OBJS) $(OUTPUT).elf $(OUTPUT).bin $(OUTPUT).ram
scp: all
scp rt_cpu.bin root@pcbe12132:/tftpboot/rootfs/wr/lib/firmware
install: all
cp $(OUTPUT).bin ../binaries
%.o: %.c
${CC} $(CFLAGS) $(LIB_DIR) -c $^ -o $@
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment