* trace-cmd: make Makefile rpm-friendly
@ 2010-04-19 17:00 Randy Dunlap
2010-04-19 18:11 ` John Kacur
0 siblings, 1 reply; 7+ messages in thread
From: Randy Dunlap @ 2010-04-19 17:00 UTC (permalink / raw)
To: lkml; +Cc: Steven Rostedt
From: Randy Dunlap <randy.dunlap@oracle.com>
Update Makefile to support rpmbuild DESTDIR usage.
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
---
Makefile | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
--- trace-cmd-0.7.0.orig/Makefile
+++ trace-cmd-0.7.0/Makefile
@@ -18,10 +18,11 @@ AR = $(CROSS_COMPILE)ar
EXT = -std=gnu99
INSTALL = install
+DESTDIR =
prefix ?= /usr/local
bindir_relative = bin
-bindir = $(prefix)/$(bindir_relative)
-man_dir = $(prefix)/share/man
+bindir = $(DESTDIR)/$(prefix)/$(bindir_relative)
+man_dir = $(DESTDIR)/$(prefix)/share/man
man_dir_SQ = '$(subst ','\'',$(man_dir))'
export man_dir man_dir_SQ INSTALL
@@ -29,7 +30,7 @@ export man_dir man_dir_SQ INSTALL
ifeq ($(prefix),$(HOME))
plugin_dir = $(HOME)/.trace-cmd/plugins
else
-plugin_dir = $(prefix)/share/trace-cmd/plugins
+plugin_dir = $(DESTDIR)/$(prefix)/share/trace-cmd/plugins
PLUGIN_DIR = -DPLUGIN_DIR=$(plugin_dir)
PLUGIN_DIR_SQ = '$(subst ','\'',$(PLUGIN_DIR))'
endif
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: trace-cmd: make Makefile rpm-friendly
2010-04-19 17:00 trace-cmd: make Makefile rpm-friendly Randy Dunlap
@ 2010-04-19 18:11 ` John Kacur
2010-04-19 18:38 ` Randy Dunlap
2010-04-19 19:06 ` Steven Rostedt
0 siblings, 2 replies; 7+ messages in thread
From: John Kacur @ 2010-04-19 18:11 UTC (permalink / raw)
To: Randy Dunlap; +Cc: lkml, Steven Rostedt
On Mon, 19 Apr 2010, Randy Dunlap wrote:
> From: Randy Dunlap <randy.dunlap@oracle.com>
>
> Update Makefile to support rpmbuild DESTDIR usage.
So, what would happen if you did
make DESTDIR=/usr/local install ?
I think you would get /usr/local/usr/local
So, I think I would NAK this patch.
I also don't believe there is anything magical about DESTDIR in a spec
file. Essentially, prefix in this makefile is equivalent to DESTDIR, so
you can replace DESTDIR with prefix in a spec template.
> Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
> ---
> Makefile | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> --- trace-cmd-0.7.0.orig/Makefile
> +++ trace-cmd-0.7.0/Makefile
> @@ -18,10 +18,11 @@ AR = $(CROSS_COMPILE)ar
> EXT = -std=gnu99
> INSTALL = install
>
> +DESTDIR =
> prefix ?= /usr/local
> bindir_relative = bin
> -bindir = $(prefix)/$(bindir_relative)
> -man_dir = $(prefix)/share/man
> +bindir = $(DESTDIR)/$(prefix)/$(bindir_relative)
> +man_dir = $(DESTDIR)/$(prefix)/share/man
> man_dir_SQ = '$(subst ','\'',$(man_dir))'
>
> export man_dir man_dir_SQ INSTALL
> @@ -29,7 +30,7 @@ export man_dir man_dir_SQ INSTALL
> ifeq ($(prefix),$(HOME))
> plugin_dir = $(HOME)/.trace-cmd/plugins
> else
> -plugin_dir = $(prefix)/share/trace-cmd/plugins
> +plugin_dir = $(DESTDIR)/$(prefix)/share/trace-cmd/plugins
> PLUGIN_DIR = -DPLUGIN_DIR=$(plugin_dir)
> PLUGIN_DIR_SQ = '$(subst ','\'',$(PLUGIN_DIR))'
> endif
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: trace-cmd: make Makefile rpm-friendly
2010-04-19 18:11 ` John Kacur
@ 2010-04-19 18:38 ` Randy Dunlap
2010-04-19 19:06 ` Steven Rostedt
1 sibling, 0 replies; 7+ messages in thread
From: Randy Dunlap @ 2010-04-19 18:38 UTC (permalink / raw)
To: John Kacur; +Cc: lkml, Steven Rostedt
On 04/19/10 11:11, John Kacur wrote:
>
>
> On Mon, 19 Apr 2010, Randy Dunlap wrote:
>
>> From: Randy Dunlap <randy.dunlap@oracle.com>
>>
>> Update Makefile to support rpmbuild DESTDIR usage.
>
> So, what would happen if you did
> make DESTDIR=/usr/local install ?
>
> I think you would get /usr/local/usr/local
> So, I think I would NAK this patch.
>
> I also don't believe there is anything magical about DESTDIR in a spec
> file. Essentially, prefix in this makefile is equivalent to DESTDIR, so
> you can replace DESTDIR with prefix in a spec template.
I see. Thanks for your comments.
--
~Randy
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: trace-cmd: make Makefile rpm-friendly
2010-04-19 18:11 ` John Kacur
2010-04-19 18:38 ` Randy Dunlap
@ 2010-04-19 19:06 ` Steven Rostedt
2010-04-19 19:09 ` Randy Dunlap
2010-04-19 20:06 ` John Kacur
1 sibling, 2 replies; 7+ messages in thread
From: Steven Rostedt @ 2010-04-19 19:06 UTC (permalink / raw)
To: John Kacur; +Cc: Randy Dunlap, lkml
On Mon, 2010-04-19 at 20:11 +0200, John Kacur wrote:
>
> On Mon, 19 Apr 2010, Randy Dunlap wrote:
>
> > From: Randy Dunlap <randy.dunlap@oracle.com>
> >
> > Update Makefile to support rpmbuild DESTDIR usage.
>
> So, what would happen if you did
> make DESTDIR=/usr/local install ?
>
> I think you would get /usr/local/usr/local
> So, I think I would NAK this patch.
>
> I also don't believe there is anything magical about DESTDIR in a spec
> file. Essentially, prefix in this makefile is equivalent to DESTDIR, so
> you can replace DESTDIR with prefix in a spec template.
>
NAK is too strong. I was looking at what perf does, and it basically
makes prefix and DESTDIR the same.
ifndef DESTDIR
prefix = $(HOME)
endif
We could do..
ifndef DESDIR
prefix = /usr/local/bin
endif
and then, if DESTDIR is not set, it would do the right thing.
-- Steve
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: trace-cmd: make Makefile rpm-friendly
2010-04-19 19:06 ` Steven Rostedt
@ 2010-04-19 19:09 ` Randy Dunlap
2010-04-19 20:06 ` John Kacur
1 sibling, 0 replies; 7+ messages in thread
From: Randy Dunlap @ 2010-04-19 19:09 UTC (permalink / raw)
To: rostedt; +Cc: John Kacur, lkml
On 04/19/10 12:06, Steven Rostedt wrote:
> On Mon, 2010-04-19 at 20:11 +0200, John Kacur wrote:
>>
>> On Mon, 19 Apr 2010, Randy Dunlap wrote:
>>
>>> From: Randy Dunlap <randy.dunlap@oracle.com>
>>>
>>> Update Makefile to support rpmbuild DESTDIR usage.
>>
>> So, what would happen if you did
>> make DESTDIR=/usr/local install ?
>>
>> I think you would get /usr/local/usr/local
>> So, I think I would NAK this patch.
>>
>> I also don't believe there is anything magical about DESTDIR in a spec
>> file. Essentially, prefix in this makefile is equivalent to DESTDIR, so
>> you can replace DESTDIR with prefix in a spec template.
>>
>
> NAK is too strong. I was looking at what perf does, and it basically
> makes prefix and DESTDIR the same.
>
> ifndef DESTDIR
> prefix = $(HOME)
> endif
>
> We could do..
>
> ifndef DESDIR
> prefix = /usr/local/bin
> endif
>
> and then, if DESTDIR is not set, it would do the right thing.
Yes, thanks, but I have it "fixed" now (for some daffynition of fixed).
--
~Randy
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: trace-cmd: make Makefile rpm-friendly
2010-04-19 19:06 ` Steven Rostedt
2010-04-19 19:09 ` Randy Dunlap
@ 2010-04-19 20:06 ` John Kacur
2010-04-19 20:15 ` Randy Dunlap
1 sibling, 1 reply; 7+ messages in thread
From: John Kacur @ 2010-04-19 20:06 UTC (permalink / raw)
To: Steven Rostedt; +Cc: Randy Dunlap, lkml
On Mon, 19 Apr 2010, Steven Rostedt wrote:
> On Mon, 2010-04-19 at 20:11 +0200, John Kacur wrote:
> >
> > On Mon, 19 Apr 2010, Randy Dunlap wrote:
> >
> > > From: Randy Dunlap <randy.dunlap@oracle.com>
> > >
> > > Update Makefile to support rpmbuild DESTDIR usage.
> >
> > So, what would happen if you did
> > make DESTDIR=/usr/local install ?
> >
> > I think you would get /usr/local/usr/local
> > So, I think I would NAK this patch.
> >
> > I also don't believe there is anything magical about DESTDIR in a spec
> > file. Essentially, prefix in this makefile is equivalent to DESTDIR, so
> > you can replace DESTDIR with prefix in a spec template.
> >
>
> NAK is too strong. I was looking at what perf does, and it basically
> makes prefix and DESTDIR the same.
>
> ifndef DESTDIR
> prefix = $(HOME)
> endif
>
> We could do..
>
> ifndef DESDIR
> prefix = /usr/local/bin
> endif
>
> and then, if DESTDIR is not set, it would do the right thing.
>
Yeah, the above is actually an unsatisfactory workaround.
see 7ae5f21361fea11f58c398701da635f778635d13
Another solution is to not copy obfuscated Makefiles when starting new
projects!
/me runs away
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: trace-cmd: make Makefile rpm-friendly
2010-04-19 20:06 ` John Kacur
@ 2010-04-19 20:15 ` Randy Dunlap
0 siblings, 0 replies; 7+ messages in thread
From: Randy Dunlap @ 2010-04-19 20:15 UTC (permalink / raw)
To: John Kacur; +Cc: Steven Rostedt, lkml
On 04/19/10 13:06, John Kacur wrote:
>
> Yeah, the above is actually an unsatisfactory workaround.
> see 7ae5f21361fea11f58c398701da635f778635d13
>
> Another solution is to not copy obfuscated Makefiles when starting new
> projects!
Very much agreed.
> /me runs away
--
~Randy
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2010-04-19 20:18 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-19 17:00 trace-cmd: make Makefile rpm-friendly Randy Dunlap
2010-04-19 18:11 ` John Kacur
2010-04-19 18:38 ` Randy Dunlap
2010-04-19 19:06 ` Steven Rostedt
2010-04-19 19:09 ` Randy Dunlap
2010-04-19 20:06 ` John Kacur
2010-04-19 20:15 ` Randy Dunlap
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.