makefile problems

Maurice Lombardi Maurice.Lombardi at ujf-grenoble.fr
Fri Sep 4 10:17:31 CEST 2009


Martin Kalbfuß a écrit :
> Hi,
> 
> I'm very frustrated. I'm not able to get a working makefile for my project.
> 
> It has the following directory tree:
> 
> pallegro
>     |_src
>     |    |_pallegro.pas
>     |    |_display.pas
>     |    |_keyboard.pas
>     |    |_altime.pas
>     |    |_define.c
>     |    |_keytypes.def
>     |_Makefile
> 
> pallegro.pas depends on everything
> keyboard.pas depends on display.pas, define.c and keytypes.def
> display.pas depends on define.c
> altime.pas depends on define.c
> define.c depends on nothing
> keytypes.def depends on nothing
> 
> I'm not able to create a makefile. Especially the placement in the src directory produces problems. I get dependency problems all the time.

use the option --unit-path=src to the gpc (or gp) compiler.

BTW: do you use the automake facility of gpc ?
In principle you never need to write a makefile for gpc, compiling
with
gp pallegro.pas --automake -unit-path=src
(and some other options e.g. -O3 -g --unit-destination-path=...)
if pallegro is your main as I suppose, solves all dependencies problems.
Have you structured your program with uses or import clauses in pascal 
programs and units, and including
{$L define.c} {$L keytypes.def} and the like in the pascal source.
You seem to have some practice of C programming, and have only
an occasional job to do in pascal. Is that true ?
Doing C-in-pascal programming is a common, but inefficient, mistake in 
that case.

Maurice

-- 
        Maurice Lombardi
Laboratoire de  Spectrometrie Physique,
Universite Joseph Fourier de Grenoble, BP87
38402 Saint Martin d'Heres Cedex     FRANCE
Tel: 33 (0)4 76 51 47 51
Fax: 33 (0)4 76 63 54 95
mailto:Maurice.Lombardi at ujf-grenoble.fr





More information about the Gpc mailing list