Skip to contentSkip to conversation

Enhance libkvm Makefile

PATCH In review Anthony Liguori 2 participants 3 messages Nov 3, 2006 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Enhance libkvm Makefile

The attached patch allows for DESTDIR/PREFIX to be used with the libkvm Makefile as one may expect the should be used. Also, it lets KERNELDIR be specified.

Regards,

Anthony Liguori

Makefile +5 -6
diff -r ca0347086805 Makefile
@@ -1,12 +1,11 @@
 
-KERNELDIR = ../kernel
+KERNELDIR ?= ../kernel
+PREFIX ?= /usr/local
 
 CFLAGS = -I $(KERNELDIR)/include $(autodepend-flags) -g
 CXXFLAGS = $(autodepend-flags) 
 
 autodepend-flags = -MMD -MF $(dir $*).$(notdir $*).d
-
-DESTDIR = /usr/local
 
 ifeq ($(shell uname -m), x86_64)
 LIBDIR = /lib64
@@ -25,10 +24,10 @@ flatfiles: test/simple.flat test/stringi
 	test/irq.flat test/sieve.flat test/bootstrap
 
 install:
-	install -D kvmctl.h $(DESTDIR)/include/kvmctl.h
+	install -D kvmctl.h $(DESTDIR)$(PREFIX)/include/kvmctl.h
 	install -D $(KERNELDIR)/include/linux/kvm.h \
-		$(DESTDIR)/include/linux/kvm.h
-	install -D libkvm.a $(DESTDIR)/$(LIBDIR)/libkvm.a
+		$(DESTDIR)$(PREFIX)/include/linux/kvm.h
+	install -D libkvm.a $(DESTDIR)$(PREFIX)/$(LIBDIR)/libkvm.a
 
 %.flat: %.o
 	gcc -nostdlib -o $@ -Wl,-T,flat.lds $^

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

_______________________________________________
kvm-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 4 lines · Anthony Liguori

The attached patch allows for DESTDIR/PREFIX to be used with the libkvm Makefile as one may expect the should be used. Also, it lets KERNELDIR be specified.

Thanks, this is useful.

Quoted 11 lines

Regards,

Anthony Liguori

------------------------------------------------------------------------

diff -r ca0347086805 Makefile

Makefile line 4

Quoted 5 lines
Makefile +2 -1
@@ -1,12 +1,11 @@
 
-KERNELDIR = ../kernel
+KERNELDIR ?= ../kernel
+PREFIX ?= /usr/local
 

I dislike '?=' since it makes a simple 'make' depend on environment variables, so a build can have different results depending on which xterm you happen to be in.

A regular assignment can be overridden on the make command line, but that's somewhat tedious. I think a simple ./configure (NOT the autotools thing) is best.

Makefile

Quoted 9 lines
Makefile +0 -2
 CFLAGS = -I $(KERNELDIR)/include $(autodepend-flags) -g
 CXXFLAGS = $(autodepend-flags) 
 
 autodepend-flags = -MMD -MF $(dir $*).$(notdir $*).d
-
-DESTDIR = /usr/local
 
 

Ditto. DESTDIR should be initialized.

Quoted 17 lines
Makefile +0 -0
 ifeq ($(shell uname -m), x86_64)

LIBDIR = /lib64

Makefile +3 -3
@@ -25,10 +24,10 @@ flatfiles: test/simple.flat test/stringi
 	test/irq.flat test/sieve.flat test/bootstrap
 
 install:
-	install -D kvmctl.h $(DESTDIR)/include/kvmctl.h
+	install -D kvmctl.h $(DESTDIR)$(PREFIX)/include/kvmctl.h
 	install -D $(KERNELDIR)/include/linux/kvm.h \
-		$(DESTDIR)/include/linux/kvm.h
-	install -D libkvm.a $(DESTDIR)/$(LIBDIR)/libkvm.a
+		$(DESTDIR)$(PREFIX)/include/linux/kvm.h
+	install -D libkvm.a $(DESTDIR)$(PREFIX)/$(LIBDIR)/libkvm.a
 
 %.flat: %.o
 	gcc -nostdlib -o $@ -Wl,-T,flat.lds $^
Signature · 8 lines
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

A message that is not in the archive (sent off-list or not yet received): 454ADCE9.7000505-atKUWr5tajBWk0Htik3J/[email protected]

#4 lore raw
Quoted 15 lines · Avi Kivity

Makefile line 4

Quoted 9 lines · Anthony Liguori

diff -r ca0347086805 Makefile

Makefile +2 -1
@@ -1,12 +1,11 @@
 
-KERNELDIR = ../kernel
+KERNELDIR ?= ../kernel
+PREFIX ?= /usr/local
 

I dislike '?=' since it makes a simple 'make' depend on environment variables, so a build can have different results depending on which xterm you happen to be in.

Quoted 3 lines

A regular assignment can be overridden on the make command line, but that's somewhat tedious. I think a simple ./configure (NOT the autotools thing) is best.

It's a bit late here but I'll take a look at the build tomorrow. Personally, I like to avoid autoconf like the plague so I'm happy with a
simple configure script :-)

Regards,

Anthony Liguori

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642