automake
[Top][All Lists]
Advanced

[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)

EXPORT_INCLUDES=$(INCLUDES)
EXPORT_LIBRARIES=liboimsg.a

include bby.mk


---------------------------------------------------------------------------------------------

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
ne)
   touch dict.stamp
   rm -rf tmp

CXXFLAGS = -Wall -O

$(COMPILER):
   # 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 \
                   oiFields

OI_COMPILER =   ../src/oimsg

sourcefiles:
   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

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

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.

thanks.

Gary.







reply via email to

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