Initial release.
This commit is contained in:
parent
1997bf1a74
commit
ef892a2a1e
46
demo/Makefile
Normal file
46
demo/Makefile
Normal file
@ -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
|
119
demo/demo0.c
Normal file
119
demo/demo0.c
Normal file
@ -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 <stdio.h>
|
||||
#include <errno.h>
|
||||
|
||||
#ifdef _LIBVER_SUPPORT
|
||||
# include <ver.h>
|
||||
#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");
|
||||
}
|
82
demo/demo0_obj.c
Normal file
82
demo/demo0_obj.c
Normal file
@ -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 <stdio.h>
|
||||
#include <errno.h>
|
||||
|
||||
#ifdef _LIBVER_SUPPORT
|
||||
# include <ver.h>
|
||||
#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");
|
||||
}
|
82
demo/libdemo0_d.c
Normal file
82
demo/libdemo0_d.c
Normal file
@ -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 <stdio.h>
|
||||
#include <errno.h>
|
||||
|
||||
#ifdef _LIBVER_SUPPORT
|
||||
# include <ver.h>
|
||||
#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");
|
||||
}
|
82
demo/libdemo0_s.c
Normal file
82
demo/libdemo0_s.c
Normal file
@ -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 <stdio.h>
|
||||
#include <errno.h>
|
||||
|
||||
#ifdef _LIBVER_SUPPORT
|
||||
# include <ver.h>
|
||||
#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");
|
||||
}
|
Loading…
Reference in New Issue
Block a user