Hi there.
I'm trying to understand how to write a Makefile.fpc to compile a program.
I'm using the GO32V2 version of the compiler, but this process should apply to any, right? (Please correct me if I'm wrong)
This is my test program:
program MyProg;
uses
graph,
myunit;
BEGIN
sayhi;
END.
and my test unit:
unit myunit;
interface
procedure sayhi;
implementation
procedure sayhi;
begin
WriteLn('hello world');
end;
end.
and my Makefile.fpc:
[require]
unitdir=c:\pp\units\go32v2\graph
[target]
units=myunit
programs=myprog
I run "fpcmake" to generate the GNU Makefile, after which I run "make":
Linking .\Myprog .exe
myprog.pp(9,1) Warning: Object myunit.o not found, Linking nay fail !
myprog.pp(9,1) Error: Can't open object file: myunit.o
myprog.pp(9,1) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
However if I open myunit.pp with the fp.exe IDE and compile it (producing the myunit.o object) first, then obviously make finds it and succeeds.
I thought the [target] units directive in Makefile.fpc would compile myunit.o
from what I read in the documentation, but this does not seem to be the case.
Any hints will be much appreciated
