Skip to contentSkip to conversation

Makefiles of policy_tool

PATCH In review aq 3 participants 4 messages Jun 21, 2005 Kbuild

lore
Share & tools
lore

aq

author
#0 lore raw

PATCH 1/1 Makefiles of policy_tool

This patch ([email protected]) makes some cleanups to Makefile of policy_tool, and add install target. It also removes policy_tool in uninstall target from top level Makefile.

 Makefile              |    1 +
 tools/policy/Makefile |   19 +++++++++++++------
 2 files changed, 14 insertions(+), 6 deletions(-)

===== Makefile 1.97 vs edited =====

Makefile +1 -0
@@ -168,6 +168,7 @@
 	rm -rf $(D)/usr/include/xcs_proto.h $(D)/usr/include/xc.h
 	rm -rf $(D)/usr/include/xs_lib.h $(D)/usr/include/xs.h
 	rm -rf $(D)/usr/sbin/xcs $(D)/usr/sbin/xcsdump $(D)/usr/sbin/xen*
+	rm -rf $(D)/usr/sbin/policy_tool
 	rm -rf $(D)/usr/sbin/netfix
 	rm -rf $(D)/usr/sbin/xfrd $(D)/usr/sbin/xm
 	rm -rf $(D)/usr/share/doc/xen  $(D)/usr/man/man*/xentrace*

===== tools/policy/Makefile 1.1 vs edited =====

tools/policy/Makefile +13 -6
@@ -1,7 +1,12 @@
 XEN_ROOT = ../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-SRCS     = policy_tool.c
+POLICY_TOOL_INSTALL_DIR = /usr/sbin
+
+INSTALL = install
+INSTALL_PROG := $(INSTALL) -m0755
+INSTALL_DIR := $(INSTALL) -d -m0755
+
 CFLAGS   += -static
 CFLAGS   += -Wall
 CFLAGS   += -Werror
@@ -10,15 +15,17 @@
 CFLAGS   += -I.
 
 all: build
-build: mk-symlinks
-	$(MAKE) policy_tool
 
-default: all
+build: mk-symlinks policy_tool
 
-install: all
+default: all
 
 policy_tool : policy_tool.c
-	$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $<
+	$(CC) $(CFLAGS) -o $@ $<
+
+install: all
+	$(INSTALL_DIR) -p $(DESTDIR)$(POLICY_TOOL_INSTALL_DIR)
+	$(INSTALL_PROG) policy_tool $(DESTDIR)$(POLICY_TOOL_INSTALL_DIR)
 
 clean:
 	rm -rf policy_tool xen

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw
Quoted 4 lines

This patch ([email protected]) makes some cleanups to Makefile of policy_tool, and add install target. It also removes policy_tool in uninstall target from top level Makefile.

I'm not sure we want to install policy_tool into /sbin by default; it's something that only the brave should play with for now...

cheers,

S.

author
#2 lore raw
Quoted 8 lines · Steven Hand
Quoted 4 lines

This patch ([email protected]) makes some cleanups to Makefile of policy_tool, and add install target. It also removes policy_tool in uninstall target from top level Makefile.

I'm not sure we want to install policy_tool into /sbin by default; it's something that only the brave should play with for now...

but only the brave play with -unstable tree, no? ultimately this tree is for testing purpose, isnt it?

or you want to install the tool elsewhere?

btw, looks like the xense-list is a moderated list?

regards,
aq

#3 lore raw
In reply to Steven Hand

[email protected] wrote on 06/21/2005 03:39:19 AM:

Quoted 11 lines
Quoted 4 lines

This patch ([email protected]) makes some cleanups to Makefile of policy_tool, and add install target. It also removes policy_tool in uninstall target from top level Makefile.

I'm not sure we want to install policy_tool into /sbin by default; it's something that only the brave should play with for now...

cheers,

Quoted 7 lines

S.

_______________________________________________
Xense-devel mailing list
[email protected]
http://lists.xensource.com/xense-devel

On one hand, the policy_tool should not do much if the NULL policy is compiled in.
On the other hand, the policy_tool is still pretty "pre-mature" and probably deserves
to linger for a little while in the tools directory only.

Thanks
Reiner