-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathversion.sh
executable file
·47 lines (42 loc) · 1.56 KB
/
version.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/sh
# SPDX-License-Identifier: LicenseRef-MSLA
# Copyright (c) 2017-2024 Silicon Laboratories Inc. (www.silabs.com)
#
# The licensor of this software is Silicon Laboratories Inc. Your use of this
# software is governed by the terms of the Silicon Labs Master Software License
# Agreement (MSLA) available at [1]. This software is distributed to you in
# Object Code format and/or Source Code format and is governed by the sections
# of the MSLA applicable to Object Code, Source Code and Modified Open Source
# Code. By using this software, you agree to the terms of the MSLA.
#
# [1]: https://www.silabs.com/about-us/legal/master-software-license-agreement
SRC_DIR=$1
VERSION_FILE=$2
GIT_LABEL="$(git -C $SRC_DIR describe --tags --dirty --match "*v[0-9]*" || echo '<unknown version>')"
cat << EOF > $VERSION_FILE.tmp
/* SPDX-License-Identifier: LicenseRef-MSLA */
/* THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT! */
#include <stdint.h>
#include "common/version.h"
/*
* wsbrd API versions:
*
* 2.0.0
* - Complete API change
* 0.2.0
* - Pop the retry_per_rate array and the successful phy mode id
* in SPINEL_CMD_PROP_IS/SPINEL_PROP_STREAM_STATUS that were
* used to send the data, necessary for mode switch fallback
* 0.1.0
* - Pop ACK request, frame pending, and PAN ID suppression in
* PROP_IS/STREAM_RAW, for MAC frame reconstruction
*/
const char *version_daemon_str = "${GIT_LABEL}";
uint32_t version_daemon_api = VERSION(2, 0, 0);
EOF
if cmp -s $VERSION_FILE $VERSION_FILE.tmp
then
rm -f $VERSION_FILE.tmp
else
mv -f $VERSION_FILE.tmp $VERSION_FILE
fi