Commit 8d72ad93 authored by Federico Vaga's avatar Federico Vaga

Merge branch 'feature/build' into develop

parents ec65f08d 988914c1
OBJS = fw-ac.o
OBJS += # add other object files that you need
OUTPUT = fw-ac
TRTL ?= ../../../../ TRTL ?= ../../../../
TRTL_SW = $(TRTL)/software TRTL_FW = $(TRTL)/software/firmware
include $(TRTL_SW)/firmware/Makefile all clean:
$(MAKE) -C $(TRTL_FW) M=$(shell /bin/pwd) $@
OBJS = fw-ac.o
OBJS += # add other object files that you need
OUTPUT = fw-ac
OBJS = fw-dg.o
OBJS += # add other object files that you need
OUTPUT = fw-dg
TRTL ?= ../../../../ TRTL ?= ../../../../
TRTL_SW = $(TRTL)/software TRTL_FW = $(TRTL)/software/firmware
include $(TRTL_SW)/firmware/Makefile all clean:
$(MAKE) -C $(TRTL_FW) M=$(shell /bin/pwd) $@
OBJS = fw-dg.o
OBJS += # add other object files that you need
OUTPUT = fw-dg
include ../../../project.mk
OBJS = fw-spec.o
OBJS += common/fw-spec-smem-code.o
OBJDIR += common
OUTPUT = fw-spec-1
TRTL ?= ../../../../../ TRTL ?= ../../../../../
TRTL_SW = $(TRTL)/software TRTL_FW = $(TRTL)/software/firmware
EXTRA_CFLAGS += -I../../include
EXTRA_CFLAGS += -I../common
EXTRA_CFLAGS += -DFPGA_APPLICATION_ID=APPLICATION_ID
EXTRA_CFLAGS += -DRT_APPLICATION_ID=$(RT_APPLICATION_ID_CPU1)
vpath %.c ../
include $(TRTL_SW)/firmware/Makefile all clean:
$(MAKE) -C $(TRTL_FW) M=$(shell /bin/pwd) $@
include $(src)/../../../project.mk
OBJS = fw-spec.o
OBJS += common/fw-spec-smem-code.o
OBJDIR += common
OUTPUT = fw-spec-1
EXTRA_CFLAGS += -I$(src)/../../include
EXTRA_CFLAGS += -I$(src)/../common
EXTRA_CFLAGS += -DFPGA_APPLICATION_ID=APPLICATION_ID
EXTRA_CFLAGS += -DRT_APPLICATION_ID=$(RT_APPLICATION_ID_CPU1)
vpath %.c $(src)../
include ../../../project.mk
OBJS = fw-spec.o
OBJS += common/fw-spec-smem-code.o
OBJDIR += common
OUTPUT = fw-spec-2
TRTL ?= ../../../../../ TRTL ?= ../../../../../
TRTL_SW = $(TRTL)/software TRTL_FW = $(TRTL)/software/firmware
EXTRA_CFLAGS += -I../../include
EXTRA_CFLAGS += -I../common
EXTRA_CFLAGS += -DFPGA_APPLICATION_ID=$(APPLICATION_ID)
EXTRA_CFLAGS += -DRT_APPLICATION_ID=$(RT_APPLICATION_ID_CPU2)
EXTRA_CFLAGS += -DLIBRT_DEBUG_VERBOSE -DLIBRT_DEBUG
vpath %.c ../
include $(TRTL_SW)/firmware/Makefile all clean:
$(MAKE) -C $(TRTL_FW) M=$(shell /bin/pwd) $@
include $(src)../../../project.mk
OBJS = fw-spec.o
OBJS += common/fw-spec-smem-code.o
OBJDIR += common
OUTPUT = fw-spec-2
EXTRA_CFLAGS += -I$(src)/../../include
EXTRA_CFLAGS += -I$(src)/../common
EXTRA_CFLAGS += -DFPGA_APPLICATION_ID=$(APPLICATION_ID)
EXTRA_CFLAGS += -DRT_APPLICATION_ID=$(RT_APPLICATION_ID_CPU2)
EXTRA_CFLAGS += -DLIBRT_DEBUG_VERBOSE -DLIBRT_DEBUG
vpath %.c $(src)/../
include ../../../project.mk
OBJS = fw-svec.o
OBJS += common/fw-svec-smem-code.o
OBJDIR += common
OUTPUT = fw-svec-1
TRTL ?= ../../../../../ TRTL ?= ../../../../../
TRTL_SW = $(TRTL)/software TRTL_FW = $(TRTL)/software/firmware
EXTRA_CFLAGS += -I../../include
EXTRA_CFLAGS += -I../common
EXTRA_CFLAGS += -DFPGA_APPLICATION_ID=APPLICATION_ID
EXTRA_CFLAGS += -DRT_APPLICATION_ID=$(RT_APPLICATION_ID_CPU1)
vpath %.c ../
include $(TRTL_SW)/firmware/Makefile all clean:
$(MAKE) -C $(TRTL_FW) M=$(shell /bin/pwd) $@
include $(src)/../../../project.mk
OBJS = fw-svec.o
OBJS += common/fw-svec-smem-code.o
OBJDIR += common
OUTPUT = fw-svec-1
EXTRA_CFLAGS += -I$(src)/../../include
EXTRA_CFLAGS += -I$(src)/../common
EXTRA_CFLAGS += -DFPGA_APPLICATION_ID=APPLICATION_ID
EXTRA_CFLAGS += -DRT_APPLICATION_ID=$(RT_APPLICATION_ID_CPU1)
vpath %.c $(src)/../
include ../../../project.mk
OBJS = fw-svec.o
OBJS += common/fw-svec-smem-code.o
OBJDIR += common
OUTPUT = fw-svec-2
TRTL ?= ../../../../../ TRTL ?= ../../../../../
TRTL_SW = $(TRTL)/software TRTL_FW = $(TRTL)/software/firmware
EXTRA_CFLAGS += -I../../include
EXTRA_CFLAGS += -I../common
EXTRA_CFLAGS += -DFPGA_APPLICATION_ID=$(APPLICATION_ID)
EXTRA_CFLAGS += -DRT_APPLICATION_ID=$(RT_APPLICATION_ID_CPU2)
EXTRA_CFLAGS += -DLIBRT_DEBUG_VERBOSE -DLIBRT_DEBUG
vpath %.c ../
include $(TRTL_SW)/firmware/Makefile all clean:
$(MAKE) -C $(TRTL_FW) M=$(shell /bin/pwd) $@
include $(src)/../../../project.mk
OBJS = fw-svec.o
OBJS += common/fw-svec-smem-code.o
OBJDIR += common
OUTPUT = fw-svec-2
EXTRA_CFLAGS += -I$(src)/../../include
EXTRA_CFLAGS += -I$(src)/../common
EXTRA_CFLAGS += -DFPGA_APPLICATION_ID=$(APPLICATION_ID)
EXTRA_CFLAGS += -DRT_APPLICATION_ID=$(RT_APPLICATION_ID_CPU2)
EXTRA_CFLAGS += -DLIBRT_DEBUG_VERBOSE -DLIBRT_DEBUG
vpath %.c $(src)/../
OBJS = fw-hello.o
OBJS += # add other object files that you need
OUTPUT = fw-hello
TRTL ?= ../../../../ TRTL ?= ../../../../
TRTL_SW = $(TRTL)/software TRTL_FW = $(TRTL)/software/firmware
include $(TRTL_SW)/firmware/Makefile all clean:
$(MAKE) -C $(TRTL_FW) M=$(shell /bin/pwd) $@
OBJS = fw-hello.o
OBJS += # add other object files that you need
OUTPUT = fw-hello
OBJS = fw-hellofrm.o
OBJS += # add other object files that you need
OUTPUT = fw-hellofrm
TRTL ?= ../../../../ TRTL ?= ../../../../
TRTL_SW = $(TRTL)/software TRTL_FW = $(TRTL)/software/firmware
include $(TRTL_SW)/firmware/Makefile all clean:
$(MAKE) -C $(TRTL_FW) M=$(shell /bin/pwd) $@
OBJS = fw-hellofrm.o
OBJS += # add other object files that you need
OUTPUT = fw-hellofrm
...@@ -43,11 +43,10 @@ memory) or you need much better performances: don't use this framework. ...@@ -43,11 +43,10 @@ memory) or you need much better performances: don't use this framework.
All the Mock Turtle firmware source code can be found in the directory All the Mock Turtle firmware source code can be found in the directory
``/path/to/mockturtle/software/firmware/``. ``/path/to/mockturtle/software/firmware/``.
Mock Turtle has a generic ``Makefile`` that you should include in your Mock Turtle has a generic building system which can be used to produce
``Makefile`` in order to import all the Mock Turtle building rules.:: Mock Turtle firmware applications. What you have to do is to prepare a
file named ``TBuild`` next to your firmware source files. In this file
TRTL ?= /path/to/mcokturtle/ you have to specify what to build, for example::
TRTL_SW = $(TRTL)/software
# Mandatory # Mandatory
OBJS = source1.o OBJS = source1.o
...@@ -56,15 +55,10 @@ Mock Turtle has a generic ``Makefile`` that you should include in your ...@@ -56,15 +55,10 @@ Mock Turtle has a generic ``Makefile`` that you should include in your
OUTPUT = firmware-name OUTPUT = firmware-name
# Optional (prefer default when possible) # Optional (prefer default when possible)
CFLAGS_OPT := -O1 EXTRA_CFLAGS :=
CFLAGS_DBG := -ggdb
EXTRA_CFLGAS :=
MOCKTURTLE_LDSCRIPT := myfirmware.ld MOCKTURTLE_LDSCRIPT := myfirmware.ld
# INCLUDE GENERIC Makefile Here the list of supported TBuild variables
include $(TRTL_SW)/firmware/Makefile
Here the list of supported Makefile environment variables
OBJS OBJS
(Mandatory) List of object files to generate from sources with (Mandatory) List of object files to generate from sources with
...@@ -74,10 +68,30 @@ OBJS ...@@ -74,10 +68,30 @@ OBJS
OUTPUT OUTPUT
(Mandatory) Final binary name (the firmware). (Mandatory) Final binary name (the firmware).
EXTRA_CFLAGS
(Optional) Additional compiler options.
MOCKTURTLE_LDSCRIPT MOCKTURTLE_LDSCRIPT
(Optional ) Local path to the linker script. (Optional) Local path to the linker script.
The default is the standard Mock Turtle linker script. The default is the standard Mock Turtle linker script.
You can build such firmware application by calling ``make`` from the
application directory (where the ``TBuild`` file is) like this::
make -C <path-to-mockturtle-project>/software/firmware M=$PWD
Or alternatively, you can copy the following lines in a Makefile::
TRTL_FW = $(TRTL)/software/firmware
all clean:
$(MAKE) -C $(TRTL_FW) M=$(shell /bin/pwd) $@
Then, you will compile your application with the following command
from the application directory (where the ``TBuild`` file is)::
make TRTL=<path-to-mockturtle-project>
Memory resources on Mock Turtle are very limited and the full framework Memory resources on Mock Turtle are very limited and the full framework
may take more space than needed. For this reason Mock Turtle has may take more space than needed. For this reason Mock Turtle has
*Kconfig* support which allows you to interactivly enable/disable both *Kconfig* support which allows you to interactivly enable/disable both
......
-include Makefile.specific src := $(M)/
-include $(CURDIR)/.config
-include $(src)/Makefile.specific
-include $(src)/.config
include $(src)/TBuild
# Validation
ifndef OUTPUT
$(error Missing variable OUTPUT)
else
build_output=$(src)/$(OUTPUT)
endif
ifndef OBJS
$(error Missing variable OBJS)
endif
# and don't touch the rest unless you know what you're doing. # and don't touch the rest unless you know what you're doing.
INSTALL_PREFIX ?= . INSTALL_PREFIX ?= .
...@@ -7,11 +22,12 @@ PATH_COMMON_RT ?= . ...@@ -7,11 +22,12 @@ PATH_COMMON_RT ?= .
PATH_COMMON_H ?= ../include PATH_COMMON_H ?= ../include
TRTL ?= ../../ TRTL ?= ../../
TRTL_SW ?= $(TRTL)/software TRTL_SW ?= $(TRTL)/software
TRTL_FW ?= $(TRTL_SW)/firmware
TRTL_HDL ?= $(TRTL)/hdl/rtl TRTL_HDL ?= $(TRTL)/hdl/rtl
RT_GIT_VERSION = 0x$(shell git rev-parse --short=8 HEAD || echo "0") # empty if git is not there RT_GIT_VERSION = 0x$(shell git rev-parse --short=8 HEAD || echo "0") # empty if git is not there
# header file generated from the .config # header file generated from the .config
AUTOCONF = $(CURDIR)/$(BUILDDIR)/include/generated/autoconf.h AUTOCONF = $(src)/$(BUILDDIR)/include/generated/autoconf.h
CROSS_COMPILE_TARGET ?= riscv32-elf- CROSS_COMPILE_TARGET ?= riscv32-elf-
# FIXME the mult/div is broken, for the time being remove it completely # FIXME the mult/div is broken, for the time being remove it completely
...@@ -21,10 +37,12 @@ CFLAGS += -mabi=ilp32 -march=rv32im -ffunction-sections -fdata-sections ...@@ -21,10 +37,12 @@ CFLAGS += -mabi=ilp32 -march=rv32im -ffunction-sections -fdata-sections
LDFLAGS += -lgcc -lc -Wl,--gc-sections LDFLAGS += -lgcc -lc -Wl,--gc-sections
# provide search patch for sources # provide search patch for sources
vpath %.c $(TRTL)/software/firmware vpath %.c $(TRTL_FW)
vpath %.S $(TRTL)/software/firmware vpath %.S $(TRTL_FW)
vpath %.c $(src)
vpath %.S $(src)
BUILDDIR := build BUILDDIR := $(src)/build
# auto dependency generation from # auto dependency generation from
# http://make.mad-scientist.net/papers/advanced-auto-dependency-generation/ # http://make.mad-scientist.net/papers/advanced-auto-dependency-generation/
...@@ -42,10 +60,10 @@ STRIP = $(CROSS_COMPILE_TARGET)strip ...@@ -42,10 +60,10 @@ STRIP = $(CROSS_COMPILE_TARGET)strip
CFLAGS += -Wall -D__TRTL_FIRMWARE__ -DARCH=urv CFLAGS += -Wall -D__TRTL_FIRMWARE__ -DARCH=urv
CFLAGS += -I. CFLAGS += -I.
CFLAGS += -I$(BUILDDIR)/include CFLAGS += -I$(BUILDDIR)/include
CFLAGS += -I$(TRTL)/software/firmware CFLAGS += -I$(TRTL_FW)
CFLAGS += -I$(TRTL)/software/firmware/lib CFLAGS += -I$(TRTL_FW)/lib
CFLAGS += -I$(TRTL)/software/firmware/framework CFLAGS += -I$(TRTL_FW)/framework
CFLAGS += -I$(TRTL)/software/include CFLAGS += -I$(TRTL_SW)/include
CFLAGS += -DGIT_VERSION=$(RT_GIT_VERSION) CFLAGS += -DGIT_VERSION=$(RT_GIT_VERSION)
# used for firmware by trtl-project-creator # used for firmware by trtl-project-creator
...@@ -76,11 +94,11 @@ OBJS_BUILD = $(addprefix $(BUILDDIR)/, $(OBJS)) ...@@ -76,11 +94,11 @@ OBJS_BUILD = $(addprefix $(BUILDDIR)/, $(OBJS))
OBJDIR_BUILD = $(addprefix $(BUILDDIR)/, $(OBJDIR)) OBJDIR_BUILD = $(addprefix $(BUILDDIR)/, $(OBJDIR))
OBJDIR_BUILD += $(BUILDDIR) OBJDIR_BUILD += $(BUILDDIR)
MOCKTURTLE_LDSCRIPT ?= $(TRTL)/software/firmware/urv/mockturtle.ld MOCKTURTLE_LDSCRIPT ?= $(TRTL_FW)/urv/mockturtle.ld
.PHONY: all clean cleanall check-def .PHONY: all clean cleanall
all: $(OUTPUT).bin all: $(build_output).bin
WBGEN_FILES = mt_cpu_csr.wb mt_cpu_lr.wb WBGEN_FILES = mt_cpu_csr.wb mt_cpu_lr.wb
WBGEN_HEADERS = mockturtle_cpu_csr.h mockturtle_cpu_lr.h WBGEN_HEADERS = mockturtle_cpu_csr.h mockturtle_cpu_lr.h
...@@ -93,16 +111,9 @@ $(TRTL_SW)/include/hw/mockturtle_cpu_csr.h: $(TRTL_HDL)/cpu/mt_cpu_csr.wb ...@@ -93,16 +111,9 @@ $(TRTL_SW)/include/hw/mockturtle_cpu_csr.h: $(TRTL_HDL)/cpu/mt_cpu_csr.wb
$(TRTL_SW)/include/hw/mockturtle_cpu_lr.h: $(TRTL_HDL)/cpu/mt_cpu_lr.wb $(TRTL_SW)/include/hw/mockturtle_cpu_lr.h: $(TRTL_HDL)/cpu/mt_cpu_lr.wb
# target to let wbgen2 to generate headers # target to let wbgen2 to generate headers
$(addprefix $(TRTL_SW)/include/hw/,$(WBGEN_HEADERS)): | check-def $(addprefix $(TRTL_SW)/include/hw/,$(WBGEN_HEADERS)):
make -C $(TRTL_SW) headers make -C $(TRTL_SW) headers
# check needed env variables
check-def:
ifndef OUTPUT
@echo "OUTPUT variable is mandatory"
@exit 1
endif
# create dirs for object files # create dirs for object files
$(OBJDIR_BUILD): $(OBJDIR_BUILD):
mkdir -p $@ mkdir -p $@
...@@ -112,12 +123,13 @@ $(OBJDIR_BUILD): ...@@ -112,12 +123,13 @@ $(OBJDIR_BUILD):
$(OBJS_BUILD): | $(AUTOCONF) $(OBJS_BUILD): | $(AUTOCONF)
$(OBJS_BUILD): | $(OBJDIR_BUILD) $(OBJS_BUILD): | $(OBJDIR_BUILD)
$(OUTPUT).elf: $(addprefix $(TRTL_SW)/include/hw/,$(WBGEN_HEADERS)) $(MOCKTURTLE_LDSCRIPT) $(OBJS_BUILD) | check-def $(build_output).elf: $(addprefix $(TRTL_SW)/include/hw/,$(WBGEN_HEADERS)) $(MOCKTURTLE_LDSCRIPT) $(OBJS_BUILD)
${CC} $(CFLAGS) $(LDFLAGS) -o $(OUTPUT).elf -nostartfiles $(OBJS_BUILD) -T $(MOCKTURTLE_LDSCRIPT) $(warning $(OBJS_BUILD))
${CC} $(CFLAGS) $(LDFLAGS) -o $(build_output).elf -nostartfiles $(OBJS_BUILD) -T $(MOCKTURTLE_LDSCRIPT)
$(OUTPUT).bin: $(OUTPUT).elf | check-def $(build_output).bin: $(build_output).elf
${OBJCOPY} --remove-section .smem -O binary $(OUTPUT).elf $(OUTPUT).bin ${OBJCOPY} --remove-section .smem -O binary $(build_output).elf $(build_output).bin
$(SIZE) $(OUTPUT).elf $(SIZE) $(build_output).elf
$(BUILDDIR)/urv/emulate.o: urv/emulate.c $(BUILDDIR)/urv/emulate.o: urv/emulate.c
${CC} $(DEPFLAGS) $(CFLAGS) -march=rv32i -c $< -o $@ ${CC} $(DEPFLAGS) $(CFLAGS) -march=rv32i -c $< -o $@
...@@ -126,13 +138,15 @@ $(BUILDDIR)/urv/emulate.o: urv/emulate.c ...@@ -126,13 +138,15 @@ $(BUILDDIR)/urv/emulate.o: urv/emulate.c
$(BUILDDIR)/%.o: %.c $(BUILDDIR)/%.o: %.c
${CC} $(DEPFLAGS) $(CFLAGS) $(LDFLAGS) -c $< -o $@ ${CC} $(DEPFLAGS) $(CFLAGS) $(LDFLAGS) -c $< -o $@
$(POSTCOMPILE) $(POSTCOMPILE)
$(warning $< ---- $@)
@echo ""
$(BUILDDIR)/%.o: %.S $(BUILDDIR)/%.o: %.S
${CC} $(DEPFLAGS) $(CFLAGS) $(LDFLAGS) -c $< -o $@ ${CC} $(DEPFLAGS) $(CFLAGS) $(LDFLAGS) -c $< -o $@
$(POSTCOMPILE) $(POSTCOMPILE)
clean: clean:
rm -f $(OUTPUT).bin $(OUTPUT).elf rm -f $(build_output).bin $(build_output).elf
rm -rf $(BUILDDIR) rm -rf $(BUILDDIR)
clean-dot-config: clean-dot-config:
...@@ -141,7 +155,7 @@ clean-dot-config: ...@@ -141,7 +155,7 @@ clean-dot-config:
cleanall: clean clean-dot-config cleanall: clean clean-dot-config
install: install:
@cp $(OUTPUT).bin $(INSTALL_PREFIX) @cp $(build_output).bin $(INSTALL_PREFIX)
# inlude *.d files from the build directory # inlude *.d files from the build directory
include $(wildcard $(patsubst %,%/.d/*.d,$(basename $(OBJDIR_BUILD)))) include $(wildcard $(patsubst %,%/.d/*.d,$(basename $(OBJDIR_BUILD))))
...@@ -150,20 +164,20 @@ include $(wildcard $(patsubst %,%/.d/*.d,$(basename $(OBJDIR_BUILD)))) ...@@ -150,20 +164,20 @@ include $(wildcard $(patsubst %,%/.d/*.d,$(basename $(OBJDIR_BUILD))))
# following targets from Makefile.kconfig # following targets from Makefile.kconfig
# this one is used to generate autoconf.h file # this one is used to generate autoconf.h file
$(AUTOCONF) silentoldconfig: .config | $(BUILDDIR) $(AUTOCONF) silentoldconfig: .config | $(BUILDDIR)
export KCONFIG_CONFIG=$(CURDIR)/.config; \ export KCONFIG_CONFIG=$(src)/.config; \
$(MAKE) quiet=quiet_ KBUILD_KCONFIG=$(CURDIR)/Kconfig projtree=$(CURDIR)/$(BUILDDIR) -C $(TRTL)/software/firmware -f Makefile.kconfig silentoldconfig $(MAKE) quiet=quiet_ KBUILD_KCONFIG=$(src)/Kconfig projtree=$(BUILDDIR) -C $(TRTL_FW) -f Makefile.kconfig silentoldconfig
scripts_basic config: scripts_basic config:
$(MAKE) quiet=quiet_ KBUILD_KCONFIG=$(CURDIR)/Kconfig projtree=$(CURDIR) -C $(TRTL)/software/firmware -f Makefile.kconfig $@ $(MAKE) quiet=quiet_ KBUILD_KCONFIG=$(src)/Kconfig projtree=$(src) -C $(TRTL_FW) -f Makefile.kconfig $@
%config: %config:
$(MAKE) quiet=quiet_ KBUILD_KCONFIG=$(CURDIR)/Kconfig projtree=$(CURDIR) -C $(TRTL)/software/firmware -f Makefile.kconfig $@ $(MAKE) quiet=quiet_ KBUILD_KCONFIG=$(src)/Kconfig projtree=$(src) -C $(TRTL_FW) -f Makefile.kconfig $@
defconfig: defconfig:
$(MAKE) quiet=quiet_ KBUILD_KCONFIG=$(CURDIR)/Kconfig projtree=$(CURDIR) -C $(TRTL)/software/firmware -f Makefile.kconfig mt_defconfig $(MAKE) quiet=quiet_ KBUILD_KCONFIG=$(src)/Kconfig projtree=$(src) -C $(TRTL_FW) -f Makefile.kconfig mt_defconfig
.config: ; .config: ;
# Explicit rule for .config # Explicit rule for .config
# needed since -include XXX triggers build for XXX # needed since -include XXX triggers build for XXX
$(CURDIR)/.config: ; $(src)/.config: ;
HEADERS := mockturtle_cpu_csr.h HEADERS := mockturtle_cpu_csr.h
HEADERS += mockturtle_cpu_lr.h HEADERS += mockturtle_cpu_lr.h
TRTL = ../../.. TRTL ?= ../../..
TRTL_HDL = $(TRTL)/hdl/rtl/ TRTL_HDL = $(TRTL)/hdl/rtl/
WBGEN2 ?= wbgen2 WBGEN2 ?= wbgen2
......
...@@ -8,7 +8,8 @@ REPO_PARENT ?= ../.. ...@@ -8,7 +8,8 @@ REPO_PARENT ?= ../..
-include $(REPO_PARENT)/parent_common.mk -include $(REPO_PARENT)/parent_common.mk
TRTL ?= ../ TRTL ?= ../../
TRTL_SW = $(TRTL)/software
LIBS = libmockturtle.so LIBS = libmockturtle.so
LIB = libmockturtle.a LIB = libmockturtle.a
...@@ -16,7 +17,7 @@ LOBJ := libmockturtle.o ...@@ -16,7 +17,7 @@ LOBJ := libmockturtle.o
LOBJ += libmockturtle-rt-msg.o LOBJ += libmockturtle-rt-msg.o
CFLAGS += -Wall -Werror -ggdb -fPIC CFLAGS += -Wall -Werror -ggdb -fPIC
CFLAGS += -I. -I$(TRTL)/include $(EXTRACFLAGS) CFLAGS += -I. -I$(TRTL_SW)/include $(EXTRACFLAGS)
LDFLAGS = -L. -lmockturtle LDFLAGS = -L. -lmockturtle
ARFLAGS = rc ARFLAGS = rc
......
...@@ -8,14 +8,15 @@ REPO_PARENT ?= ../.. ...@@ -8,14 +8,15 @@ REPO_PARENT ?= ../..
-include $(REPO_PARENT)/parent_common.mk -include $(REPO_PARENT)/parent_common.mk
DESTDIR ?= /usr/local DESTDIR ?= /usr/local
TRTL ?= ../ TRTL ?= ../../
TRTL_SW = $(TRTL)/software
GIT_VERSION := $(shell git describe --dirty --long --tags) GIT_VERSION := $(shell git describe --dirty --long --tags)
CFLAGS += -Wall -Werror -ggdb -I$(TRTL)/lib CFLAGS += -Wall -Werror -ggdb -I$(TRTL_SW)/lib
CFLAGS += -I$(TRTL)/include CFLAGS += -I$(TRTL_SW)/include
CFLAGS += $(EXTRACFLAGS) CFLAGS += $(EXTRACFLAGS)
LDLIBS += -Wl,-Bstatic -L$(TRTL)/lib -lmockturtle LDLIBS += -Wl,-Bstatic -L$(TRTL_SW)/lib -lmockturtle
LDLIBS += -Wl,-Bdynamic -lpthread LDLIBS += -Wl,-Bdynamic -lpthread
PROGS := mockturtle-count PROGS := mockturtle-count
PROGS += lsmockturtle PROGS += lsmockturtle
...@@ -33,7 +34,7 @@ install: ...@@ -33,7 +34,7 @@ install:
install -d $(DESTDIR)/bin install -d $(DESTDIR)/bin
install -D $(PROGS) $(DESTDIR)/bin install -D $(PROGS) $(DESTDIR)/bin
%: %.c $(TRTL)/libmockturtle.a %: %.c $(TRTL_SW)/lib/libmockturtle.a
$(CC) $(CFLAGS) $^ -o $@ $(LDLIBS) $(CC) $(CFLAGS) $^ -o $@ $(LDLIBS)
# make nothing for modules_install, but avoid errors # make nothing for modules_install, but avoid errors
......
OBJS = config_rom.o
OBJS += # add other object files that you need
OUTPUT = fw-config-rom
TRTL ?= ../../../ TRTL ?= ../../../
TRTL_SW = $(TRTL)/software TRTL_FW = $(TRTL)/software/firmware
include $(TRTL_SW)/firmware/Makefile all clean:
$(MAKE) -C $(TRTL_FW) M=$(shell /bin/pwd) $@
OBJS = config_rom.o
OBJS += # add other object files that you need
OUTPUT = fw-config-rom
OBJS = byte-addressing.o
OBJS += # add other object files that you need
OUTPUT = fw-byte-addressing
TRTL ?= ../../../ TRTL ?= ../../../
TRTL_SW = $(TRTL)/software TRTL_FW = $(TRTL)/software/firmware
include $(TRTL_SW)/firmware/Makefile all clean:
$(MAKE) -C $(TRTL_FW) M=$(shell /bin/pwd) $@
OBJS = byte-addressing.o
OBJS += # add other object files that you need
OUTPUT = fw-byte-addressing
OBJS = cpu-loop.o
OBJS += # add other object files that you need
OUTPUT = fw-loop
TRTL ?= ../../../ TRTL ?= ../../../
TRTL_SW = $(TRTL)/software TRTL_FW = $(TRTL)/software/firmware
include $(TRTL_SW)/firmware/Makefile all clean:
$(MAKE) -C $(TRTL_FW) M=$(shell /bin/pwd) $@
OBJS = cpu-loop.o
OBJS += # add other object files that you need
OUTPUT = fw-loop
OBJS = notify.o
OBJS += # add other object files that you need
OUTPUT = fw-notify
TRTL ?= ../../../ TRTL ?= ../../../
TRTL_SW = $(TRTL)/software TRTL_FW = $(TRTL)/software/firmware
include $(TRTL_SW)/firmware/Makefile all clean:
$(MAKE) -C $(TRTL_FW) M=$(shell /bin/pwd) $@
OBJS = notify.o
OBJS += # add other object files that you need
OUTPUT = fw-notify
OBJS = hmq-async-recv.o
OBJS += # add other object files that you need
OUTPUT = fw-hmq-async-recv
TRTL ?= ../../../ TRTL ?= ../../../
TRTL_SW = $(TRTL)/software TRTL_FW = $(TRTL)/software/firmware
include $(TRTL_SW)/firmware/Makefile all clean:
$(MAKE) -C $(TRTL_FW) M=$(shell /bin/pwd) $@
OBJS = hmq-async-recv.o
OBJS += # add other object files that you need
OUTPUT = fw-hmq-async-recv
OBJS = hmq-async-send.o
OBJS += # add other object files that you need
OUTPUT = fw-hmq-async-send
TRTL ?= ../../../ TRTL ?= ../../../
TRTL_SW = $(TRTL)/software TRTL_FW = $(TRTL)/software/firmware
include $(TRTL_SW)/firmware/Makefile all clean:
$(MAKE) -C $(TRTL_FW) M=$(shell /bin/pwd) $@
OBJS = hmq-async-send.o
OBJS += # add other object files that you need
OUTPUT = fw-hmq-async-send
OBJS = hmq-purge.o
OBJS += # add other object files that you need
OUTPUT = fw-hmq-purge
TRTL ?= ../../../ TRTL ?= ../../../
TRTL_SW = $(TRTL)/software TRTL_FW = $(TRTL)/software/firmware
include $(TRTL_SW)/firmware/Makefile all clean:
$(MAKE) -C $(TRTL_FW) M=$(shell /bin/pwd) $@
OBJS = hmq-purge.o
OBJS += # add other object files that you need
OUTPUT = fw-hmq-purge
-include ../Makefile.specific
OBJS = rmq-udp-send.o
OBJS += # add other object files that you need
OUTPUT = fw-rmq-udp-send
TRTL ?= ../../../ TRTL ?= ../../../
TRTL_SW = $(TRTL)/software TRTL_FW = $(TRTL)/software/firmware
CFLAGS_OPT = -O0 # disable optimization
include $(TRTL_SW)/firmware/Makefile all clean:
$(MAKE) -C $(TRTL_FW) M=$(shell /bin/pwd) $@
OBJS = rmq-udp-send.o
OBJS += # add other object files that you need
OUTPUT = fw-rmq-udp-send
CFLAGS_OPT = -O0 # disable optimization
OBJS = rt-frm.o
OBJS += # add other object files that you need
OUTPUT = fw-rt-frm
TRTL ?= ../../../ TRTL ?= ../../../
TRTL_SW = $(TRTL)/software TRTL_FW = $(TRTL)/software/firmware
include $(TRTL_SW)/firmware/Makefile all clean:
$(MAKE) -C $(TRTL_FW) M=$(shell /bin/pwd) $@
OBJS = rt-frm.o
OBJS += # add other object files that you need
OUTPUT = fw-rt-frm
-include ../Makefile.specific
OBJS = serial.o
OBJS += # add other object files that you need
OUTPUT = fw-serial
TRTL ?= ../../../ TRTL ?= ../../../
TRTL_SW = $(TRTL)/software TRTL_FW = $(TRTL)/software/firmware
include $(TRTL_SW)/firmware/Makefile all clean:
$(MAKE) -C $(TRTL_FW) M=$(shell /bin/pwd) $@
OBJS = serial.o
OBJS += # add other object files that you need
OUTPUT = fw-serial
OBJS = sim-verif.o
OBJS += # add other object files that you need
OUTPUT = sim-verif
TRTL ?= ../../../ TRTL ?= ../../../
TRTL_SW = $(TRTL)/software TRTL_FW = $(TRTL)/software/firmware
include $(TRTL_SW)/firmware/Makefile all clean:
$(MAKE) -C $(TRTL_FW) M=$(shell /bin/pwd) $@
OBJS = sim-verif.o
OBJS += # add other object files that you need
OUTPUT = sim-verif
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