-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
build_no.bat
64 lines (64 loc) · 4.57 KB
/
build_no.bat
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
@echo off
echo /* -- Do not commit this file -- > .\Sources\build_no.h
echo * >> .\Sources\build_no.h
echo * CAN Interface API, Version 3 (for PEAK-System PCAN Interfaces) >> .\Sources\build_no.h
echo * >> .\Sources\build_no.h
echo * Copyright (c) 2005-2024 Uwe Vogt, UV Software, Berlin ([email protected]) >> .\Sources\build_no.h
echo * All rights reserved. >> .\Sources\build_no.h
echo * >> .\Sources\build_no.h
echo * This file is part of PCANBasic-Wrapper. >> .\Sources\build_no.h
echo * >> .\Sources\build_no.h
echo * PCANBasic-Wrapper is dual-licensed under the BSD 2-Clause "Simplified" License >> .\Sources\build_no.h
echo * and under the GNU General Public License v3.0 (or any later version). You can >> .\Sources\build_no.h
echo * choose between one of them if you use PCANBasic-Wrapper in whole or in part. >> .\Sources\build_no.h
echo * >> .\Sources\build_no.h
echo * BSD 2-Clause "Simplified" License: >> .\Sources\build_no.h
echo * Redistribution and use in source and binary forms, with or without >> .\Sources\build_no.h
echo * modification, are permitted provided that the following conditions are met: >> .\Sources\build_no.h
echo * 1. Redistributions of source code must retain the above copyright notice, this >> .\Sources\build_no.h
echo * list of conditions and the following disclaimer. >> .\Sources\build_no.h
echo * 2. Redistributions in binary form must reproduce the above copyright notice, >> .\Sources\build_no.h
echo * this list of conditions and the following disclaimer in the documentation >> .\Sources\build_no.h
echo * and/or other materials provided with the distribution. >> .\Sources\build_no.h
echo * >> .\Sources\build_no.h
echo * PCANBasic-Wrapper IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" >> .\Sources\build_no.h
echo * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >> .\Sources\build_no.h
echo * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE >> .\Sources\build_no.h
echo * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE >> .\Sources\build_no.h
echo * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL >> .\Sources\build_no.h
echo * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR >> .\Sources\build_no.h
echo * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER >> .\Sources\build_no.h
echo * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, >> .\Sources\build_no.h
echo * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >> .\Sources\build_no.h
echo * OF PCANBasic-Wrapper, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >> .\Sources\build_no.h
echo * >> .\Sources\build_no.h
echo * GNU General Public License v3.0 or later: >> .\Sources\build_no.h
echo * PCANBasic-Wrapper is free software: you can redistribute it and/or modify >> .\Sources\build_no.h
echo * it under the terms of the GNU General Public License as published by >> .\Sources\build_no.h
echo * the Free Software Foundation, either version 3 of the License, or >> .\Sources\build_no.h
echo * (at your option) any later version. >> .\Sources\build_no.h
echo * >> .\Sources\build_no.h
echo * PCANBasic-Wrapper is distributed in the hope that it will be useful, >> .\Sources\build_no.h
echo * but WITHOUT ANY WARRANTY; without even the implied warranty of >> .\Sources\build_no.h
echo * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >> .\Sources\build_no.h
echo * GNU General Public License for more details. >> .\Sources\build_no.h
echo * >> .\Sources\build_no.h
echo * You should have received a copy of the GNU General Public License >> .\Sources\build_no.h
echo * along with PCANBasic-Wrapper. If not, see "https://www.gnu.org/licenses/". >> .\Sources\build_no.h
echo */ >> .\Sources\build_no.h
echo #ifndef BUILD_NO_H_INCLUDED >> .\Sources\build_no.h
echo #define BUILD_NO_H_INCLUDED >> .\Sources\build_no.h
git log -1 >nul 2>nul
if %errorlevel% == 0 (
git log -1 --pretty=format:"#define BUILD_NO 0x%%h" > build_no.txt
type build_no.txt >> .\Sources\build_no.h
erase /Q build_no.txt >nul 2>nul
echo /* git hash */ >> .\Sources\build_no.h
) else (
echo #define BUILD_NO 0xDEADC0DE >> .\Sources\build_no.h
)
echo #define STRINGIFY(X) #X >> .\Sources\build_no.h
echo #define TOSTRING(X) STRINGIFY(X) >> .\Sources\build_no.h
echo #define SVN_REV_INT (BUILD_NO) >> .\Sources\build_no.h
echo #define SVN_REV_STR TOSTRING(BUILD_NO) >> .\Sources\build_no.h
echo #endif >> .\Sources\build_no.h