I want to use makefile to create my app and .out file and use it in my verifone vx520.
I have makeapp.bat for creating .out file but when I run it get this error: NMAKE : fatal error U1073: don't know how to make 'utils.h'
and this is makeapp.bat file:
@goto Begin
:Begin
@set OLDPATH=%PATH%
@rem set VRXSDKS to the Verix V SDK directory
@set VRXSDK=C:\eVoAps\SDK\1.2.0\VRXSDK
@rem Set RVCTDIR to RVDS2.2
@set RVCTDIR=C:\Program Files\ARM\RVCT\Programs\2.2\349\win_32-pentium
@rem or, Set RVCTDIR to RVDS2.1
@rem set RVCTDIR=C:\Program Files\ARM\RVCT\Programs\2.0.1\277\win_32-pentium
@set PATH=%VRXSDK%\bin\;%RVCTDIR%;%OLDPATH%
@rem use app.mak to buid application
nmake /f app.mak
@rem or, use vrxcc directly here to build a simple application
@rem %VRXSDK%\bin\vrxcc app.c
@set PATH=%OLDPATH%
@set RVCTDIR=
pause
how can i solve that error?
So, it looks to me like your bat file here has lots of comments (@rem) and it also sets several variables (@set), but the bulk of the work will be done in the line
which will reference a different file called
app.mak
. That's where the magic happens and it's where you will need to edit something to letnmake
know how to compile and linkutils.h
. I suggest you look at c2.com/cgi/wiki?UsingNmake for more details.As you know, a make file is, for all intents and purposes, a program that you write. When it runs, it builds the VeriFone app (or whatever other program you were working on). As such, there is a multitude of things you can do, some of which you must do if you want nmake to actually build your program. I think the best way to help out would be to share parts of my make file. Note that this started off as just a template from a sample VeriFone project.
Mine starts off just declaring variables, paths, etc., like so:
Note that
TerminalType
is something I have set Visual Studio to pass into NMAKE when it initiates a build and it is based on my solution configuration. Technically, I have 1 make file calling another and the outer one is setting it like this:TerminalType=$(Configuration)
. You'll see this variable again below as well as a couple others that are similar.Next, I define some compiler options
The
-D
flag defines things in my code as if I had done a#define
. This is useful for turning parts on or off depending one what I'm compiling for. Unless you plan to do that, you won't need to do it yourself. The important part here for anyone compiling for eVo terminals is theCompilerCompatibility
which sets a-p
flag (must be off for Verix V, must be on for for eVo terminals).Now we consolidate everything we've done thus far into 2 variables:
OK, now here's the part I suspect you are tripping up on: we need to define our dependencies, which I do like so:
This could all go on one line, if we wanted to. The
\
at the end of each line just means we are breaking that single line up which is done here for readability. Otherwise, it would look like this:OK, so this
AppObjects
will be used when we do our linking. First, however, I also want to tell NMAKE to run the file signing program and then copy the files over where I want them.Now let's define how we will do the linking:
...and build the .res file...
and now we can actually run the compilation:
And that's the last line--there is no other fanfare or what-have-you.
I would like to point something out that you may have noticed, but threw me for a loop when I was getting started on all of this: we kinda' do everything backwards. If I were telling a person how to build the project, I would start by telling them how to compile everything to it's
.o
file first, but that's the last step in a make file. Next, I would tell a person how to do the linking, but that's the 2nd to last step, and so on.If you still need more info, visit the link I included--it's way more authoritative than I am and includes a lot of details I probably missed. Hopefully this is enough to get you going, though.