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:
@@ -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
|
||||
|
||||
8
harbour/extras/template/core.prg
Normal file
8
harbour/extras/template/core.prg
Normal file
@@ -0,0 +1,8 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include "hbtpl.ch"
|
||||
|
||||
FUNCTION hbtpl_MyPublicFunction()
|
||||
RETURN "It works"
|
||||
10
harbour/extras/template/corec.c
Normal file
10
harbour/extras/template/corec.c
Normal file
@@ -0,0 +1,10 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include "hbapi.h"
|
||||
|
||||
HB_FUNC( HBTPL_MYPUBLICFUNCTION_IN_C )
|
||||
{
|
||||
hb_retc( "It works from C" );
|
||||
}
|
||||
12
harbour/extras/template/hbtpl.ch
Normal file
12
harbour/extras/template/hbtpl.ch
Normal file
@@ -0,0 +1,12 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef HBTPL_CH
|
||||
#define HBTPL_CH
|
||||
|
||||
#command HBTPL_PRINT <x> => ? <x>
|
||||
|
||||
#define HBTPL_MYCONSTANT 100
|
||||
|
||||
#endif
|
||||
11
harbour/extras/template/hbtpl.hbc
Normal file
11
harbour/extras/template/hbtpl.hbc
Normal 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}
|
||||
20
harbour/extras/template/hbtpl.hbp
Normal file
20
harbour/extras/template/hbtpl.hbp
Normal 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
|
||||
31
harbour/extras/template/hbtpl.hbx
Normal file
31
harbour/extras/template/hbtpl.hbx
Normal 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
|
||||
26
harbour/extras/template/readme.txt
Normal file
26
harbour/extras/template/readme.txt
Normal 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]
|
||||
7
harbour/extras/template/tests/hbmk.hbm
Normal file
7
harbour/extras/template/tests/hbmk.hbm
Normal file
@@ -0,0 +1,7 @@
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
hbtpl.hbc
|
||||
|
||||
-w3 -es2
|
||||
22
harbour/extras/template/tests/sample.prg
Normal file
22
harbour/extras/template/tests/sample.prg
Normal 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
|
||||
14
harbour/extras/template/tests/test.prg
Normal file
14
harbour/extras/template/tests/test.prg
Normal 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
|
||||
Reference in New Issue
Block a user