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)/.. ...@@ -5,32 +5,18 @@ REPO_PARENT ?= $(shell /bin/pwd)/..
all: kernel lib tools all: kernel lib tools
# The user can override, using environment variables, all these three: DIRS = kernel lib tools
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
$(SPEC_SW_ABS): $(SPEC_SW_ABS):
kernel: $(ZIO_ABS) kernel:
lib: $(ZIO_ABS) lib:
tools: lib tools: lib
DESTDIR ?= /usr/local DESTDIR ?= /usr/local
.PHONY: all clean modules install modules_install $(DIRS) .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) all clean modules install modules_install: $(DIRS)
...@@ -42,22 +28,3 @@ modules_install: TARGET = modules_install ...@@ -42,22 +28,3 @@ modules_install: TARGET = modules_install
$(DIRS): $(DIRS):
$(MAKE) -C $@ $(TARGET) $(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 ...@@ -35,7 +35,7 @@ CPPCHECK ?= cppcheck
all modules: $(progs) fmc-fdelay-calibration all modules: $(progs) fmc-fdelay-calibration
clean: clean:
rm -f $(progs) *.o *~ rm -f $(progs) fmc-fdelay-calibration *.o *~
COMMON_SRCS = tools-util.c COMMON_SRCS = tools-util.c
...@@ -48,6 +48,7 @@ modules_install: ...@@ -48,6 +48,7 @@ modules_install:
install: install:
install -d $(DESTDIR)/bin install -d $(DESTDIR)/bin
install -D fmc-fdelay-calibration $(DESTDIR)/bin
install -D $(progs) $(DESTDIR)/bin install -D $(progs) $(DESTDIR)/bin
cppcheck: cppcheck:
......
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
#include <fine-delay.h> #include <fine-delay.h>
char git_version[] = "git version: " GIT_VERSION;
static const char program_name[] = "fau-calibration"; static const char program_name[] = "fau-calibration";
static char options[] = "hf:o:D:b"; static char options[] = "hf:o:D:b";
static const char help_msg[] = static const char help_msg[] =
...@@ -34,6 +36,7 @@ static const char help_msg[] = ...@@ -34,6 +36,7 @@ static const char help_msg[] =
"General options:\n" "General options:\n"
"-h Print this message\n" "-h Print this message\n"
"-b Show Calibration in binary form \n" "-b Show Calibration in binary form \n"
"-V Show tool version \n"
"\n" "\n"
"Read options:\n" "Read options:\n"
"-f Source file where to read calibration data from\n" "-f Source file where to read calibration data from\n"
...@@ -42,6 +45,11 @@ static const char help_msg[] = ...@@ -42,6 +45,11 @@ static const char help_msg[] =
"-D FMC FDelay Target Device ID\n" "-D FMC FDelay Target Device ID\n"
"\n"; "\n";
static inline void fmc_fdelay_calibration_version(void)
{
printf("git_version: %s\n", git_version);
}
/** /**
* Read calibration data from file * Read calibration data from file
* @path: file path * @path: file path
...@@ -185,6 +193,9 @@ int main(int argc, char *argv[]) ...@@ -185,6 +193,9 @@ int main(int argc, char *argv[])
case 'b': case 'b':
show_bin = 1; show_bin = 1;
break; 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