Page 1 of 1

How to Change source directory

Posted: Sat Nov 12, 2016 8:13 pm
by bluebird
New and Blue

My prg files build successfully residing in the c:\hmg3.4.3\mysourcecode directory using "..\build myprog.prg"

However, I want to put files together in a sub-directory off mySourceCode - as in c:\hmg3.4.3\mysourcecode \ProjectXZY

Looking at the HMG SAMPLES directory, there are complex (for me) batch files that work for samples in the SAMPLES directory.

How can I most easily make a batch file for my own subdirectory? Just moving BUILD.BAT does not do it.

Thanks

How to Change source directory

Posted: Sat Nov 12, 2016 8:23 pm
by Pablo César
In my mind it's hard to put all your projects inside HMG installation folder. :shock:

I use to separate my projects in "My_Sources" and then I make subdirectories for each project.

Any way, I believe you can based on Build.bat of any HMG in SAMPLES directory. But you will need replace SAMPLES by mysourcecode (no spaces or must be quoted). I do not tested, but I believe it can works (if you have .hbp file ofcourse) in each your project.

I use much IDE. So easy and practical.

Re: How to Change source directory

Posted: Sat Nov 12, 2016 9:19 pm
by KDJ
bluebird

In your project directory (c:\hmg3.4.3\mysourcecode\ProjectXZY), create build.cmd file with contents:

Code: Select all

call c:\hmg3.4.3\build.bat myprog.hbp
and create myprog.hbp file with contents (# - it is comment line):

Code: Select all

#harbour options:
#-w3

#hbmk2 options:
#-compr

#sources:
myprog.prg
#myprog1.prg
#myprog2.prg
And run build.cmd.

Re: How to Change source directory

Posted: Sun Nov 13, 2016 1:32 am
by dragancesu
Easy, add c:\hmg3.4.3 to PATH
and use build myprog.hbp

Re: How to Change source directory

Posted: Sun Nov 13, 2016 5:39 pm
by bluebird
Kind Friend,
please correct this amateur batch file attempt to build mtxtest.hbp which resides in MySourceCode\mtxtestDir
Tel SET Temp1= line comes from the build files in \SAMPLES. I thought it meant the current directory .

BuildMtx.Bat contains

cls
SET Temp1=%~dp0
set PATH=c:\hmg3.4.3
build.bat mtxtest.hbp

Re: How to Change source directory

Posted: Sun Nov 13, 2016 6:35 pm
by andyglezl
Hola

La manera mas facíl ( para mí ), es crear un .bat en cada carpeta que tenga un proyecto
para compilar, con lo siguiente:

c.bat
******************************************
echo off
cls
D:\HMG\3.4.3\build agl-shell
******************************************

en donde solo cambio el nombre del programa principal.
------------------------------------------------------------------------------------------------------------
Hello

The easiest way (for me) is to create a .bat in every folder that has a project
To compile, with the following:

c.bat
******************************************
echo off
cls
D:\HMG\3.4.3\build agl-shell
******************************************

Where only the name of the main program changes.

Compilar.jpg
Compilar.jpg (153.38 KiB) Viewed 4972 times


If I change version of HMG, I only add
c.bat
******************************************
echo off
cls
rem D:\HMG\3.4.3\build agl-shell
D:\HMG\3.x.x\build agl-shell
******************************************

Re: How to Change source directory

Posted: Mon Nov 14, 2016 9:53 am
by chrisjx2002
I create a compile.bat with this line in the directory of the prg programm

FOR %%x IN (*.prg) DO (CALL c:\hmg.3.4.3\build.bat %%x )

It looks for all prg files in the current directory and compile them. You can replace prg by hbp.

That's all!