2012-12-06 14:36 UTC+0100 Viktor Szakats (harbour syenar.net)

+ extras/template
  + extras/template/core.prg
  + extras/template/corec.c
  + extras/template/hbtpl.ch
  + extras/template/hbtpl.hbc
  + extras/template/hbtpl.hbp
  + extras/template/hbtpl.hbx
  + extras/template/readme.txt
  + extras/template/tests
  + extras/template/tests/hbmk.hbm
  + extras/template/tests/sample.prg
  + extras/template/tests/test.prg
    + added Harbour library project template
      it supports static and dynamic lib build mode,
      features user defined macro, command, PRG
      level function and C level function, sample
      code, regression tests, .hbc file and automatic
      installation to /addons and readme describing
      the commands to build and use the library.
This commit is contained in:
Viktor Szakats
2012-12-06 13:43:09 +00:00
parent 0700195f82
commit 984c1cf461
11 changed files with 182 additions and 0 deletions

View File

@@ -10,6 +10,27 @@
* Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment
*/
2012-12-06 14:36 UTC+0100 Viktor Szakats (harbour syenar.net)
+ extras/template
+ extras/template/core.prg
+ extras/template/corec.c
+ extras/template/hbtpl.ch
+ extras/template/hbtpl.hbc
+ extras/template/hbtpl.hbp
+ extras/template/hbtpl.hbx
+ extras/template/readme.txt
+ extras/template/tests
+ extras/template/tests/hbmk.hbm
+ extras/template/tests/sample.prg
+ extras/template/tests/test.prg
+ added Harbour library project template
it supports static and dynamic lib build mode,
features user defined macro, command, PRG
level function and C level function, sample
code, regression tests, .hbc file and automatic
installation to /addons and readme describing
the commands to build and use the library.
2012-12-06 04:27 UTC+0100 Viktor Szakats (harbour syenar.net)
* contrib/hbrun/hbrun.hbp
! load dynamically loaded hbunix/hbwin default extensions

View File

@@ -0,0 +1,8 @@
/*
* $Id$
*/
#include "hbtpl.ch"
FUNCTION hbtpl_MyPublicFunction()
RETURN "It works"

View File

@@ -0,0 +1,10 @@
/*
* $Id$
*/
#include "hbapi.h"
HB_FUNC( HBTPL_MYPUBLICFUNCTION_IN_C )
{
hb_retc( "It works from C" );
}

View File

@@ -0,0 +1,12 @@
/*
* $Id$
*/
#ifndef HBTPL_CH
#define HBTPL_CH
#command HBTPL_PRINT <x> => ? <x>
#define HBTPL_MYCONSTANT 100
#endif

View File

@@ -0,0 +1,11 @@
#
# $Id$
#
description=Harbour library project template
incpaths=.
headers=${hb_name}.ch
libpaths=lib/${hb_plat}/${hb_comp}
libs=${hb_name}

View File

@@ -0,0 +1,20 @@
#
# $Id$
#
# Project build file
-hblib
-inc
-olib/${hb_plat}/${hb_comp}/${hb_name}
-w3 -es2
core.prg
corec.c
-hbx=${hb_name}.hbx
${hb_name}.hbx
$hb_pkg_dynlib.hbm
$hb_pkg_install.hbm

View File

@@ -0,0 +1,31 @@
/* --------------------------------------------------------------------
* NOTE: You can add manual override which functions to include or
* exclude from automatically generated EXTERNAL/DYNAMIC list.
* Syntax: // HB_FUNC_INCLUDE <func>
* // HB_FUNC_EXCLUDE <func>
*/
/* --------------------------------------------------------------------
* WARNING: Automatically generated code below. DO NOT EDIT!
* Regenerate using hbmk2 '-hbx=' option.
*/
#ifndef __HBEXTERN_CH__HBTPL__
#define __HBEXTERN_CH__HBTPL__
#if defined( __HBEXTREQ__ ) .OR. defined( __HBEXTERN__HBTPL__ANNOUNCE )
ANNOUNCE __HBEXTERN__HBTPL__
#endif
#if defined( __HBEXTREQ__ ) .OR. defined( __HBEXTERN__HBTPL__REQUEST )
#command DYNAMIC <fncs,...> => EXTERNAL <fncs>
#endif
DYNAMIC hbtpl_MyPublicFunction
DYNAMIC hbtpl_MyPublicFunction_In_C
#if defined( __HBEXTREQ__ ) .OR. defined( __HBEXTERN__HBTPL__REQUEST )
#uncommand DYNAMIC <fncs,...> => EXTERNAL <fncs>
#endif
#endif

View File

@@ -0,0 +1,26 @@
/*
* $Id$
*/
Harbour library project template
================================
Build static lib:
$ hbmk2 hbtpl.hbp
Build dynamic lib:
$ hbmk2 -hbdyn hbtpl.hbp
Build sample and test code using:
$ cd tests
$ hbmk2 sample
$ sample
$ hbmk2 test hbtest.hbc
$ test
Run sample and test code using:
$ hbrun tests/sample.prg
$ hbrun tests/test.prg
[vszakats]

View File

@@ -0,0 +1,7 @@
#
# $Id$
#
hbtpl.hbc
-w3 -es2

View File

@@ -0,0 +1,22 @@
/*
* $Id$
*/
#require "hbtpl"
PROCEDURE Main()
// Public API
? hbtpl_MyPublicFunction()
? hbtpl_MyPublicFunction_In_C()
// Public constants
? HBTPL_MYCONSTANT
// Public commands
HBTPL_PRINT "Hello"
RETURN

View File

@@ -0,0 +1,14 @@
/*
* $Id$
*/
#require "hbtpl"
#require "hbtest"
PROCEDURE Main()
HBTEST hbtpl_MyPublicFunction() IS "It works"
HBTEST hbtpl_MyPublicFunction_In_C() IS "It works from C"
HBTEST HBTPL_MYCONSTANT IS 100
RETURN