[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problem with distribution of bin_SCRIPTS
From: |
Benoit Sigoure |
Subject: |
Re: Problem with distribution of bin_SCRIPTS |
Date: |
Tue, 29 May 2007 11:25:33 +0200 |
User-agent: |
Internet Messaging Program (IMP) H3 (4.1.3) |
Quoting Noah Slater <address@hidden>:
Hello,
Hi,
In my package I would like to generate a script from a source file by
simply copying it and setting the executable bit. I do not need to
distribute the script though, only the source.
No matter how hard I try I cannot get automake to work using the
following set-up:
* The script source is distributed
* The script is NOT distributed but is generated from the source
I have attached a very small example package that reproduces the problem.
If you run "make distcheck" you should get the following error:
cp --preserve foo.py foo
cp: cannot stat `foo.py': No such file or directory
This is dispite foo.py being listed in EXTRA_DIST.
Any help is greatly appreciated...
Do you know about VPATH builds? It's when sources are in one
(possibly read-only) tree and the build takes place in another tree.
When you run make distcheck, it actually performs a VPATH build. It
turns out that your Makefile does not handle VPATH builds because it
assumes that foo.py is in the current directory whereas it's not the
case.
You also made a typo, (s/CLEAN_FILES/CLEANFILES/) but make distcheck
would have revealed this problem too.
The attached patch solves your problem. I also recommend passing the
`foreign' option to AM_INIT_AUTOMAKE so that you don't have to supply
all these empty files.
Cheers,
--
Benoit Sigoure aka Tsuna
EPITA Research and Development Laboratory
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
diff -u -r example/Makefile.am example.mine/Makefile.am
--- example/Makefile.am 2007-05-29 10:47:16.000000000 +0200
+++ example.mine/Makefile.am 2007-05-29 11:19:15.000000000 +0200
@@ -1,9 +1,9 @@
bin_SCRIPTS = foo
-CLEAN_FILES = $(bin_SCRIPTS)
+CLEANFILES = $(bin_SCRIPTS)
EXTRA_DIST = foo.py
-foo: foo.py
- cp --preserve foo.py foo
+foo: $(srcdir)/foo.py
+ cp --preserve $(srcdir)/foo.py foo
chmod +x foo