Quote:
Originally Posted by
fpmurphy
Hi,
===================
automake approach
Automake - Wikipedia, the free encyclopedia
Approach
Automake aims to allow the programmer to write a makefile in a higher-level language, rather than having to write the whole makefile manually. In simple cases, it suffices to give:
- a line that declares the name of the program to build;
- a list of source files;
- a list of command-line options to be passed to the compiler (for example, in which directories header files will be found);
- a list of command-line options to be passed to the linker (which libraries the program needs and in what directories they are to be found).
...
###########
My input to Automake:
a line that declares the name of the program to build;
- replace by standard name + date
a list of source files;
- have a code to scan directory for source files
a list of command-line options to be passed to the
compiler (for example, in which directories header files will be found);
- automate this procedure
a list of command-line options to be passed to the
linker (which libraries the program needs and in what directories they are to be found).
- trace program for libraries required and search file system for directories, they are to be found.
########
So I assume, the above input can be autogenerated by intelligent Automake.
===================
thanks,
exactly what I was looking for.
In my case, Makefile for Helloworld, downloaded from the net
-----------------------------------------------------------
helloworld: helloworld.o
cc -o $@ $<
helloworld.o: helloworld.c
cc -c -o $@ $<
.PHONY: clean
clean:
rm -f helloworld helloworld.o
--------------------------------
replaced by command line
gcc helloworld.c -o helloworld
====================================
Makefile template for Linux dialog
# $Id:
makefile.in,v 1.62 2008/07/20 18:30:36 tom Exp $
# template makefile for DIALOG
#
SHELL = /bin/sh
srcdir = @srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
top_builddir = .
x = @EXEEXT@
o = .@OBJEXT@
.....
5441 in size total.
Ok.
Makefile.in for dialog is lost, deleted.
Any way to have an intelligent Automake to autogenerate and recover
makefile.in and generate makefile automagically ?
====================
So, what is really needed is some kind of compiler, autoconf, that takes an Autoconf program, configure.ac, and transforms it into a portable shell script, configure.
GNU Autoconf, Automake and Libtool
Learning the GNU development tools: Preface
Automake - Wikipedia, the free encyclopedia
Learning the GNU development tools: Preface
5.3 Hello world example with Autoconf and Automake
To get started we will show you how to do the Hello world program using `autoconf' and `automake'. In the fine tradition of K&R, the C version of the hello world program is:
#include <stdio.h>
main()
{
printf("Howdy world!\n");
}
Call this `hello.c' and place it under an empty directory. Simple programs like this can be compiled and ran directly with the following commands:
% gcc hello.c -o hello
% hello
=========================
Just to follow steps done by a human and have them repeated by intelligent, interactive Automake.
Darius