fix the autogen_lib.sh to run for File name too long bug

This commit is contained in:
zhuocaihua
2019-07-19 06:09:55 -04:00
parent dfd54a1905
commit 54cb218c2c
2 changed files with 31 additions and 28 deletions

View File

@@ -13,32 +13,14 @@ VERSION_SH=version.sh
LIBFOO_MACRO=`echo ${MODULE} | tr 'a-z' 'A-Z'`
LPWD=$(dirname `readlink -f $0`)
YEAR=$(date '+%Y')
S='$'
exclamation='!'
LICENSE_HEADER=\
"/******************************************************************************
* Copyright (C) 2014-2020 Zhifeng Gong <gozfree@163.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
******************************************************************************/"
LICENSE_HEADER=license_header.inc
usage()
{
echo "==== usage ===="
@@ -54,8 +36,8 @@ mkdir_libfoo()
autogen_libfoo_h()
{
cat > ${LIBFOO_H} <<!
${LICENSE_HEADER}
cat ${LPWD}/${LICENSE_HEADER} > ${LIBFOO_H}
cat >> ${LIBFOO_H} <<!
#ifndef ${LIBFOO_MACRO}_H
#define ${LIBFOO_MACRO}_H
@@ -74,8 +56,8 @@ extern "C" {
autogen_libfoo_c()
{
cat > ${LIBFOO_C} <<!
${LICENSE_HEADER}
cat ${LPWD}/${LICENSE_HEADER} > ${LIBFOO_C}
cat >> ${LIBFOO_C} <<!
#include "${LIBFOO_H}"
#include <stdio.h>
#include <stdlib.h>
@@ -85,8 +67,8 @@ ${LICENSE_HEADER}
autogen_test_libfoo_c()
{
cat > ${TEST_LIBFOO_C} <<!
${LICENSE_HEADER}
cat ${LPWD}/${LICENSE_HEADER} > ${TEST_LIBFOO_C}
cat >> ${TEST_LIBFOO_C} <<!
#include "${LIBFOO_H}"
#include <stdio.h>
#include <stdlib.h>

21
build/license_header.inc Normal file
View File

@@ -0,0 +1,21 @@
/******************************************************************************
* Copyright (C) 2014-2020 Zhifeng Gong <gozfree@163.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
******************************************************************************/