[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How do I configure Makefile.am to run a program?
From: |
Harlan Stenn |
Subject: |
Re: How do I configure Makefile.am to run a program? |
Date: |
Fri, 21 Mar 2008 19:57:24 +0000 |
> I like to include my subversion version number in my rpm spec file so I can
> keep track of the source used to generate the binary. I've been manually
> changing it but since I forget to sometimes, I'd like for make to generate
> the spec file for me. I wrote a small perl program that reads a template
> file (.tmpl) and writes out the .spec file after calling subversion . -n. I
> can't figure out how to force make from a Makefile.am to run the perl script
> each time it builds.
> I thought I could do it with SUFFIXES but when I tried it didn't work. I
> added the following to the top level Makefile.am:
>
> noinst_PROGRAMS = poll.spec
> poll_tmpl_SOURCES = poll.tmpl FORCE
> .tmpl.spec:
> ./logpoll.pl $<
>
> FORCE:
You want BUILT_SOURCES = something.
If logpoll.pl takes the .tmpl.spec file and spits out 'poll.spec' then
you want:
BUILT_SOURCES = poll.spec
poll.spec: .tmpl.spec logpoll.pl
./logpoll.pl $<
if logpoll.pl is a generated script. If it's part of the package you want:
poll.spec: .tmpl.spec
$srcdir/logpoll.pl $<
H