gm2
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gm2] special dependencies


From: Gaius Mulley
Subject: Re: [Gm2] special dependencies
Date: Wed, 23 Dec 2009 16:29:27 +0000
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

Martin Kalbfuß <address@hidden> writes:

> Hi,
>
> I've created the following Makefile.am
>
> SUFFIXES = .c .mod .o
>
> M2CFLAGS = \
>       -fcheck-all \
>       -funbounded-by-reference \
>       -Wpedantic \
>       -Wpedantic-param-names \
>       -Wpedantic-cast \
>       -fcpp 
>
> sklibdir = $(libdir)/gm2/sk
>
> sklib_LIBRARIES = libsk.a
>
> libsk_a_SOURCES = \
>       SKGeneral.mod \
>       SKVideo.mod \
>       SKVersion.mod \
>       SKTime.mod
>
> sklib_HEADERS = \
>       GeneralBase.def \
>       SKGeneral.def \
>       SKVersion.def \
>       VideoBase.def \
>       SKVideo.def \
>       TimeBase.def \
>       SKTime.def
>
> SKVersion.def : config.h
> SKTime.mod : SKGeneral.def TimeBase.def
> SKVideo.mod : SKGeneral.def VideoBase.def
> SKGeneral.mod : GeneralBase.def
>
> .mod.o:
>       $(M2C) -c $(M2CFLAGS) $<
>
> MAINTAINERCLEANFILES = *~
>
> It runs fine. Like it would with C sources. The problem is, that defs
> aren't headers. They aren't included in the sources. If I change a
> definition file, the change isn't recognized by make. Is there a way to
> set the definitions as dependencies to sklib.a?
>
> Thanks.

Hi Martin,

the utility gm2m probably will help, if run with -depends it should
emit a dependency graph in Makefile format.
So for example:

$HOME/opt/bin/gm2m -depend Map.mod 
Map: Map.o RoomMap.o Geometry.o Chance.o StoreCoords.o BoxMap.o  \
     MakeBoxes.o WriteMap.o RoomMap.def WriteMap.def
Map.o: Map.mod RoomMap.def WriteMap.def
Map.mod: RoomMap.def WriteMap.def
RoomMap.o: RoomMap.def RoomMap.mod Geometry.def Chance.def  \
           StoreCoords.def BoxMap.def
RoomMap.mod: RoomMap.def Geometry.def Chance.def StoreCoords.def  \
             BoxMap.def
Geometry.o: Geometry.def Geometry.mod
Geometry.mod: Geometry.def
Chance.o: Chance.def Chance.mod
Chance.mod: Chance.def
StoreCoords.o: StoreCoords.def Chance.def StoreCoords.mod
StoreCoords.mod: StoreCoords.def Chance.def
BoxMap.o: BoxMap.def Geometry.def StoreCoords.def Chance.def  \
          BoxMap.mod MakeBoxes.def
BoxMap.mod: BoxMap.def Geometry.def MakeBoxes.def StoreCoords.def  \
            Chance.def
MakeBoxes.o: MakeBoxes.def Chance.def MakeBoxes.mod
MakeBoxes.mod: MakeBoxes.def Chance.def
WriteMap.o: WriteMap.def RoomMap.def WriteMap.mod
WriteMap.mod: WriteMap.def RoomMap.def

you should be able to include this into a Makefile which I think will
achieve what you desire?

regards,
Gaius




reply via email to

[Prev in Thread] Current Thread [Next in Thread]