Commit 3df09806 authored by Tomasz Wlostowski's avatar Tomasz Wlostowski Committed by Alessandro Rubini

Makefile updates to improve gateware installation and submodule checkouts.

- added gateware_install target, which automatically downloads and installs the FPGA gatewares
- improved submodule support. Now it looks for dependent submodules in the user-supplied path,
in the parent directory (a "super-module" repo) and if still not found, checks out local submodule copy.
parent 46d05c91
FMC_BUS := $(shell scripts/check-submodule fmc-bus $(FMC_BUS))
ZIO := $(shell scripts/check-submodule zio $(ZIO))
SPEC_SW := $(shell scripts/check-submodule spec-sw $(SPEC_SW))
.PHONY: all clean modules install modules_install
.PHONY: all clean modules install modules_install default
.PHONY: gitmodules prereq prereq_install prereq_install_warn
DIRS = kernel lib tools
all clean modules install modules_install: gitmodules
all clean modules install modules_install:
@if echo $@ | grep -q install; then $(MAKE) prereq_install_warn; fi
for d in $(DIRS); do $(MAKE) -C $$d $@ || exit 1; done
for d in $(DIRS); do $(MAKE) ZIO=$(ZIO) FMC_BUS=$(FMC_BUS) -C $$d $@ || exit 1; done
all modules: prereq
......@@ -15,15 +18,8 @@ CONFIG_WR_NIC=n
export CONFIG_WR_NIC
#### The following targets are used to manage prerequisite repositories
gitmodules:
@test -d fmc-bus/doc || echo "Checking out submodules"
@test -d fmc-bus/doc || git submodule update --init
@git submodule update
# The user can override, using environment variables, all these three:
FMC_BUS ?= fmc-bus
ZIO ?= zio
SPEC_SW ?= spec-sw
SUBMOD = $(FMC_BUS) $(ZIO) $(SPEC_SW)
prereq:
......@@ -36,3 +32,5 @@ prereq_install_warn:
prereq_install:
for d in $(SUBMOD); do $(MAKE) -C $$d modules_install || exit 1; done
touch .prereq_installed
include scripts/gateware.mk
LINUX ?= /lib/modules/$(shell uname -r)/build
ZIO ?= $(M)/../zio
FMC_BUS ?= $(M)/../fmc-bus
......
......@@ -6,7 +6,7 @@ LOBJ += fdelay-time.o
LOBJ += fdelay-tdc.o
LOBJ += fdelay-output.o
CFLAGS = -Wall -ggdb -O2 -I../kernel -I../zio/include
CFLAGS = -Wall -ggdb -O2 -I../kernel -I$(ZIO)/include
LDFLAGS = -L. -lfdelay
DEMOSRC :=
......
#!/bin/bash
repo_name=$1
repo_path=$2
if [ "$repo_path" != "" ]; then
echo "Using user-supplied submodule path for $repo_name [$repo_path]" 1>&2
path=$repo_path
elif [ -d "../$repo_name" ]; then
echo "Using Git repo in parent directory for $repo_name [../$repo_name]" 1>&2
path="../$repo_name"
else
echo "Using local submodule checkout for $repo_name" 1>&2
git submodule update --init $repo_name 1>&2
path=$repo_name
fi
echo `readlink -f $path`
\ No newline at end of file
GW_SPEC = spec-fine-delay-v2.0rc1-20140319.bin
GW_SVEC = svec-fine-delay-v2.0rc1-20140319.bin
GW_URL_SPEC = http://www.ohwr.org/attachments/download/2746/$(GW_SPEC)
GW_URL_SVEC = http://www.ohwr.org/attachments/download/2747/$(GW_SVEC)
FIRMWARE_PATH ?= /lib/firmware/fmc
gateware_install: bin/$(GW_SPEC) bin/$(GW_SVEC)
install -D bin/$(GW_SPEC) $(FIRMWARE_PATH)/$(GW_SPEC)
install -D bin/$(GW_SVEC) $(FIRMWARE_PATH)/$(GW_SVEC)
ln -sf $(GW_SPEC) $(FIRMWARE_PATH)/spec-fine-delay.bin
ln -sf $(GW_SVEC) $(FIRMWARE_PATH)/svec-fine-delay.bin
bin/$(GW_SPEC):
wget $(GW_URL_SPEC) -P bin
bin/$(GW_SVEC):
wget $(GW_URL_SVEC) -P bin
......@@ -2,7 +2,7 @@
M = $(shell /bin/pwd)/../kernel
HOST_EXTRACFLAGS += -I$(M) -I../lib -I../zio/include -Wno-trigraphs -Wall -ggdb
HOST_EXTRACFLAGS += -I$(M) -I../lib -I$(ZIO)/include -Wno-trigraphs -Wall -ggdb
HOSTCC ?= gcc
......
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