Merge branch 'master' of http://wagnertech.de/git/projects
authorMEBIL <mebil@mebil.(none)>
Tue, 13 Dec 2016 12:07:32 +0000 (13:07 +0100)
committerMEBIL <mebil@mebil.(none)>
Tue, 13 Dec 2016 12:07:32 +0000 (13:07 +0100)
tools/make/c_configure.sh
tools/make/configure
tools/make/insert_build.sh [new file with mode: 0755]
tools/make/makefile
tools/tex/titling.sty [new file with mode: 0644]

index 8882c07..f2e5bcd 100755 (executable)
@@ -30,12 +30,14 @@ function install_cpp_make {
                echo "CC = arm-linux-gnueabi-g++" >> make.pre
                echo "CXXFLAGS += -D_ARMEL" >> make.pre
                echo 'export PATH := /opt/eldk-5.0/armv5te/sysroots/i686-oesdk-linux/usr/bin/armv5te-linux-gnueabi/:/opt/eldk-5.0/armv5te/sysroots/i686-oesdk-linux/bin/armv5te-linux-gnueabi/:$(PATH)' >> make.pre
+       else
+               echo "CXXFLAGS += -std=c++0x" >> make.pre
        fi
-       echo "CXXFLAGS += -I$src/util" >> make.pre
        popd
 }
 
 function append_dependency {
+# adds another drectory, where a c++ compile is performed
 # parameter:
 # $1: main directory
 # $2: dependency directory
@@ -49,6 +51,7 @@ function append_dependency {
 }
 
 function append_library {
+# same as append_dependency. In addition a include statement + a link to the library is added to "main directory"
 # parameter:
 # $1: main directory
 # $2: dependency directory
@@ -57,6 +60,7 @@ function append_library {
        src=$(pwd)
        echo "DEPS += $3" >> $1/make.pre
        echo "LDLIBS += $3" >> $1/make.pre
+       echo "CXXFLAGS += -I$src/$2" >> $1/make.pre
        echo "$3:" >> $1/make.post
        echo "  cd $src/$2 && make TARGET=$3" >> $1/make.post
        echo "  ln -sf $src/$2/$3 ." >> $1/make.post
index f4541ba..32b2558 100755 (executable)
@@ -5,6 +5,8 @@ function echo_usage {
        echo "usage: configure <package> <revision> [options]"
        echo "  -b <branch-rev>"
        echo "  -a <arch>"
+       echo "  -g <alternative repository>"
+       echo "  -n : do not delete src dir"
 }
 
 # to build a package you need ...
@@ -20,26 +22,33 @@ fi
 
 paket=$1
 build=$2
+shift 2
 ARCH=""
 cpp_build=0
+alt_repos=""
+delete_src=1
 
-shift 2
-while getopts "b:a:" opt
-do
+while getopts ":a:b:g:n" opt; do
        case $opt in
-       a) ARCH=$OPTARG
-               ;;
-       b) echo "branching not implemented"
-               ;;
-       *) exit 1
-               ;;
+               a) ARCH=$OPTARG
+                       ;;
+               b) branch=$OPTARG
+                       ;;
+               g) alt_repos="-g $OPTARG"
+                       ;;
+               n) delete_src=0
+                       ;;
+               \?) echo "Invalid option: -$OPTARG"
+                       echo_usage
+                       exit 1
+                       ;;
+               :) echo "Option -$OPTARG requires an argument."
+                       echo_usage
+                       exit 1
+                       ;;
        esac
 done
 
-# checkout build utilities
-if [ ! -d projects ]; then
-       git clone https://github.com/wagner-tech/projects/
-fi
 ln -sf projects/tools/make/makefile .
 
 # check standard files
@@ -50,14 +59,9 @@ then
 fi
 
 # clean dirs and check out
-if [ -d src ]
+if [ -d src -a $delete_src -eq 1 ]
 then
-       echo "Shall I delete src dir? [y]/n"
-       read key
-       if [ "$key" != "n" ]
-       then
-               rm -rf src
-       fi
+       rm -rf src
 fi
 
 if [ -e $paket ]
@@ -72,7 +76,7 @@ cwd=$(pwd)
 
 # checkout
 pushd src >/dev/null
-       ../$paket.co $build
+       ../$paket.co $alt_repos $build 
 popd >/dev/null
 
 # load util functions for C/C++ - build
@@ -127,4 +131,5 @@ fi
 
 # append version to make.pre
 echo "version = $version" >> make.pre
+echo "build = $build" >> make.pre
 
diff --git a/tools/make/insert_build.sh b/tools/make/insert_build.sh
new file mode 100755 (executable)
index 0000000..00a90b0
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/bash
+set -e
+
+usage="insert_build.sh <file> <build>"
+
+# inserts _<build> before last dot of filename
+# example: "insert_build.sh 45 foo.pdf" leads to "foo_45.pdf"
+
+if [ $# -ne 2 ]; then
+       echo $usage
+       exit 1
+fi
+
+stem=${1%.*}
+ext=${1##*.}
+
+cp $1 ${stem}_$2.$ext
+
index 6513f24..b2f4944 100644 (file)
@@ -8,6 +8,7 @@ COMPILE_TARGET = compile.stamp
 COPY = $(NOP)
 ZIP = zip -r $(project).zip $(project)
 DEB = fakeroot dpkg-deb --build $(project)
+INSERT_BUILD = projects/tools/make/insert_build.sh
 
 #default parameters
 project = default
@@ -38,6 +39,9 @@ zip: $(project).zip
 deb: $(project).deb
        # Debian package ready
 
+version: $(COMPILE_TARGET)
+       $(INSERT_BUILD) $(COMPILE_TARGET) $(build)
+
 #-----------------------------------------------------------------
 # compile steps
 #-----------------------------------------------------------------
@@ -78,5 +82,5 @@ clean:
 # Build-Regeln
 #-----------------------------------------------------------------
 %.pdf : %.tex $(SOURCES)
-       pdflatex $<
+       pdflatex $< && pdflatex $<
 
diff --git a/tools/tex/titling.sty b/tools/tex/titling.sty
new file mode 100644 (file)
index 0000000..ed2eb33
--- /dev/null
@@ -0,0 +1,270 @@
+%%
+%% This is file `titling.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% titling.dtx  (with options: `usc')
+%% 
+%% -----------------------------------------------------------------
+%%   Author: Peter Wilson (Herries Press)
+%%   Maintainer: Will Robertson (will dot robertson at latex-project dot org)
+%%   Copyright 2000--2004 Peter R. Wilson
+%% 
+%%   This work may be distributed and/or modified under the
+%%   conditions of the LaTeX Project Public License, either
+%%   version 1.3c of this license or (at your option) any
+%%   later version: <http://www.latex-project.org/lppl.txt>
+%% 
+%%   This work has the LPPL maintenance status "maintained".
+%%   The Current Maintainer of this work is Will Robertson.
+%% 
+%%   This work consists of the files listed in the README file.
+%% -----------------------------------------------------------------
+%% 
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{titling}[2009/09/04 v2.1d maketitle typesetting]
+
+\newcommand{\pretitle}[1]{\def\@bspretitle{#1}}
+\newcommand{\posttitle}[1]{\def\@bsposttitle{#1}}
+\newcommand{\preauthor}[1]{\def\@bspreauthor{#1}}
+\newcommand{\postauthor}[1]{\def\@bspostauthor{#1}}
+\newcommand{\predate}[1]{\def\@bspredate{#1}}
+\newcommand{\postdate}[1]{\def\@bspostdate{#1}}
+
+\if@titlepage
+  \pretitle{\begin{center}\LARGE}
+  \posttitle{\par\end{center}\vskip 2em}
+  \preauthor{\begin{center}
+    \large \lineskip .75em%
+    \begin{tabular}[t]{c}}
+  \postauthor{\end{tabular}\par\end{center}}
+  \predate{\begin{center}\large}
+  \postdate{\par\end{center}}
+\else
+  \pretitle{\begin{center}\LARGE}
+  \posttitle{\par\end{center}\vskip 0.5em}
+  \preauthor{\begin{center}
+    \large \lineskip .5em%
+    \begin{tabular}[t]{c}}
+  \postauthor{\end{tabular}\par\end{center}}
+  \predate{\begin{center}\large}
+  \postdate{\par\end{center}}
+\fi
+
+\newcommand{\maketitlehooka}{}
+\newcommand{\maketitlehookb}{}
+\newcommand{\maketitlehookc}{}
+\newcommand{\maketitlehookd}{}
+
+\newcommand{\thanksmarkseries}[1]{%
+  \def\@bsmarkseries{\renewcommand{\thefootnote}{\@nameuse{#1}{footnote}}}}
+\newcommand{\symbolthanksmark}{\thanksmarkseries{\fnsymbol}}
+\newcommand{\@bscontmark}{\setcounter{footnote}{0}}
+\newcommand{\continuousmarks}{\def\@bscontmark{}}
+\newcommand{\thanksheadextra}[2]{%
+  \def\@bsthanksheadpre{#1}%
+  \def\@bsthanksheadpost{#2}}
+\newcommand{\thanksfootextra}[2]{%
+  \def\thanksfootpre{#1}%
+  \def\thanksfootpost{#2}}
+
+\DeclareRobustCommand{\thanksmark}[1]{\footnotemark[#1]}
+\newcommand{\thanksgap}[1]{\hspace{#1}}
+\newcommand{\tamark}{\@thefnmark}
+
+\newlength{\thanksmarkwidth}
+\newlength{\thanksmargin}
+\newcommand{\thanksscript}[1]{\textsuperscript{#1}}
+\newcommand{\makethanksmarkhook}{}
+
+\newcommand{\thanksfootmark}{%
+  \hb@xt@\thanksmarkwidth{\hfil\normalfont\thanksscript{%
+    \thanksfootpre \tamark \thanksfootpost}}}
+
+\newcommand{\makethanksmark}{%
+  \leavevmode%
+  \makethanksmarkhook\relax
+  \parindent 1em\noindent
+  \leftskip\thanksmargin\relax
+  \advance\leftskip \thanksmarkwidth \null\nobreak\hskip -\leftskip
+  \thanksfootmark
+}
+
+\newcommand{\usethanksrule}{\let\footnoterule\thanksrule}
+\newcommand{\cancelthanksrule}{\let\footnoterule\@bsfootnoterule}
+
+\if@titlepage
+  \thanksmarkseries{arabic}    % normal footnote numbers
+\else
+  \thanksmarkseries{fnsymbol}
+\fi
+\thanksheadextra{}{}
+\thanksfootextra{}{}
+\setlength{\thanksmarkwidth}{1.8em}
+\setlength{\thanksmargin}{-\thanksmarkwidth}
+
+\AtBeginDocument{%
+  \let\thanksrule\footnoterule
+  \let\@bsfootnoterule\footnoterule
+}
+
+\newlength{\droptitle}
+\setlength{\droptitle}{0pt}
+
+\providecommand{\maketitle}{}
+\if@titlepage
+  \renewcommand{\maketitle}{\begin{titlepage}%
+    \let\footnotesize\small
+    \let\footnoterule\relax
+    \let \footnote \thanks
+    \@bsmarkseries
+      \def\@makefnmark{\rlap{\@textsuperscript{%
+         \normalfont\@bsthanksheadpre \tamark \@bsthanksheadpost}}}%
+      \long\def\@makefntext##1{\makethanksmark ##1}
+    \null\vfil
+    \vskip 60\p@
+    \vspace*{\droptitle}
+    \maketitlehooka
+    {\@bspretitle \@title \@bsposttitle}
+    \maketitlehookb
+    {\@bspreauthor \@author \@bspostauthor}
+    \maketitlehookc
+    {\@bspredate \@date \@bspostdate}
+    \maketitlehookd
+    \par
+    \@thanks
+    \vfil\null
+    \end{titlepage}%
+    \@bscontmark  %  \setcounter{footnote}{0}%
+%%%    \@bsmtitlempty
+  } % end titlepage defs
+\else
+  \renewcommand{\maketitle}{\par
+    \begingroup
+      \@bsmarkseries
+      \def\@makefnmark{\rlap{\@textsuperscript{%
+         \normalfont\@bsthanksheadpre \tamark \@bsthanksheadpost}}}%
+      \long\def\@makefntext##1{\makethanksmark ##1}
+      \if@twocolumn
+        \ifnum \col@number=\@ne
+          \@maketitle
+        \else
+          \twocolumn[\@maketitle]%
+        \fi
+      \else
+        \newpage
+        \global\@topnum\z@
+        \@maketitle
+      \fi
+      \thispagestyle{plain}\@thanks
+    \endgroup
+    \@bscontmark  %  \setcounter{footnote}{0}%
+%%%    \@bsmtitlempty
+  } % end non-titlepage
+
+  \def\@maketitle{%
+    \newpage
+    \null
+    \vskip 2em%
+          \vspace*{\droptitle}
+    \maketitlehooka
+    {\@bspretitle \@title \@bsposttitle}
+    \maketitlehookb
+    {\@bspreauthor \@author \@bspostauthor}
+    \maketitlehookc
+    {\@bspredate \@date \@bspostdate}
+    \maketitlehookd
+    \par
+    \vskip 1.5em}
+\fi
+
+\newenvironment{titlingpage}%
+  {%
+   \let\footnoterule\relax
+   \let\footnotesize\small
+   \if@twocolumn
+     \@restonecoltrue\onecolumn
+   \else
+     \@restonecolfalse
+   \fi
+   \thispagestyle{empty}
+   \setcounter{page}\@ne
+  }{%
+   \thispagestyle{empty}
+   \if@restonecol\twocolumn \else \newpage \fi
+   \if@twoside\else \setcounter{page}\@ne\fi}
+
+\newcommand{\calccentering}[2]{
+  #1 = \paperwidth
+  \advance #1 by -\textwidth
+  \divide #1 by \tw@
+  \advance #1 by -#2
+  \advance #1 by -\hoffset
+  \advance #1 by -1in
+}
+
+\newcommand{\emptythanks}{\global\let\@thanks\@empty}
+
+\newcommand{\@bsmtitlempty}{%
+  \global\let\maketitle\relax
+  \global\let\@maketitle\relax
+  \global\let\title\relax
+  \global\let\author\relax
+  \global\let\date\relax
+  \global\let\thanksmarkseries\relax
+  \global\let\thanksheadextra\relax
+  \global\let\thanksfootextra\relax
+  \global\let\thanksmark\relax
+  \global\let\thanksgap\relax
+}
+
+\newcommand{\keepthetitle}{%
+  \@bsmtitlempty
+  \global\let\thanks\relax
+  \global\let\and\relax
+  \global\let\@thanks\@empty
+  \global\let\@title\@empty
+  \global\let\@author\@empty
+  \global\let\@date\@empty
+}
+
+\providecommand{\killtitle}{}
+\renewcommand{\killtitle}{%
+  \keepthetitle
+  \global\let\thetitle\relax
+  \global\let\theauthor\relax
+  \global\let\thedate\relax
+}
+
+\providecommand{\appendiargdef}[2]{\begingroup
+  \toks@\expandafter{#1{##1}#2}%
+  \edef\@bsx{\endgroup \def\noexpand#1####1{\the\toks@}}%
+  \@bsx}
+
+\appendiargdef{\title}{%
+  \begingroup
+    \renewcommand{\thanks}[1]{}
+    \renewcommand{\thanksmark}[1]{}
+    \renewcommand{\thanksgap}[1]{}
+    \protected@xdef\thetitle{#1}
+  \endgroup}
+\appendiargdef{\author}{%
+  \begingroup
+    \renewcommand{\thanks}[1]{}
+    \renewcommand{\and}{\unskip, }
+    \renewcommand{\thanksmark}[1]{}
+    \renewcommand{\thanksgap}[1]{}
+    \protected@xdef\theauthor{#1}
+  \endgroup}
+\appendiargdef{\date}{%
+  \begingroup
+    \renewcommand{\thanks}[1]{}
+    \renewcommand{\thanksmark}[1]{}
+    \renewcommand{\thanksgap}[1]{}
+    \protected@xdef\thedate{#1}
+  \endgroup}
+
+\endinput
+%%
+%% End of file `titling.sty'.