Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
85e8632b02 | |||
1994912271 | |||
98fa595753 | |||
f6640b3418 | |||
4747bb5bc7 | |||
bd9ee1c660 | |||
22deae23e5 | |||
7f22d5bdc6 | |||
1c9278812b | |||
2ea014ae46 |
3
.VERSION
Normal file
3
.VERSION
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
COMMIT: $Format:%H$
|
||||||
|
REFS: $Format:%D$
|
||||||
|
DATE: $Format:%ci$
|
2
.gitattributes
vendored
Normal file
2
.gitattributes
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
GNUmakefile export-ignore
|
||||||
|
.VERSION export-subst
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -6,3 +6,4 @@ dbd
|
|||||||
include
|
include
|
||||||
*.pdf
|
*.pdf
|
||||||
*.*log
|
*.*log
|
||||||
|
StreamVersion.h
|
||||||
|
23
GNUmakefile
23
GNUmakefile
@ -19,18 +19,23 @@ SOURCES += $(FORMATS:%=src/%Converter.cc)
|
|||||||
SOURCES += $(BUSSES:%=src/%Interface.cc)
|
SOURCES += $(BUSSES:%=src/%Interface.cc)
|
||||||
SOURCES += $(STREAM_SRCS:%=src/%)
|
SOURCES += $(STREAM_SRCS:%=src/%)
|
||||||
|
|
||||||
HEADERS += devStream.h
|
HEADERS += src/devStream.h
|
||||||
HEADERS += StreamFormat.h
|
HEADERS += src/StreamFormat.h
|
||||||
HEADERS += StreamFormatConverter.h
|
HEADERS += src/StreamFormatConverter.h
|
||||||
HEADERS += StreamBuffer.h
|
HEADERS += src/StreamBuffer.h
|
||||||
HEADERS += StreamError.h
|
HEADERS += src/StreamError.h
|
||||||
|
HEADERS += src/StreamVersion.h
|
||||||
|
|
||||||
StreamCore.o StreamCore.d: streamReferences
|
CPPFLAGS += -DSTREAM_INTERNAL -I$(COMMON_DIR)
|
||||||
|
|
||||||
# Update version string (contains __DATE__ and __TIME__)
|
# Update version string each time anything changes
|
||||||
# each time anything changes.
|
StreamVersion$(OBJ) StreamVersion$(DEP): $(COMMON_DIR)/StreamVersion.h $(filter-out StreamVersion$(OBJ) stream_exportAddress$(OBJ),$(LIBOBJS) $(LIBRARY_OBJS))
|
||||||
StreamVersion.o: $(filter-out StreamVersion.o stream_exportAddress.o,$(LIBOBJS))
|
|
||||||
|
|
||||||
|
$(COMMON_DIR)/StreamVersion.h: $(filter-out StreamVersion.h,$(notdir $(SOURCES) $(HEADERS)))
|
||||||
|
@echo Creating $@
|
||||||
|
$(PERL) ../src/makeStreamVersion.pl $@
|
||||||
|
|
||||||
|
StreamCore$(OBJ) StreamCore$(DEP): streamReferences
|
||||||
streamReferences:
|
streamReferences:
|
||||||
$(PERL) ../src/makeref.pl Interface $(BUSSES) > $@
|
$(PERL) ../src/makeref.pl Interface $(BUSSES) > $@
|
||||||
$(PERL) ../src/makeref.pl Converter $(FORMATS) >> $@
|
$(PERL) ../src/makeref.pl Converter $(FORMATS) >> $@
|
||||||
|
@ -24,4 +24,3 @@ endif
|
|||||||
|
|
||||||
# dbst based database optimization (default: NO)
|
# dbst based database optimization (default: NO)
|
||||||
DB_OPT = NO
|
DB_OPT = NO
|
||||||
HOST_OPT=NO
|
|
||||||
|
14
src/Makefile
14
src/Makefile
@ -74,14 +74,24 @@ endif
|
|||||||
LIB_LIBS += $(EPICS_BASE_IOC_LIBS)
|
LIB_LIBS += $(EPICS_BASE_IOC_LIBS)
|
||||||
|
|
||||||
INC += devStream.h
|
INC += devStream.h
|
||||||
|
INC += StreamFormat.h
|
||||||
|
INC += StreamFormatConverter.h
|
||||||
|
INC += StreamBuffer.h
|
||||||
|
INC += StreamError.h
|
||||||
|
INC += StreamVersion.h
|
||||||
|
|
||||||
# switch off annoying rset warnings in 3.16+
|
# switch off annoying rset warnings in 3.16+
|
||||||
CPPFLAGS += -DUSE_TYPED_RSET
|
CPPFLAGS += -DUSE_TYPED_RSET
|
||||||
|
|
||||||
|
CPPFLAGS += -DSTREAM_INTERNAL
|
||||||
|
|
||||||
-include $(TOP)/configure/RULES
|
-include $(TOP)/configure/RULES
|
||||||
|
|
||||||
# Update version string whenever something changes
|
# Update version string whenever something changed.
|
||||||
StreamVersion$(OBJ): $(filter-out StreamVersion.o,$(LIBOBJS)$(LIBRARY_OBJS))
|
StreamVersion$(OBJ): $(COMMON_DIR)/StreamVersion.h $(filter-out StreamVersion$(OBJ),$(LIBOBJS) $(LIBRARY_OBJS)) ../CONFIG_STREAM
|
||||||
|
$(COMMON_DIR)/StreamVersion.h: $(SRCS) $(filter-out StreamVersion.h, $(INC))
|
||||||
|
@echo Creating $@
|
||||||
|
$(PERL) ../makeStreamVersion.pl $@
|
||||||
|
|
||||||
# Add references to all registrars to main file to avoid
|
# Add references to all registrars to main file to avoid
|
||||||
# missing initialization.
|
# missing initialization.
|
||||||
|
@ -29,11 +29,4 @@ endif
|
|||||||
include $(TOP)/config/CONFIG_APP
|
include $(TOP)/config/CONFIG_APP
|
||||||
include ../CONFIG_STREAM
|
include ../CONFIG_STREAM
|
||||||
|
|
||||||
DBDNAME = stream.dbd
|
|
||||||
INC += devStream.h
|
|
||||||
|
|
||||||
include $(EPICS_BASE)/config/RULES.Host
|
include $(EPICS_BASE)/config/RULES.Host
|
||||||
|
|
||||||
# create stream.dbd from all RECORDTYPES
|
|
||||||
stream.dbd: ../CONFIG_STREAM
|
|
||||||
$(PERL) ../makedbd.pl -3.13 $(RECORDTYPES) > $@
|
|
||||||
|
@ -42,17 +42,37 @@ SRCS.c += $(filter %.c,$(STREAM_SRCS:%=%../%))
|
|||||||
|
|
||||||
LIBOBJS = $(patsubst ../%,%.o,$(basename $(SRCS.cc) $(SRCS.c)))
|
LIBOBJS = $(patsubst ../%,%.o,$(basename $(SRCS.cc) $(SRCS.c)))
|
||||||
|
|
||||||
|
DBDNAME = stream.dbd
|
||||||
|
|
||||||
|
INC += devStream.h
|
||||||
|
INC += StreamFormat.h
|
||||||
|
INC += StreamFormatConverter.h
|
||||||
|
INC += StreamBuffer.h
|
||||||
|
INC += StreamError.h
|
||||||
|
INC += StreamVersion.h
|
||||||
|
|
||||||
include $(EPICS_BASE)/config/RULES.Vx
|
include $(EPICS_BASE)/config/RULES.Vx
|
||||||
include ../../config/RULES.munch
|
include ../../config/RULES.munch
|
||||||
|
|
||||||
DEPENDS: depends
|
DEPENDS: depends
|
||||||
-include DEPENDS
|
-include DEPENDS
|
||||||
|
|
||||||
|
CPPFLAGS += -DSTREAM_INTERNAL
|
||||||
|
|
||||||
# Update version string whenever something changes
|
# Update version string whenever something changes
|
||||||
StreamVersion.o: ../*.c ../*.h ../*.cc ../CONFIG_STREAM
|
|
||||||
$(LIBNAME): StreamVersion.o
|
$(LIBNAME): StreamVersion.o
|
||||||
|
|
||||||
|
StreamVersion.o: StreamVersion.h $(filter-out StreamVersion.o,$(LIBOBJS)) ../CONFIG_STREAM
|
||||||
|
StreamVersion.h: $(SRCS.cc) $(SRCS.c) $(add-prefix ../,$(filter-out StreamVersion.h, $(INC)))
|
||||||
|
@echo Creating $@ from git tag
|
||||||
|
$(PERL) ../makeStreamVersion.pl > $@
|
||||||
|
|
||||||
StreamCore.o: streamReferences
|
StreamCore.o: streamReferences
|
||||||
|
|
||||||
streamReferences:
|
streamReferences:
|
||||||
touch $@
|
touch $@
|
||||||
|
|
||||||
|
# create stream.dbd from all RECORDTYPES
|
||||||
|
stream.dbd: ../CONFIG_STREAM
|
||||||
|
$(PERL) ../makedbd.pl -3.13 $(RECORDTYPES) > $@
|
||||||
|
|
||||||
|
@ -157,7 +157,7 @@ StreamProtocolParser* StreamProtocolParser::
|
|||||||
readFile(const char* filename)
|
readFile(const char* filename)
|
||||||
{
|
{
|
||||||
FILE* file;
|
FILE* file;
|
||||||
#ifdef windows
|
#ifdef _WIN32
|
||||||
const char pathseparator = ';';
|
const char pathseparator = ';';
|
||||||
const char dirseparator = '\\';
|
const char dirseparator = '\\';
|
||||||
#else
|
#else
|
||||||
|
@ -20,12 +20,16 @@
|
|||||||
* along with StreamDevice. If not, see https://www.gnu.org/licenses/.
|
* along with StreamDevice. If not, see https://www.gnu.org/licenses/.
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
|
|
||||||
#include "devStream.h"
|
#include "StreamVersion.h"
|
||||||
|
|
||||||
#define STR2(x) #x
|
#define STR2(x) #x
|
||||||
#define STR(x) STR2(x)
|
#define STR(x) STR2(x)
|
||||||
const char StreamVersion [] =
|
const char StreamVersion [] =
|
||||||
"StreamDevice " STR(STREAM_MAJOR)
|
"StreamDevice"
|
||||||
|
#if STREAM_MAJOR+0
|
||||||
|
" " STR(STREAM_MAJOR)
|
||||||
"." STR(STREAM_MINOR)
|
"." STR(STREAM_MINOR)
|
||||||
"." STR(STREAM_PATCHLEVEL)
|
"." STR(STREAM_PATCHLEVEL)
|
||||||
" built " __DATE__ " " __TIME__;
|
STREAM_DEV
|
||||||
|
#endif
|
||||||
|
" commit:" STREAM_COMMIT_HASH;
|
||||||
|
@ -28,9 +28,9 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#define STREAM_MAJOR 2
|
#ifndef STREAM_INTERNAL
|
||||||
#define STREAM_MINOR 8
|
#include "StreamVersion.h"
|
||||||
#define STREAM_PATCHLEVEL 12
|
#endif
|
||||||
|
|
||||||
#ifndef OK
|
#ifndef OK
|
||||||
#define OK 0
|
#define OK 0
|
||||||
|
71
src/makeStreamVersion.pl
Normal file
71
src/makeStreamVersion.pl
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
##########################################################################
|
||||||
|
# This is a helper script for StreamDevice.
|
||||||
|
# It generates a version file from git tags.
|
||||||
|
#
|
||||||
|
# (C) 2020 Dirk Zimoch (dirk.zimoch@psi.ch)
|
||||||
|
#
|
||||||
|
# This file is part of StreamDevice.
|
||||||
|
#
|
||||||
|
# StreamDevice is free software: You can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU Lesser General Public License as published
|
||||||
|
# by the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# StreamDevice is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU Lesser General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Lesser General Public License
|
||||||
|
# along with StreamDevice. If not, see https://www.gnu.org/licenses/.
|
||||||
|
#########################################################################/
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
|
||||||
|
|
||||||
|
my ( $major, $minor, $patch, $dev, $branch, $date, $hash );
|
||||||
|
|
||||||
|
if (my $version = `git describe --tags --abbrev=0 --dirty --match "[0-9]*" 2>/dev/null`) {
|
||||||
|
if ($version =~ m/(\d+)\.(\d+)\.(\d+)?(.*)?/) {
|
||||||
|
$major = $1; $minor = $2; $patch = $3; $dev = $4;
|
||||||
|
}
|
||||||
|
if (`git log -1 --format="%H %ci"`=~ m/([[:xdigit:]]+) (.+)/) {
|
||||||
|
$hash = $1; $date = $2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!$major) {
|
||||||
|
if (open(my $fh, '<', '../../.VERSION')) {
|
||||||
|
while (my $line = <$fh>) {
|
||||||
|
if ($line =~ m/COMMIT: *([[:xdigit:]]+)/) {
|
||||||
|
$hash = $1;
|
||||||
|
}
|
||||||
|
if ($line =~ m/REFS: *tag: *((\d+)\.(\d+)\.(\d+)?,)? *(.*)/) {
|
||||||
|
$major = $2; $minor = $3; $patch = $4; $branch = $5;
|
||||||
|
}
|
||||||
|
if ($line =~ m/DATE: *(.+)/) {
|
||||||
|
$date = $1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
print "neither git repo nor .VERSION file found\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
open my $out, '>', @ARGV or die $!;
|
||||||
|
print $out <<EOF;
|
||||||
|
/* Generated file */
|
||||||
|
|
||||||
|
#ifndef StreamVersion_h
|
||||||
|
#define StreamVersion_h
|
||||||
|
|
||||||
|
#define STREAM_MAJOR $major
|
||||||
|
#define STREAM_MINOR $minor
|
||||||
|
#define STREAM_PATCHLEVEL $patch
|
||||||
|
#define STREAM_DEV "$dev"
|
||||||
|
#define STREAM_COMMIT_HASH "$hash"
|
||||||
|
#define STREAM_COMMIT_DATE "$date"
|
||||||
|
|
||||||
|
#endif /* StreamVersion_h */
|
||||||
|
EOF
|
||||||
|
|
||||||
|
close $out
|
@ -68,6 +68,10 @@ PROD_LIBS += sscan
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifneq ($(words $(SNCSEQ) $(SYNAPPS)), 0)
|
||||||
|
PROD_LIBS += seq pv
|
||||||
|
endif
|
||||||
|
|
||||||
streamApp_DBD += stream.dbd
|
streamApp_DBD += stream.dbd
|
||||||
|
|
||||||
ifdef PCRE
|
ifdef PCRE
|
||||||
|
Reference in New Issue
Block a user