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

Merge branch 'feature/build-improve' into develop

parents f5aac683 594ff1de
[submodule "zio"]
path = zio
url = git://ohwr.org/misc/zio.git
......@@ -5,32 +5,18 @@ REPO_PARENT ?= $(shell /bin/pwd)/..
all: kernel lib tools
# The user can override, using environment variables, all these three:
ZIO ?= zio
# ZIO_ABS has to be absolut path, due to beeing
# passed to the Kbuild
ZIO_ABS ?= $(abspath $(ZIO) )
export ZIO_ABS
ZIO_VERSION = $(shell cd $(ZIO_ABS); git describe --always --dirty --long --tags)
export ZIO_VERSION
DIRS = $(ZIO_ABS) kernel lib tools
DIRS = kernel lib tools
$(SPEC_SW_ABS):
kernel: $(ZIO_ABS)
lib: $(ZIO_ABS)
kernel:
lib:
tools: lib
DESTDIR ?= /usr/local
.PHONY: all clean modules install modules_install $(DIRS)
.PHONY: gitmodules prereq_install prereq_install_warn
install modules_install: prereq_install_warn
install modules_install:
all clean modules install modules_install: $(DIRS)
......@@ -42,22 +28,3 @@ modules_install: TARGET = modules_install
$(DIRS):
$(MAKE) -C $@ $(TARGET)
SUBMOD = $(ZIO_ABS)
prereq_install_warn:
@test -f .prereq_installed || \
echo -e "\n\n\tWARNING: Consider \"make prereq_install\"\n"
prereq_install:
for d in $(SUBMOD); do $(MAKE) -C $$d modules_install || exit 1; done
touch .prereq_installed
$(ZIO_ABS): zio-init_repo
# init submodule if missing
zio-init_repo:
@test -d $(ZIO_ABS)/doc || ( echo "Checking out submodule $(ZIO_ABS)" && git submodule update --init $(ZIO_ABS) )
include scripts/gateware.mk
......@@ -35,7 +35,7 @@ CPPCHECK ?= cppcheck
all modules: $(progs) fmc-fdelay-calibration
clean:
rm -f $(progs) *.o *~
rm -f $(progs) fmc-fdelay-calibration *.o *~
COMMON_SRCS = tools-util.c
......@@ -48,6 +48,7 @@ modules_install:
install:
install -d $(DESTDIR)/bin
install -D fmc-fdelay-calibration $(DESTDIR)/bin
install -D $(progs) $(DESTDIR)/bin
cppcheck:
......
......@@ -18,6 +18,8 @@
#include <fine-delay.h>
char git_version[] = "git version: " GIT_VERSION;
static const char program_name[] = "fau-calibration";
static char options[] = "hf:o:D:b";
static const char help_msg[] =
......@@ -34,6 +36,7 @@ static const char help_msg[] =
"General options:\n"
"-h Print this message\n"
"-b Show Calibration in binary form \n"
"-V Show tool version \n"
"\n"
"Read options:\n"
"-f Source file where to read calibration data from\n"
......@@ -42,6 +45,11 @@ static const char help_msg[] =
"-D FMC FDelay Target Device ID\n"
"\n";
static inline void fmc_fdelay_calibration_version(void)
{
printf("git_version: %s\n", git_version);
}
/**
* Read calibration data from file
* @path: file path
......@@ -185,6 +193,9 @@ int main(int argc, char *argv[])
case 'b':
show_bin = 1;
break;
case 'V':
fmc_fdelay_calibration_version();
exit(EXIT_SUCCESS);
}
}
......
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