blob: 59123684d8d86423baa7e7ae14bd4e7cfd91fc9c [file] [log] [blame]
Damjan Marion612dd6a2018-07-30 12:45:07 +02001#!/bin/bash
Bernhard M. Wiedemann3d14f032019-12-05 16:51:26 +01002: ${VPP_BUILD_USER:=$(whoami)}
3: ${VPP_BUILD_HOST:=$(hostname)}
4DATE_FMT="+%Y-%m-%dT%H:%M:%S"
5SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:-$(date +%s)}"
6VPP_BUILD_DATE=$(date -u -d "@$SOURCE_DATE_EPOCH" "$DATE_FMT" 2>/dev/null || date -u -r "$SOURCE_DATE_EPOCH" "$DATE_FMT" 2>/dev/null || date -u "$DATE_FMT")
Damjan Marion612dd6a2018-07-30 12:45:07 +02007
8cat > ${1} << __EOF__
9/*
10 * Copyright (c) 2018 Cisco and/or its affiliates.
11 * Licensed under the Apache License, Version 2.0 (the "License");
12 * you may not use this file except in compliance with the License.
13 * You may obtain a copy of the License at:
14 *
15 * http://www.apache.org/licenses/LICENSE-2.0
16 *
17 * Unless required by applicable law or agreed to in writing, software
18 * distributed under the License is distributed on an "AS IS" BASIS,
19 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20 * See the License for the specific language governing permissions and
21 * limitations under the License.
22 */
23
24#ifndef included_vpp_app_version_h
25#define included_vpp_app_version_h
26
Bernhard M. Wiedemann3d14f032019-12-05 16:51:26 +010027#define VPP_BUILD_DATE "$VPP_BUILD_DATE"
28#define VPP_BUILD_USER "$VPP_BUILD_USER"
29#define VPP_BUILD_HOST "$VPP_BUILD_HOST"
Damjan Marion6077c972019-01-28 17:55:59 +010030#define VPP_BUILD_TOPDIR "$(git rev-parse --show-toplevel 2> /dev/null)"
Damjan Marion612dd6a2018-07-30 12:45:07 +020031#define VPP_BUILD_VER "$(scripts/version)"
32#endif
33__EOF__