LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-31-2023, 10:13 AM   #1
myrdos2
LQ Newbie
 
Registered: May 2007
Posts: 12

Rep: Reputation: 0
Automake config where one program generates the source for another.


I have an autotools project with a library that relies on machine-generated code for one of its source files. The program that generates the code is called mathgen. I've got mathgen as a NOINST program in Makefile.am.

Whenever one of mathgen's source files changes, automake needs to rebuild it, run the resulting executable to generate the library's source files, and then build the library. How can I tell it to do that? Is it even possible?

Here's the complete Makefile.am:
Code:
## Process this file with automake to produce Makefile.in

AUTOMAKE_OPTIONS = subdir-objects
AM_CXXFLAGS = -std=c++17 -Wall -O2 -g -DDEBUGMODE
AM_CPPFLAGS = -DSM_DEBUGMODE
LDADD = libstonem.a

lib_LIBRARIES = libstonem.a

libstonem_a_SOURCES = libstonem/StoneInterpreter.cpp \
	libstonem/StoneResult.cpp \
	libstonem/SM_MemoryCount.cpp \
	libstonem/instructions/SM_ArithmeticOp.cpp \
	libstonem/instructions/arithmetic_funcs/SM_ArithmeticOpFuncs.cpp \
	libstonem/instructions/SM_Assign.cpp \
	libstonem/instructions/SM_New.cpp \
	libstonem/instructions/SM_Instruction.cpp \
	libstonem/instructions/SM_Return.cpp \
	libstonem/instructions/SM_ReturnValue.cpp \
	libstonem/instructions/SM_Stack.cpp \
	libstonem/variables/SM_Constant.cpp \
	libstonem/variables/SM_FieldPointer.cpp \
	libstonem/variables/SM_Pointer.cpp \
	libstonem/variables/SM_Primitive.cpp \
	libstonem/variables/SM_Variable.cpp

nobase_include_HEADERS = StoneMLib.hpp \
	libstonem/SM_Definitions.hpp \
	libstonem/SM_MemoryCount.hpp \
	libstonem/SM_Tools.hpp \
	libstonem/StoneInterpreter.hpp \
	libstonem/StoneResult.hpp \
	libstonem/instructions/SM_ArithmeticOp.hpp \
	libstonem/instructions/SM_Assign.hpp \
	libstonem/instructions/SM_New.hpp \
	libstonem/instructions/SM_Instruction.hpp \
	libstonem/instructions/SM_Return.hpp \
	libstonem/instructions/SM_ReturnValue.hpp \
	libstonem/instructions/SM_Stack.hpp \
	libstonem/variables/SM_Constant.hpp \
	libstonem/variables/SM_FieldPointer.hpp \
	libstonem/variables/SM_Pointer.hpp \
	libstonem/variables/SM_Primitive.hpp \
	libstonem/variables/SM_Variable.hpp


noinst_PROGRAMS = mathgen
mathgen_SOURCES = mathfunctiongen/MathFunctionGen.cpp


bin_PROGRAMS = stonem
stonemdir = .

stonem_SOURCES = stonemachine/StoneMachine.cpp \
	stonemachine/CommandParser.cpp

stonem_includedir = .

stonem_HEADERS = stonemachine/CommandParser.hpp
 
Old 04-01-2023, 12:53 PM   #2
EdGr
Senior Member
 
Registered: Dec 2010
Location: California, USA
Distribution: I run my own OS
Posts: 1,007

Rep: Reputation: 476Reputation: 476Reputation: 476Reputation: 476Reputation: 476
I have not used autotools recently, but I believe that you are looking for BUILT_SOURCES. https://www.gnu.org/software/automak...s-Example.html

You may need to create two projects: one to compile mathgen, and a second to run mathgen and to compile the library.
Ed
 
  


Reply

Tags
make


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
"make" always generates errors, regardless of program install attempted: Ubuntu 8.04 computer_freak_8 Linux - Software 9 07-17-2008 03:56 PM
Is there any program that generates the Makefile automatically for C++ programs? gajaykrishnan Programming 3 05-29-2008 11:44 AM
Scribus installation problem, sez I need automake 1.6 when automake 1.9 is istalled Rockgod2099 Linux - Software 13 11-14-2004 06:37 PM
program that generates relative paths? TheMaXX Linux - Software 1 10-21-2003 02:17 PM
slackware 9 asking for automake 1.6 while i have automake 1.7 gtgoku Slackware 1 10-19-2003 08:59 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:39 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration