Gentoo Archives: gentoo-dev

From: Sebastian Pipping <sping@g.o>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] [rfc] Making a Makefile respect custom CFLAGS
Date: Mon, 23 Aug 2010 21:01:29
Message-Id: 4C72E196.3050400@gentoo.org
1 Hello!
2
3
4 I assume this Makefile to work with any non-GNU make:
5
6 CFLAGS=`sdl-config --cflags` -Wall -Wextra
7 LDFLAGS=`sdl-config --libs`
8 OBJ=tron.o pixel.o
9
10 .PHONY: clean run
11
12 tron: $(OBJ)
13
14 run: tron
15 ./tron
16
17 clean:
18 rm -f *.o tron
19
20 Now how would we fix this to respect custom CFLAGS (and LDFLAGS) in a
21 way that does not require GNU make (i.e. simply-expanded variables):
22
23 "[Recursively-expanded variables are] the only sort supported
24 by other versions of make". [1]
25
26 Any proposals for a generic solution that is upstream-suitable?
27 While the Makefile presented here is not likely to go into the tree I
28 had similar cases before so I felt like bringing this up. Thanks!
29
30 Best,
31
32
33
34 Sebastian
35
36
37 [1] http://www.gnu.org/software/make/manual/make.html#Flavors

Replies

Subject Author
Re: [gentoo-dev] [rfc] Making a Makefile respect custom CFLAGS Mike Frysinger <vapier@g.o>
Re: [gentoo-dev] [rfc] Making a Makefile respect custom CFLAGS "Michał Górny" <gentoo@××××××××××.pl>