From ef892a2a1e04c968a64dbaed37f2e883b049cd30 Mon Sep 17 00:00:00 2001 From: agibert Date: Mon, 20 Jan 2003 00:18:09 +0000 Subject: [PATCH] Initial release. --- demo/Makefile | 46 ++++++++++++++++++ demo/demo0.c | 119 ++++++++++++++++++++++++++++++++++++++++++++++ demo/demo0_obj.c | 82 ++++++++++++++++++++++++++++++++ demo/libdemo0_d.c | 82 ++++++++++++++++++++++++++++++++ demo/libdemo0_s.c | 82 ++++++++++++++++++++++++++++++++ 5 files changed, 411 insertions(+) create mode 100644 demo/Makefile create mode 100644 demo/demo0.c create mode 100644 demo/demo0_obj.c create mode 100644 demo/libdemo0_d.c create mode 100644 demo/libdemo0_s.c diff --git a/demo/Makefile b/demo/Makefile new file mode 100644 index 0000000..cce68b2 --- /dev/null +++ b/demo/Makefile @@ -0,0 +1,46 @@ +ifdef LIBVER_SUPPORT + DEP += ../lib/ver.h + DEP_STATIC += $(DEP) ../lib/libver.a + DEP_DYNAMIC += $(DEP) ../lib/libver.so + INCLUDE += -I ../lib + LIBDIR += -L ../lib + + ifeq ($(OSTYPE),linux-gnu) + LIB += -lver + else + LIB += -ldl -lver + endif + + FLAG += -D_LIBVER_SUPPORT +endif + +all: demo0 libdemo0_s.a libdemo0_d.so + + + +demo0_obj.o: demo0_obj.c $(DEP) Makefile + gcc -c -g -o demo0_obj.o $(FLAG) -I . $(INCLUDE) $(LIBDIR) demo0_obj.c + + + +libdemo0_s.o: libdemo0_s.c $(DEP) Makefile + gcc -c -g -o libdemo0_s.o $(FLAG) -I . $(INCLUDE) $(LIBDIR) libdemo0_s.c + +libdemo0_s.a: libdemo0_s.o + ar -r libdemo0_s.a libdemo0_s.o + + + +libdemo0_d.o: libdemo0_d.c $(DEP) Makefile + gcc -c -g -o libdemo0_d.o $(FLAG) -I . $(INCLUDE) $(LIBDIR) libdemo0_d.c + +libdemo0_d.so: libdemo0_d.o + ld -shared -o libdemo0_d.so libdemo0_d.o + + + +demo0: demo0.c $(DEP) demo0_obj.o libdemo0_s.a libdemo0_d.so Makefile + gcc -g -o demo0 $(FLAG) -I . $(INCLUDE) -I ../lib $(LIBDIR) -L . $(LIB) -ldemo0_d demo0.c libdemo0_s.a demo0_obj.o + +clean: + rm -f demo0 demo0.o demo0_obj.o libdemo0_s.o libdemo0_s.a libdemo0_d.o libdemo0_d.so diff --git a/demo/demo0.c b/demo/demo0.c new file mode 100644 index 0000000..99e704f --- /dev/null +++ b/demo/demo0.c @@ -0,0 +1,119 @@ +/*---------------------------------------------------------------------------------*/ +/* $RCSfile: demo0.c,v $ */ +/*---------------------------------------------------------------------------------*/ +/* $Revision: 1.1 $ */ +/* $Name: $ */ +/* $Date: 2003/01/20 00:18:09 $ */ +/* $Author: agibert $ */ +/*---------------------------------------------------------------------------------*/ + +/*---------------------------------------------------------------------------------*/ +/* This file is part of LibVer */ +/* */ +/* LibVer is free software; you can redistribute it and/or modify */ +/* it under the terms of the GNU General Public Licence as published by */ +/* the Free Software Foundation; either version 2 of the License, or */ +/* (at your option) any later version. */ +/* */ +/* LibVer is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU Lesser General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with Foobar; if not, write to the Free Software */ +/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +/*---------------------------------------------------------------------------------*/ + + + + + +/*---------------------------------------------------------------------------------*/ +/* Includes */ +/*---------------------------------------------------------------------------------*/ + +#include +#include + +#ifdef _LIBVER_SUPPORT +# include +#endif + + + + + + + +/*---------------------------------------------------------------------------------*/ +/* Constants */ +/*---------------------------------------------------------------------------------*/ + +#ifdef _LIBVER_SUPPORT + VER_INFO_EXPORT( demo0, "$Revision: 1.1 $", "$Name: $", __FILE__, "$Author: agibert $") +# define USAGE "Usage : %s [ --help | --version [-v]]\n" +#else +# define USAGE "Usage : %s [ --help]\n" +#endif + + + + + + + +/*---------------------------------------------------------------------------------*/ +/* Prototypes */ +/*---------------------------------------------------------------------------------*/ + +extern void obj( void); +extern void slib( void); +extern void dlib( void); + +int main( int, char **); + + + + + + + +/*---------------------------------------------------------------------------------*/ +/* */ +/*---------------------------------------------------------------------------------*/ + +int main( int argc, char **argv) +{ + /* Args Parsing */ + + if( argc >= 2) + { + if( !strcmp( argv[1], "--help")) + { + fprintf( stderr, USAGE, argv[0]); + return( 1); + } +#ifdef _LIBVER_SUPPORT + else if( !strcmp( argv[1], "--version")) + { + if( argc >= 3 && !strcmp( argv[2], "-v")) + { + return( VER_Object_Print( stdout, VERD_VERBOSE)); + } + else + { + return( VER_Object_Print( stdout, VERD_MINIMAL)); + } + } +#endif + } + + printf( "demo0_main: Start !\n"); + + obj(); + slib(); + dlib(); + + printf( "demo0_main: End !\n"); +} diff --git a/demo/demo0_obj.c b/demo/demo0_obj.c new file mode 100644 index 0000000..5928a39 --- /dev/null +++ b/demo/demo0_obj.c @@ -0,0 +1,82 @@ +/*---------------------------------------------------------------------------------*/ +/* $RCSfile: demo0_obj.c,v $ */ +/*---------------------------------------------------------------------------------*/ +/* $Revision: 1.1 $ */ +/* $Name: $ */ +/* $Date: 2003/01/20 00:18:09 $ */ +/* $Author: agibert $ */ +/*---------------------------------------------------------------------------------*/ + +/*---------------------------------------------------------------------------------*/ +/* This file is part of LibVer */ +/* */ +/* LibVer is free software; you can redistribute it and/or modify */ +/* it under the terms of the GNU General Public Licence as published by */ +/* the Free Software Foundation; either version 2 of the License, or */ +/* (at your option) any later version. */ +/* */ +/* LibVer is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU Lesser General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with Foobar; if not, write to the Free Software */ +/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +/*---------------------------------------------------------------------------------*/ + + + + + +/*---------------------------------------------------------------------------------*/ +/* Includes */ +/*---------------------------------------------------------------------------------*/ + +#include +#include + +#ifdef _LIBVER_SUPPORT +# include +#endif + + + + + + + +/*---------------------------------------------------------------------------------*/ +/* Constants */ +/*---------------------------------------------------------------------------------*/ + +#ifdef _LIBVER_SUPPORT + VER_INFO_EXPORT( demo0_obj, "$Revision: 1.1 $", "$Name: $", __FILE__, "$Author: agibert $") +#endif + + + + + + + +/*---------------------------------------------------------------------------------*/ +/* Prototypes */ +/*---------------------------------------------------------------------------------*/ + +void obj( void); + + + + + + + +/*---------------------------------------------------------------------------------*/ +/* */ +/*---------------------------------------------------------------------------------*/ + +void obj( void) +{ + printf( "demo0_obj: Hello !\n"); +} diff --git a/demo/libdemo0_d.c b/demo/libdemo0_d.c new file mode 100644 index 0000000..b9e7c2d --- /dev/null +++ b/demo/libdemo0_d.c @@ -0,0 +1,82 @@ +/*---------------------------------------------------------------------------------*/ +/* $RCSfile: libdemo0_d.c,v $ */ +/*---------------------------------------------------------------------------------*/ +/* $Revision: 1.1 $ */ +/* $Name: $ */ +/* $Date: 2003/01/20 00:18:09 $ */ +/* $Author: agibert $ */ +/*---------------------------------------------------------------------------------*/ + +/*---------------------------------------------------------------------------------*/ +/* This file is part of LibVer */ +/* */ +/* LibVer is free software; you can redistribute it and/or modify */ +/* it under the terms of the GNU General Public Licence as published by */ +/* the Free Software Foundation; either version 2 of the License, or */ +/* (at your option) any later version. */ +/* */ +/* LibVer is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU Lesser General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with Foobar; if not, write to the Free Software */ +/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +/*---------------------------------------------------------------------------------*/ + + + + + +/*---------------------------------------------------------------------------------*/ +/* Includes */ +/*---------------------------------------------------------------------------------*/ + +#include +#include + +#ifdef _LIBVER_SUPPORT +# include +#endif + + + + + + + +/*---------------------------------------------------------------------------------*/ +/* Constants */ +/*---------------------------------------------------------------------------------*/ + +#ifdef _LIBVER_SUPPORT + VER_INFO_EXPORT( libdemo0_d, "$Revision: 1.1 $", "$Name: $", __FILE__, "$Author: agibert $") +#endif + + + + + + + +/*---------------------------------------------------------------------------------*/ +/* Prototypes */ +/*---------------------------------------------------------------------------------*/ + +void dlib( void); + + + + + + + +/*---------------------------------------------------------------------------------*/ +/* */ +/*---------------------------------------------------------------------------------*/ + +void dlib( void) +{ + printf( "demo0_dlib: Hello !\n"); +} diff --git a/demo/libdemo0_s.c b/demo/libdemo0_s.c new file mode 100644 index 0000000..aac130f --- /dev/null +++ b/demo/libdemo0_s.c @@ -0,0 +1,82 @@ +/*---------------------------------------------------------------------------------*/ +/* $RCSfile: libdemo0_s.c,v $ */ +/*---------------------------------------------------------------------------------*/ +/* $Revision: 1.1 $ */ +/* $Name: $ */ +/* $Date: 2003/01/20 00:18:09 $ */ +/* $Author: agibert $ */ +/*---------------------------------------------------------------------------------*/ + +/*---------------------------------------------------------------------------------*/ +/* This file is part of LibVer */ +/* */ +/* LibVer is free software; you can redistribute it and/or modify */ +/* it under the terms of the GNU General Public Licence as published by */ +/* the Free Software Foundation; either version 2 of the License, or */ +/* (at your option) any later version. */ +/* */ +/* LibVer is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU Lesser General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with Foobar; if not, write to the Free Software */ +/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +/*---------------------------------------------------------------------------------*/ + + + + + +/*---------------------------------------------------------------------------------*/ +/* Includes */ +/*---------------------------------------------------------------------------------*/ + +#include +#include + +#ifdef _LIBVER_SUPPORT +# include +#endif + + + + + + + +/*---------------------------------------------------------------------------------*/ +/* Constants */ +/*---------------------------------------------------------------------------------*/ + +#ifdef _LIBVER_SUPPORT + VER_INFO_EXPORT( libdemo0_s, "$Revision: 1.1 $", "$Name: $", __FILE__, "$Author: agibert $") +#endif + + + + + + + +/*---------------------------------------------------------------------------------*/ +/* Prototypes */ +/*---------------------------------------------------------------------------------*/ + +void slib( void); + + + + + + + +/*---------------------------------------------------------------------------------*/ +/* */ +/*---------------------------------------------------------------------------------*/ + +void slib( void) +{ + printf( "demo0_slib: Hello !\n"); +}