Hi,
This is my first posting to the GNU Make mailing lists, so please let me know
if i've contravened any expectations.
## Background
I am a somewhat heavy user of GNU Make, and frequently want to do something
like the following:
FILE_SHA = $(shell sha256sum src/file.c)
deploy-frobnic
script:
http_//foo.bar :
$(GET) $(subst _,:,$@)
or whatever (obviously _ is not a good choice but you get the idea).
--
---
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU ma
http//%:
...
.PHONY: all
all: $(GET:%=http//zork.net/%)
maybe.
--
-------
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gnu.org http://www.paulandlesley.org/gmake/
"Please remain calm...I may be mad, but I am a professional.
shell
verbatim.
The _only_ thing make expands are variables and functions.
--
-------
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gnu.org http://www.pau
variables.
--
---
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gnu.org http://www.paulandlesley.org/gmake/
"Please remain calm...I may be mad, but I am a profession
t; actually used.
No.
kt> if this behaviour is intended, it is definitely worth stating in
kt> the manual.
Check the GNU make manual, section "How 'make' Reads a Makefile".
--
-------
Paul D.
. In fact, in many
build environments with more complex requirements than simple
compile/link it's very difficult to do it without writing lots of
specific rules.
--
---
Paul D. Smith <[EMAIL PROTECTED]> Find s
ve two distinct areas where the
pathname might be different (the prefix and the .obj or whatever
directory); if there was only one then you could do what you want
without needing VPATH.
BTW, that vpath field seems to be left in there by accident, it appeared
in GNU make 3.77 but it's never been
GNU make but they are not identical).
Problems with the Cygnus version need to be addressed to the Cygnus
folks.
Thanks.
--
-------
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
htt
Note that newer versions of GNU make don't care about line endings: they
can be either traditional UNIX (LF) or DOS/Windows (CRLF). I'm not sure
about Mac (CR)...
--
-------
Paul D. Smith <[EMAIL PROTECTED]&g
(OBJDIR)/bbb: b.o bb.o
...
$(OBJDIR)/%:
...
--
-------
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gnu.org http://www.paulandlesley.org/gmake/
"Please remain calm...I may be mad, but I am a professional." --Mad Scien
:
jj> specialbuild: CCFLAGS += -show EXEC := specialbuild_forme
jj> Either I have the wrong syntax, or you can't do this and need
jj> multiple lines. Can someone let me know?
You can't put multiple target-specific variable settings on one line,
just like you can't put multiple no
sr/include/bits/errno.h:25: linux/errno.h: No such file or directory
pm> make[1]: *** [fnmatch.o] Error 1
pm> make: *** [all-libiberty] Error 2
This looks like maybe you don't have your /usr/include/linux directory
set up correctly.
--
----
hould first generate .b file, then .c file?
That's not the problem. The problem is you're misusing VPATH.
VPATH is designed to find _sources_. It cannot be used to find
_targets_. It won't work to use it like that.
--
------
hat purpose.
--
-------
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gnu.org http://www.paulandlesley.org/gmake/
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist
___
You should look at the section 'Incompatibilities and Missing Features'
in the GNU make manual.
One particular thing I see in a very quick browse is that $$@, etc. are
not supported in GNU make.
--
-------
Pau
;
wherever you want a "$" in your shell script.
All other characters in a command script are passed to the shell verbatim.
--
---
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gnu.o
you try to override something about the configuration or the makefile?
--
---
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gnu.org http://www.paulandlesley.org/
ure script is almost certainly not
the right answer.
--
-------
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gnu.org http://www.paulandlesley.org/gmake/
"Please remain
you can't use Makefile.in instead of Makefile.
--
-------
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gnu.org http://www.paulandlesley.org/gmake/
"Please remain
n config.log and see if you can figure out why it's
choosing aCC as your archiver.
--
---
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gnu.org http:/
oftware uses links to point to a shared cache. We are using Solaris.
Not without changing the code. There is no configuration or runtime
option to do this.
However, the changes are pretty simple.
--
-------
Paul D. Smith
ual that I pointed you to previously, I think you can do
this with static pattern rules:
$(TPP0:%=%down) : %down : %.obj
--
---
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gn
lt of using -k, since in that case some
prerequisite could have failed to build a while ago, and make kept on
going.
--
-------
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
part of the file. For
example you can check the value of $(MAKECMDGOALS) to decide which
section of the makefile should be visible to the current invocation of
make.
That's about the only suggestion I have.
--
------
scripts.
--
---
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gnu.org http://www.paulandlesley.org/gmake/
"Please remain calm...I may be mad, but I am a p
g the
prerequisite restrictions in the makefile of course).
--
-------
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gnu.org http://www.paulandlesley.org/gmake/
&qu
The fastest way to test if a file exists is with the wildcard function:
ifeq ($(wildcard matrix.h),matrix.h)
# exists
else
# doesn't exist
endif
--
---
Paul D. Smith <[EMAIL PROTECTED]>
rtunately.
I'm open to other ideas.
--
---
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gnu.org http://www.paulandlesley.org/gmake/
"Please remain calm...I ma
ssage.
rj> Ideally, I'd like to add some logic to the template makefile that
rj> I have control over so that I can intercept the target name, set
rj> the variable and then include ../appmake.make.
I don't quite understand what you're getting at here.
--
--
ttern Rules_.
--
---
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gnu.org http://www.paulandlesley.org/gmake/
"Please remain calm...I may be mad, but I am a profess
%% Peter Eisentraut <[EMAIL PROTECTED]> writes:
pe> Paul D. Smith writes:
>> %% Peter Eisentraut <[EMAIL PROTECTED]> writes:
>>
pe> What is a good way to write rules that contain commands with multiple
pe> output files?
>>
>> Use mult
l wherever you like.
--
-------
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gnu.org http://www.paulandlesley.org/gmake/
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist
_
generate the rules by using GNU make's auto-re-exec
feature.
Other than that, you just have to write them all out by hand.
--
---
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips
to achive the behavior I need?
Static pattern rules. But, you'll have to write one for each
subdirectory.
--
---
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gnu.org
ave to give an example.
--
-------
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gnu.org http://www.paulandlesley.org/gmake/
"Please remain calm...I may be mad, but I am
mething:
.PHONY: do_something
--
-------
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gnu.org http://www.paulandlesley.org/gmake/
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist
more problems on Windows/DOS uses of make, you might try the
[EMAIL PROTECTED] list.
--
---
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gnu.org
ch is where many of the
Windows-knowledgeable GNU make users hang out.
--
---
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gnu.org http://www.paulandlesley.org/gmake/
&q
MEM)
clean1: LIB = dir1/libymy.a
clean1: MEM = obj.o
clean1: ; $(REMOVE-FROM-LIB)
clean2: LIB = dir2/libymy.a
clean2: MEM = obj.o
clean2: ; $(REMOVE-FROM-LIB)
clean: clean1 clean2
--
---
Pau
gt; can it be retrieved.
No.
--
---
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gnu.org http://www.paulandlesley.org/gmake/
"Please remain calm...I may be mad, bu
u're using, (b) the OS and
version you're running it on, and (c) a small _complete_ sample makefile
that demonstrates the problem (i.e., what is the value of RC_DIR and
RC_FILES?)
Then I might be able to explain.
--
----
en the result will be
identical to the input (not the empty string).
--
---
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gnu.org http://www.paulandlesley
.ornl.gov/pvm/
http://www.crosswinds.net/~jlabrous/GNU/PVMGmake/
--
---
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gnu.org http://www.paulandlesley.org/gmake/
"
mehow you configured make to install as /bin/sh,
overwriting your shell!
Ouch. That's very bad. You will need to go find a /bin/sh somewhere
(on your backup disks or install disks or another system on the network)
and copy it over /bin/sh on your system.
--
------
/foodir make looks for path with the literal
string '$ROOT/foodir', not whatever $ROOT expands to.
--
---
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gnu.org
ll be treated as if you'd written them out like above. You may
run into a bug in GNU make 3.79.1 in this area (mishandling "@" chars),
I'm not sure.
--
---
Paul D. Smith <[EMAIL PROTECTED]>
as you'd expect, and the echo command actually prints what you see:
"/home/bhaster /usr /tmp".
Try rewriting your command to avoid shell expansion and you will see
what's happening:
default:
@echo '$(LISTROOT_FILENAME)'
@echo '$(REQFILES)'
mailing list.
--
---
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gnu.org http://www.paulandlesley.org/gmake/
"Please remain calm...I may be mad, but I am a profes
Note that this is not portable shell script syntax. If you want to do
it portably you need:
find $(TMPDIR) -name '*~' | (while read line; do rm "$$line"; done)
--
---
Paul D. Smith <[EMAIL PROTECTED]&
SIX-like systems; there's a set of POSIX
features that the configure script checks for to decide whether make can
do this or not.
Earlier versions of GNU make will run up to 10 jobs in the top-level
make, but will invoke all submakes with, essentially, -j1.
--
-------
tracking"
method described in a paper on my web page below.
--
---
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gnu.org http://www.paulandlesley.org/
def fbins
$(fbins:%=$(bin)/%):
...build from .f files...
endif
or whatever.
--
---
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gnu.org http://www.paulandlesley.org/gmake/
"Please remain calm...I may be mad,
iors please try them with vanilla GNU
make first, and if it doesn't work there feel free to ask on these
lists. If it does work there but not in clearmake -C gnu you should
file a bug against clearmake :).
--
---
Paul
,$(F))*"
@case "$<" in $(findstring $<,$(F))) echo found; *) echo not found; esac
--
---
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gnu.org
pile a C program (like GNU make) without a C
compiler.
Alternatively you can download prebuilt versions of the GNU C compiler
from GCC (or even prebuilt versions of GNU make...); one place to get
them is http://sunfreeware.com/
HTH.
--
----
%% [EMAIL PROTECTED] writes:
rp> I was trying to use a gmake feature I had not tried before, the ?=
rp> assignment operator.
This is a bug in 3.76.1, that has long since been fixed.
--
---
Paul D. Smith &
terms of a pattern rule, you can do this.
See the GNU make manual, section _Introduction to Pattern Rules_.
For example:
%ini.c %0.c %1.c %2.c %3.c %coerce.h %d.h: %.p $(web2c_texmf)
$(web2c) $*
--
---
one .exe.
Also, note that if you have further questions or comments you will
likely find an audience more knowledgeable about GNU make on Windows
platforms on the [EMAIL PROTECTED] mailing list.
HTH...
--
------
and how GNU make was built.
--
-------
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gnu.org http://www.paulandlesley.org/gmake/
"Please remain calm...I
ogram (compiler, etc.) that make uses to do its job is licensed
and running multiple copies uses up too many licenses. Without seeing
the actual message and the commands that preceded it there's little else
I can say.
--
----
include prereqs.mk
prereqs.mk: Makefile
@rm -f $@; \
for t in $(TARGETS); do \
echo "$$t : \$$($$t_OBJS) whatever.a" >> $@; \
done
or whatever (the above is untested).
--
-------
Pa
'make' Reads a Makefile" for more
information on when expansion happens.
--
---
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gnu.org http://w
s don't seem to
show what the command builds the packet _from_), then this:
foo.h foo.o: bar.h junk.h sth.h bar.o junk.o sth.o
(with no command script).
--
-------
Paul D. Smith <[EMAIL PROTECTED]>
D.COM. I believe that's what a large number of people
using GNU make on Windows do.
If you can't do that, I don't know what to tell you :).
--
---
Paul D. Smith <[EMAIL PROTECTED]> Find so
; option? See the ar(1) man page.
HTH!
--
---
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gnu.org http://www.paulandlesley.org/gmake/
"Please remain
w we use the shell's backtick commands to perform the echo, rather
than having make do it which must happen before the command is invoked,
and thus before ENV_VAR is set to 1.
--
---
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gnu.org
and see if it can better detail how command
scripts are expanded.
Thx.
--
-------
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gnu.org http://www.paulandlesley.org/gmake/
&
Not quite; make will still "check for the existence" of the files. But,
yes, this method causes make to understand that a single invocation of
the command script may update all the targets listed.
--
-------
Pa
ething I rely upon.
Using backslash to escape the comment character is the official method.
This is even required by the POSIX standard for make. If the docs don't
make this clear, there's a bug there.
--
---
Pau
ultiple targets, but not explicit
rules. Doing the latter would require some new syntax, which is one
reason I've not really made a serious run at this feature.
--
---
Paul D. Smith <[EMAIL PROTECTED]>
a
script. Not every target _has_ to have a script.
--
-------
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gnu.org http://www.paulandlesley.org/gmake/
"Please remain c
Hi;
You might have better luck asking this question on the [EMAIL PROTECTED]
list, which is specifically for issues with make on DOS and Windows
platforms.
Good luck!
--
---
Paul D. Smith <[EMAIL PROTEC
been fixed in the latest source for GNU make; it works for me:
$ make aa
touch aa
$ make aa
touch aa
--
---
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gn
site of the lib target, so $(OBJ) resolves to the empty string.
--
-------
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gnu.org http://www.paulandlesley.org/gmake/
I'm not sure this will work, but definitely try the latest version, 3.79.1.
Please let me know if you still have problems.
--
---
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tip
or
Windows-specific issues with GNU make.
--
---
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gnu.org http://www.paulandlesley.org/gmake/
"Please remain c
t to
dc> prevent infinite loops.
There has already been a fix made to the CVS source which allows the
first argument to $(call ...) to expand recursively. No other functions
or variables are allowed to recurse.
--
----
or very unusual circumstances.
--
---
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gnu.org http://www.paulandlesley.org/gmake/
"Please remain calm...I may be mad, b
of GNU make are you using? What OS are you running it on?
--
---
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gnu.org http://www.paulandlesley.
other.o: %.c
$(CC_OTHER) $(CCTYPE) $(CFLAGS) -o $@ -c $<
--
---
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gnu.org http://www.paulandlesley.org/gma
of that VPATH/vpath could be a factor
here, because those variables aren't consulted until make wants to build
targets, which is after make has completely read all the makefiles into
its internal DB.
--
-------
Paul
$<
%-other.o: %.c
$(CC_OTHER) $(CCTYPE) $(CFLAGS) -o $@ -c $<
--
-------
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gnu.org http://www.
U make needs a beta version of gettext; I'm hoping
that the official gettext 0.11.3 will be out before too long.
--
---
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gnu
ped, GNU make does not need to rebuild those files as the targets
are provided in the distribution with a newer timestamp than the
prerequisites. If these files are being rebuilt it's because the
timestamps on your files have been corrupted and make thinks that the
prerequisites are newer than th
there's no way we can give you any information on why your problem is.
Check your makefile where you define the rule for building .o's and see
what's wrong.
--
---
Paul D. Smith <[EMAIL PROTECT
ts construction would then create the
fd> targets. Is there a more direct way?
Not for targets which are unrelated via a pattern.
--
---
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
es it, and hundreds of thousands of makefiles already
exist, of which a large fraction would not work if changes like this
were made.
--
---
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU
e2.
Unfortunately the latter is broken :(
--
-------
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gnu.org http://www.paulandlesley.org/gmake/
"Please remain calm...I may be mad, but I am a professional." --Mad Scientis
as a variable for other things
and this change would break that.
--
---
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gnu.org http://www.paulandlesley.org/gmake/
"P
extend make's capabilities in this respect; the release after
that will perhaps address and embedded scripting language.
--
---
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://
IL PROTECTED] to see if anyone there knows of a site.
Barring that you'll have to build it yourself.
HTH!
--
-------
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gnu.org
when that happens the system removes certain
sensitive variables from the environment before invoking it.
Change the permissions on your GNU make program to not be setgid any
longer and it will work as you expect.
--
---
ur makefiles.
However, look up the SHELL make variable in the GNU make manual.
--
-------
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gnu.org http://www.paula
mc> before exiting.
It's simple enough to do from within the code, but there's no way to do
it from within a makefile.
--
-------
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
The simplest solution is to use backslashes to quote the spaces:
MAKEFLAGS='CC=gcc-3.0 PKG_CFLAGS=\ -Wall\ -pedantic' R CMD SHLIB rc.c -o rc.so
will work (note the change to single quotes: if you must use double
quotes you'll have to type two backslashes to get one--see the
documen
%% Faheem Mitha <[EMAIL PROTECTED]> writes:
fm> On Thu, 13 Jun 2002, Paul D. Smith wrote:
>> The simplest solution is to use backslashes to quote the spaces:
>>
>> MAKEFLAGS='CC=gcc-3.0 PKG_CFLAGS=\ -Wall\ -pedantic' R CMD SHLIB rc.c -o rc.so
&
%% Bill Rebey <[EMAIL PROTECTED]> writes:
br> In makefiles, is there any difference between $(VAR) and ${VAR} when
br> dereferencing variables?
No, they're identical.
--
---
Paul D. Smith
Look up the MAKECMDGOALS variable in the GNU make manual.
HTH...
--
---
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gnu.org http://www.paulandlesl
t;/dev/null`; case $$n in
'') echo 1 ;; *) echo `expr $$n + 1` ;; esac})
REL := $(call build-ver,4)
--
---
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gnu.org
1 - 100 of 1649 matches
Mail list logo