News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Using my own hhf's

Started by Druesukker, April 19, 2011, 11:54:12 AM

Previous topic - Next topic

Druesukker

Hello  everyone  :bg

I have created a little project using 2 hla files and 1 hhf file.

Every time i want to compile my project i have to type : hla TestUnit.hla MyUnit.obj

Does anyone know how i can treat my own hhf's as the hhf'f in the stdlib ?
And get away with typing: hla TestUnit to compile and link my project.

The 3 files are here:


// declares one function which returns a value in eax
unit MyUnit;
#includeonce( "stdout.hhf" )
#includeonce( "stdin.hhf" )
#includeonce( "MyHeader.hhf" )

procedure HeaderFileName.TestProcedure; @noframe; @nodisplay;
/*
No parms
--------
returns value in eax
*/
begin TestProcedure;

stdout.put( "Hello from unit!" nl );
mov( -23, eax );

ret( );
end TestProcedure;

end MyUnit;


// Program to test using my own header files
program TestUnit;
#includeonce( "stdout.hhf" )
#includeonce( "stdin.hhf" )
#includeonce( "MyHeader.hhf" ) // my own hhf

begin TestUnit;

call( HeaderFileName.TestProcedure );
// Output the value in eax from the function TestProcedure
stdout.put( "Teh value returned: ", ( type int32 eax ), nl );

end TestUnit;


// the header file with one procedure declaration
namespace HeaderFileName;

procedure TestProcedure; external( "My_Test_Procedure" );

end HeaderFileName;


I hope someone can help me since i will get tired of having to add
50 hhf's every time i want to compile my projects hehe.  :8)

Druesukker

I created a make file to solve the problem:


# Standard makefile.

# This tells that TestHeader depends on the
# TestHeader.obj and Unit.obj :
TheFile.exe: TestHeader.obj Unit.obj
hla -x:TheFile.exe TestHeader.obj Unit.obj

# if TestHeader.hla is newer than TestHeader.obj then this will be executed
# Note that TestHeader depends on MyHeader.hhf too
TestHeader.obj: TestHeader.hla MyHeader.hhf
hla -c TestHeader.hla

# if Unit.hla is newer than Unit.obj then this will be executed
# Note that TestHeader depends on MyHeader.hhf too
Unit.obj: Unit.hla MyHeader.hhf
hla -c Unit.hla