[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
OS dependant makefile
From: |
Sensei |
Subject: |
OS dependant makefile |
Date: |
Wed, 29 Dec 2004 15:19:59 +0100 |
User-agent: |
Mozilla Thunderbird 0.8 (X11/20040913) |
Hi.
I'm desperately trying to make a simple makefile not using autotools,
without *any* luck at all.
Even the examples in the make manual do NOT work:
===[Makefile]===
do_sort=abc
ifdef do_sort
func := sort
else
func := strip
endif
bar := a d b g q c
foo := $($(func) $(bar))
export
all:
@echo $(foo)
===[end Makefile]===
sensei@quantum:xge> make
sensei@quantum:xge>
How can I set variables and get them back (just VAR=VALUE does not
work)? How can I pass variables to subdirectories (``export'' alone
should work, I understand from the manual)?
How to define platform dependant parts? This won't work:
ifeq ($(shell /bin/uname),Linux) <--- also $(shell "/bin/uname")...
echo "AYEYE"
endif
all:
@echo "AAA"
clean:
@$(MAKE) -C src clean
sensei@quantum:xge> make
Makefile:1: *** invalid syntax in conditional. Stop.
sensei@quantum:xge>
Even though in the manual:
The syntax of the conditional-directive is the same whether the
conditional is simple or complex. There are four different directives
that test different conditions. Here is a table of them:
ifeq (arg1, arg2)
ifeq 'arg1' 'arg2'
[...]
ifeq ($(strip $(foo)),)
text-if-empty
endif
--
Sensei <mailto:senseiwa@tin.it> <pgp:8998A2DB>
<icqnum:241572242>
<yahoo!:sensei_sen>
<msn-id:sensei_sen@hotmail.com>
- OS dependant makefile,
Sensei <=