first commit
This commit is contained in:
9
templates/dynamic/ext/c
Executable file
9
templates/dynamic/ext/c
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
cat<<EOF
|
||||
//=========================================
|
||||
// Filename : $1
|
||||
// Author : Colben
|
||||
// Create : `date +"%F %R"`
|
||||
//=========================================
|
||||
|
||||
EOF
|
14
templates/dynamic/ext/h
Executable file
14
templates/dynamic/ext/h
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
|
||||
cat<<EOF
|
||||
//=========================================
|
||||
// Filename : $1
|
||||
// Author : Colben
|
||||
// Create : `date +"%F %R"`
|
||||
//=========================================
|
||||
|
||||
#ifndef ____
|
||||
#define ____
|
||||
|
||||
#endif
|
||||
EOF
|
19
templates/dynamic/ext/py
Executable file
19
templates/dynamic/ext/py
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
|
||||
cat<<EOF
|
||||
#!/usr/bin/python3
|
||||
# -*- coding:utf-8 -*-
|
||||
#=========================================
|
||||
# Filename : $1
|
||||
# Author : Colben
|
||||
# Create : `date +"%F %R"`
|
||||
#=========================================
|
||||
|
||||
|
||||
|
||||
def main():
|
||||
return
|
||||
|
||||
if '__main__' == __name__:
|
||||
main()
|
||||
EOF
|
49
templates/dynamic/ext/sh
Executable file
49
templates/dynamic/ext/sh
Executable file
@@ -0,0 +1,49 @@
|
||||
#!/bin/bash
|
||||
|
||||
cat <<-EOF
|
||||
#!/bin/bash
|
||||
#=========================================
|
||||
# Author : Colben
|
||||
# Create : $(date +"%F %R")
|
||||
#=========================================
|
||||
|
||||
set -euo pipefail
|
||||
export LANG=en_US.UTF-8
|
||||
trap Quit EXIT
|
||||
|
||||
if [ -t 0 ]; then
|
||||
function Print { echo -e "\033[32;1m\$(date +'[%F %T]') \$*\033[0m"; }
|
||||
function Warn { echo -e "\033[33;1m\$(date +'[%F %T]') \$*\033[0m"; }
|
||||
function Error { echo -e "\033[31;1m\$(date +'[%F %T]') \$*\033[0m"; exit 1; }
|
||||
else
|
||||
function Print { echo -e "\$(date +'[%F %T] INFO') \$*"; }
|
||||
function Warn { echo -e "\$(date +'[%F %T] WARN') \$*"; }
|
||||
function Error { echo -e "\$(date +'[%F %T] ERRRO') \$*"; exit 1; }
|
||||
fi
|
||||
|
||||
function Quit {
|
||||
local exitCode=\$?
|
||||
[ 0 -ne \$exitCode ] && Error Failed to xxxx!
|
||||
[ -z "\${END:-}" ] && echo && Error Interrupted manually!
|
||||
Print Succeeded to xxxx.
|
||||
}
|
||||
|
||||
function Func1 {
|
||||
Print Func1 ...
|
||||
}
|
||||
|
||||
function Func2 {
|
||||
Print Func2 ...
|
||||
}
|
||||
|
||||
function Main {
|
||||
Print Main ...
|
||||
Func1
|
||||
Func2
|
||||
END=1
|
||||
}
|
||||
|
||||
# Start here
|
||||
Main
|
||||
EOF
|
||||
|
10
templates/dynamic/full/.gitignore
vendored
Executable file
10
templates/dynamic/full/.gitignore
vendored
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
cat<<EOF
|
||||
#=========================================
|
||||
# Filename : $1
|
||||
# Author : Colben
|
||||
# Create : `date +"%F %R"`
|
||||
#=========================================
|
||||
|
||||
EOF
|
1
templates/dynamic/full/MAKEFILE
Symbolic link
1
templates/dynamic/full/MAKEFILE
Symbolic link
@@ -0,0 +1 @@
|
||||
Makefile
|
33
templates/dynamic/full/Makefile
Executable file
33
templates/dynamic/full/Makefile
Executable file
@@ -0,0 +1,33 @@
|
||||
#!/bin/sh
|
||||
|
||||
cat<<EOF
|
||||
#=========================================
|
||||
# Filename : $1
|
||||
# Author : Colben
|
||||
# Create : `date +"%F %R"`
|
||||
#=========================================
|
||||
|
||||
cc=gcc
|
||||
|
||||
source=
|
||||
|
||||
object=\$(source:%.c=%.o)
|
||||
|
||||
flags=
|
||||
|
||||
target=exe
|
||||
|
||||
\$(target):\$(object)
|
||||
@\$(cc) -o \$@ \$^ \$(flags)
|
||||
@echo "成功生成可执行文件: \$@ !!"
|
||||
|
||||
%.o:%.c
|
||||
@\$(cc) -o \$@ -c \$< \$(flags)
|
||||
@echo "成功编译 \$< 生成 \$@ 文件!!"
|
||||
|
||||
clean:
|
||||
@rm -rf \$(object)
|
||||
|
||||
clear:
|
||||
@rm -rf \$(object) \$(target)
|
||||
EOF
|
1
templates/dynamic/full/makefile
Symbolic link
1
templates/dynamic/full/makefile
Symbolic link
@@ -0,0 +1 @@
|
||||
Makefile
|
Reference in New Issue
Block a user