[Top][All Lists]

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

how to build generated files?

From: Gary Hughes
Subject: how to build generated files?
Date: Tue, 19 Feb 2002 12:53:49 +1100
User-agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:0.9.8) Gecko/20020204

Hi I am currently converting a heap of stuff from custom make system to the GNU autotools, most things are really easy to convert however...

I have a couple of modules that use homegrown compilers to generate multiple .cpp and .h files from specification files.

Here is the original make file.


DICTIONARY := oiMsgs oiMsgGroups oiFields

-include sourcefiles

oimsg_src := $(SOURCE_FILES)
oimsg_hdr := $(HEADER_FILES)

LIBRARY := oimsg
INCLUDES := $(oimsg_hdr) OITypes.h OITypedefs.h

EXTRA_GENERATED := $(oimsg_src) $(oimsg_hdr)




This is my attempt at an automake .am file.

COMPILER= ../src/oimsg

sourcefiles $(oimsg_src) $(oimsg_hdr): dict.stamp

dict.stamp:$(DICTIONARY) $(COMPILER)
   mkdir -p tmp
   cp $(DICTIONARY) tmp/
(cd tmp && ../$(COMPILER) $(DICTIONARY) && for i in *; do cmp -s $$i ../$$i || (echo Updating $$i ; mv $$i ../) ; do
   touch dict.stamp
   rm -rf tmp


   # Do nothing to stop stupid recursive rules applying


The file 'sourcefiles' is also generated by the compiler and contains declarations for SOURCE_FILES and HEADER_FILES with all the source and header files the compiler generated in the appropriate variable.

Here is my attempt at getting this working with automake.

include $(top_srcdir)/../Make.include

OI_DICTIONARY   =   oiMsgs \
                   oiMsgGroups \

OI_COMPILER =   ../src/oimsg

   mkdir -p tmp
   cp $(OI_DICTIONARY) tmp/
(cd tmp && ../$(OI_COMPILER) $(OI_DICTIONARY) && for i in *; do cmp -s $$i ../$$i || (echo Updating $$i ; mv $$i ../
) ; done)
   touch dict.stamp
   rm -rf tmp

lib_LTLIBRARIES             =

liboimsg_la_DEPENDENCIES    =   $(OI_DICTIONARY) \
                               $(OI_COMPILER) \

liboimsg_la_SOURCES         =   $(wildcard *.cpp)

include_HEADERS             =   $(wildcard *.h)

The problem is that during a 'make install' all the headers are picked up ok, during a make however none of the cpp files are being picked up even if I have run the compiler myself so they are sitting in the directory before make is run.

Can anyone offer any assistance with this? I'm not a make expert by any means and I'm very new to the autotools, any help is greatly appreciated.



reply via email to

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