顯示具有 Makefile 標籤的文章。 顯示所有文章
顯示具有 Makefile 標籤的文章。 顯示所有文章

2016年9月1日 星期四

2016年6月15日 星期三

[Makefile] Automatic Variables

Automatic variables are set by make after a rule is matched. There include:

    $@: the target filename.
    $*: the target filename without the file extension.
    $<: the first prerequisite filename.
    $^: the filenames of all the prerequisites, separated by spaces, discard duplicates.
    $+: similar to $^, but includes duplicates.
    $?: the names of all prerequisites that are newer than the target, separated by spaces.

Reference:

2015年4月2日 星期四

2015年3月15日 星期日

2014年11月6日 星期四

[autoconf] Use autoconf to generate configure


1. Remove all Makefile

2.

autoscan

mv configure.scan configure.ac

3.

vim configure.ac

AC_INIT(FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS) –> AC_INIT(pippo, 2.6, paperino@staff.pippo.org)

4.

autoconf

This produces one files: configure

5.

vim Makefile.am

6.

vim configure.ac

check –> AM_INIT_AUTOMAKE(pippo, 2.6) & AC_OUTPUT(Makefile src/Makefile)

7.

aclocal

Reference:

1. A tutorial for porting to autoconf & automake

2014年2月5日 星期三

2014年1月27日 星期一

[Makefile] Debug share library (*.so) can't share

[Makefile] Debug share library (*.so) can't share



The following command can show lot of error message.

[root@localhost lib]# eu-findtextrel libwvutils.so



/home/luke/20140114-09-26-puma5/UBEE_D3_CableRG/Porting/Source/APP/Software_Module/WVDial/src/test4/wvdial/EMBED/TARGET/wvstreams-4.6.1/argp/argp-help.c not compiled with -fpic/-fPIC



/home/luke/20140114-09-26-puma5/UBEE_D3_CableRG/Porting/Source/APP/Software_Module/WVDial/src/test4/wvdial/EMBED/TARGET/wvstreams-4.6.1/argp/argp-help.c not compiled with -fpic/-fPIC



either the file containing the function '_ZTS17WvWordWrapEncoder' or the file containing the function '' is not compiled with -fpic/-fPIC either the file containing the function '_ZTS17WvWordWrapEncoder' or the file containing the function '' is not compiled with -fpic/-fPIC either the file containing the function '_ZTS17WvWordWrapEncoder' or the file containing the function '' is not compiled with -fpic/-fPIC either the file containing the function '_ZTS17WvWordWrapEncoder' or the file containing the function '' is not compiled with -fpic/-fPIC either the file containing the function '_ZTS17WvWordWrapEncoder' or the file containing the function '' is not compiled with -fpic/-fPIC either the file containing the function '_ZTS17WvWordWrapEncoder' or the file containing the function '' is not compiled with -fpic/-fPIC either the file containing the function '_ZTS17WvWordWrapEncoder' or the file containing the function '' is not compiled with -fpic/-fPIC either the file containing the function '_ZTS17WvWordWrapEncoder' or the file containing the function '' is not compiled with -fpic/-fPIC either the file containing the function '_ZTS17WvWordWrapEncoder' or the file containing the function '' is not compiled with -fpic/-fPIC either the file containing the function '_ZTS17WvWordWrapEncoder' or the file containing the function '' is not compiled with -fpic/-fPIC either the file containing the function '_ZTS17WvWordWrapEncoder' or the file containing the function '' is not compiled with -fpic/-fPIC either the file containing the function '_ZTS17WvWordWrapEncoder' or the file containing the function '' is not compiled with -fpic/-fPIC either the file containing the function '_ZTS17WvWordWrapEncoder' or the file containing the function '' is not compiled with -fpic/-fPIC either the file containing the function '_ZTS17WvWordWrapEncoder' or the file containing the function '' is not compiled with -fpic/-fPIC either the file containing the function '_ZTS17WvWordWrapEncoder' or the file containing the function '' is not compiled with -fpic/-fPIC either the file containing the function '_ZTS17WvWordWrapEncoder' or the file containing the function '' is not compiled with -fpic/-fPIC either the file containing the function '_ZTS17WvWordWrapEncoder' or the file containing the function '' is not compiled with -fpic/-fPIC either the file containing the function '_ZTS17WvWordWrapEncoder' or the file containing the function '' is not compiled with -fpic/-fPIC either the file containing the function '_ZTS17WvWordWrapEncoder' or the file containing the function '' is not compiled with -fpic/-fPIC either the file containing the function '_ZTS17WvWordWrapEncoder' or the file containing the function '' is not compiled with -fpic/-fPIC either the file containing the function '_ZTS17WvWordWrapEncoder' or the file containing the function '' is not compiled with -fpic/-fPIC either the file containing the function '_ZTS17WvWordWrapEncoder' or the file containing the function '' is not compiled with -fpic/-fPIC either the file containing the function '_ZTS17WvWordWrapEncoder' or the file containing the function '' is not compiled with -fpic/-fPIC either the file containing the function '_ZTS17WvWordWrapEncoder' or the file containing the function '' is not compiled with -fpic/-fPIC either the file containing the function '_ZTS17WvWordWrapEncoder' or the file containing the function '' is not compiled with -fpic/-fPIC either the file containing the function '_ZTS17WvWordWrapEncoder' or the file containing the function '' is not compiled with -fpic/-fPIC either the file containing the function '_ZTS17WvWordWrapEncoder' or the file containing the function '' is not compiled with -fpic/-fPIC

2014年1月24日 星期五

[Makefile][Configure] How to use helloworld_cc-0.5 to add my parameter


helloworld_cc-0.5.tar.gz

1. Following patch is my code change

--- test/helloworld_cc-0.5/configure    2010-05-10 23:16:53.000000000 +0800
+++ helloworld_cc-0.51/configure    2014-01-25 08:42:56.448166263 +0800

@@ -625,6 +625,7 @@
 datarootdir
 libexecdir
 sbindir
+happy
 bindir
 program_transform_name
 prefix

@@ -682,6 +683,7 @@
 # Use braces instead of parens because sh, perl, etc. also accept them.
 # (The list follows the same order as the GNU Coding Standards.)
 bindir='${exec_prefix}/bin'
+happy='${exec_prefix}/bin'
 sbindir='${exec_prefix}/sbin'
 libexecdir='${exec_prefix}/libexec'
 datarootdir='${prefix}/share'

@@ -728,6 +730,11 @@
   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
     bindir=$ac_optarg ;;
+  -happy | --happy )
+    ac_prev=happy ;;
+  -happy=* | --happy=* )
+    happy=$ac_optarg ;;
+
   -build | --build | --buil | --bui | --bu)
     ac_prev=build_alias ;;
   -build=* | --build=* | --buil=* | --bui=* | --bu=*)

@@ -1074,7 +1081,7 @@
 fi
 # Check all directory arguments for consistency.
-for ac_var in    exec_prefix prefix bindir sbindir libexecdir datarootdir \
+for ac_var in    exec_prefix prefix bindir happy sbindir libexecdir datarootdir \
         datadir sysconfdir sharedstatedir localstatedir includedir \
         oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
         libdir localedir mandir

@@ -1227,6 +1234,7 @@
 Fine tuning of the installation directories:
   --bindir=DIR            user executables [EPREFIX/bin]
+  --happy=DIR             happy
   --sbindir=DIR           system admin executables [EPREFIX/sbin]
   --libexecdir=DIR        program executables [EPREFIX/libexec]
   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]

--- test/helloworld_cc-0.5/Makefile.in    2010-05-10 23:16:54.000000000 +0800
+++ helloworld_cc-0.51/Makefile.in    2014-01-25 08:56:20.540132447 +0800

@@ -137,6 +137,7 @@
 am__tar = @am__tar@
 am__untar = @am__untar@
 bindir = @bindir@
+happy = @happy@
 build_alias = @build_alias@
 builddir = @builddir@
 datadir = @datadir@

2. Patch the code change, and type ./configure.


vim Makefile will see the parameter about happy.


configure to make Makefile just need 5 file

config.h.in

configure

configure.ac

install-sh

Makefile.in


Reference:

2014年1月22日 星期三

[Makefile][configure] How to create configure file to create Makefile


[Makefile][configure] How to create configure file to create Makefile

You may download the helloworld_cc-0.5.tar.gz tar archive of the simple example project.

To change the helloworld_cc to fit you code.



Tutor:



1. 「Makefile」「Configure」 How to use helloworld_cc-0.5 to add my parameter





Reference:

Using Automake and Autoconf with C++


2013年10月29日 星期二

2013年6月17日 星期一

2013年6月9日 星期日

[Makefile] How to make menuconfig to work

[make menuconfig] How to make menuconfig to work

"Make menuconfig" can learn how to create .config



Download the code from "Code gooogle".



The command like below.

svn checkout http://menuconfig.googlecode.com/svn/trunk/ menuconfig-read-only



My github have some comment in Readme.

https://github.com/freeman2004/make_menuconfig



Makefile will according to Config.in to create .config



Reference:


2013年3月28日 星期四

[Make][Cross Compile][Embedded System] Cross compile need to be care 

Careful the PATH , CROSS

If have compiler issue

make V=1 <-- This will show more error message


Build up a virtual machine as same as target machine.

Do experiment on the virtual machine.

My target machine is Fedora12, so I build up Fedora 12  virtual machine.

Cross compile at virtual machine is OK. But target is NO.

Try to compare what different between virtual and target machine.

2013年1月16日 星期三

2012年11月1日 星期四

[Makefile] How to replace +:= to another way

[Makefile] How to replace +:= to another way



gcc version 4.4.4 20100630 (Red Hat 4.4.4-10) (GCC) (Fedora 12)



Fedora 12 can recognize +:=

But Fedora 17 can't recognize.



Happy := a.o

Happy +:= b.o



gcc version 4.7.2 20120921 (Red Hat 4.7.2-2) (GCC) (Fedora 17)



So Fedora 17 must change another way to do this.



Happy := a.o

Happy := $(Happy) b.o

2012年10月8日 星期一

2012年8月11日 星期六

[Laxte][multibib] How to make multibib (multiple bibliographies in one document) work


[Laxte][multibib] How to make multibib (multiple bibliographies in one document) work



How to get multibib package1




  1. Get the package that you want from the Comprehensive Tex Archive Network CTAN http://ctan.org/

    Get useful package multibib  http://ctan.org/tex-archive/macros/latex/contrib/multibib.


  2. Download multibib.zip and unzip the zip file.


  3. Run latex on the .ins file, which should create a file called .sty

    $ latex multibib.ins


  4. Make a directory for it to go in in your texmf tree

    $ sudo mkdir /usr/share/texmf/tex/latex/multibib


  5. Put it in that directory

    $ sudo cp multibib.sty /usr/share/texmf/tex/latex/multibib


  6. Run texhash to tell LaTeX to update itself so it finds the new package

    $ sudo texhash



How to use it



In preamble



\usepackage{multibib}

\newcites{FreeRadius}{FreeRadius}   % Title FreeRadius    % Title {tag}{Title}

\newcites{OpenSSL}{OpenSSL}         % Title OpenSSL

 



In context

The blue one must like tag which define in \newcites{FreeRadius}{FreeRadius}



\renewcommand\refname{FreeRadius}

\nociteFreeRadius{*}  % Display bib with cite

\bibliographystyleFreeRadius{plain}    % (uses file "plain.bst")

\bibliographyFreeRadius{./data/Package/Source_code/Radius-server-ubuntu-10.04/FreeRadius.bib}        % expects file "test3.bib"





\renewcommand\refname{OpenSSL}

\nociteOpenSSL{*}  % Display bib with cite

\bibliographystyleOpenSSL{plain}    % (uses file "plain.bst")

\bibliographyOpenSSL{./data/Package/Source_code/Radius-server-ubuntu-10.04/OpenSSL.bib}        % expects file "test3.bib"



Download bib example



FreeRadius.bib


OpenSSL.bib



How to make font size small or big



Must use with package numbers



\usepackage[numbers]{natbib}

%\renewcommand{\bibfont}{\tiny}

% reference name change

\renewcommand{\refname}{}  

% Change List font size

% adjust number to change font size







\renewcommand{\bibfont}{\fontsize{6pt}{8pt}\selectfont}



\usepackage{multibib}

\newcites{FreeRadius}{FreeRadius}   % Title FreeRadius % Title {tag}{Title}

\newcites{OpenSSL}{OpenSSL}         % Title OpenSSL



 



How to compile



Make a make file to do complex job.



filename=TI_20120101



pdf: ps

    ps2pdf ${filename}.ps



ps: dvi

    dvips ${filename}.dvi



dvi:

    xelatex ${filename}

    bibtex ${filename}

    bibtex OpenSSL

    bibtex FreeRadius   % Compile using tag which define \newcites{FreeRadius}{FreeRadius in  at this place.  Blue one is title name.

    xelatex ${filename}

    xelatex ${filename}



read:

    evince ${filename}.pdf &



aread:

    acroread ${filename}.pdf &



clean:

    rm -f ${filename}.ps ${filename}.log ${filename}.aux ${filename}.out ${filename}.dvi ${filename}.bbl ${filename}.blg ${filename}.toc ${filename}.lof



 



Reference :




  1. Adding a new package to a latex install on linux