All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Moore <pmoore@redhat.com>
To: serge@hallyn.com
Cc: selinux@tycho.nsa.gov
Subject: [selinux-testsuite RFC PATCH 2/4] test_policy: general Makefile cleanup
Date: Tue, 24 Sep 2013 12:33:27 -0400	[thread overview]
Message-ID: <20130924163327.27393.12285.stgit@localhost> (raw)
In-Reply-To: <20130924162401.27393.70353.stgit@localhost>

Signed-off-by: Paul Moore <pmoore@redhat.com>
---
 policy/Makefile |   51 +++++++++++++++++++++++++++------------------------
 1 file changed, 27 insertions(+), 24 deletions(-)

diff --git a/policy/Makefile b/policy/Makefile
index 6fb9578..5dbb655 100644
--- a/policy/Makefile
+++ b/policy/Makefile
@@ -1,36 +1,40 @@
-REDHAT_RELEASE=$(shell rpm -q redhat-release)
-REDHAT_VERS=$(shell echo $(REDHAT_RELEASE) | cut -f3 -d"-" | sed -e "s/[^0-9]*//g")
 
-POLICYDEVEL = /usr/share/selinux/devel
+POLDEV = /usr/share/selinux/devel
 SEMODULE = /usr/sbin/semodule
 CHECKPOLICY = /usr/bin/checkpolicy
-VERS := $(shell $(CHECKPOLICY) -V |cut -f 1 -d ' ')
-
-TARGETS=test_global.te test_capable_file.te test_capable_net.te \
-test_capable_sys.te test_dyntrace.te test_dyntrans.te test_entrypoint.te \
-test_execshare.te test_exectrace.te test_execute_no_trans.te \
-test_fdreceive.te test_file.te test_inherit.te test_ioctl.te test_ipc.te \
-test_link.te test_mkdir.te test_open.te test_ptrace.te test_readlink.te \
-test_relabel.te test_rename.te test_rxdir.te test_setattr.te test_setnice.te \
-test_sigkill.te test_stat.te test_sysctl.te test_task_create.te \
-test_task_getpgid.te test_task_getsched.te test_task_getsid.te \
-test_task_setpgid.te test_task_setsched.te test_transition.te test_wait.te
-
-VERS_GE_24 := $(shell [ $(VERS) -ge 24 ] && echo true )
-
-ifeq ($(VERS_GE_24),true)
-TARGETS+= test_bounds.te
+
+REDHAT_RELEASE=$(shell rpm -q redhat-release)
+REDHAT_VERS=$(shell echo $(REDHAT_RELEASE) | cut -f3 -d"-" | sed -e "s/[^0-9]*//g")
+
+POL_VERS := $(shell $(CHECKPOLICY) -V |cut -f 1 -d ' ')
+
+TARGETS = \
+	test_global.te test_capable_file.te test_capable_net.te \
+	test_capable_sys.te test_dyntrace.te test_dyntrans.te \
+	test_entrypoint.te test_execshare.te test_exectrace.te \
+	test_execute_no_trans.te test_fdreceive.te test_file.te \
+	test_inherit.te test_ioctl.te test_ipc.te test_link.te test_mkdir.te \
+	test_open.te test_ptrace.te test_readlink.te \
+	test_relabel.te test_rename.te test_rxdir.te test_setattr.te \
+	test_setnice.te test_sigkill.te test_stat.te test_sysctl.te \
+	test_task_create.te test_task_getpgid.te test_task_getsched.te \
+	test_task_getsid.te test_task_setpgid.te test_task_setsched.te \
+	test_transition.te test_wait.te
+
+ifeq ($(shell [ $(POL_VERS) -ge 24 ] && echo true),true)
+TARGETS += test_bounds.te
 endif
 
 all: $(TARGETS)
 ifeq (x$(REDHAT_VERS),$(filter x$(REDHAT_VERS),x4 x5))
 	$(MAKE) -C redhat/$(REDHAT_VERS) all
 else
-	@if [ -d $(POLICYDEVEL) ]; then \
+	@if [ -d $(POLDEV) ]; then \
 		mkdir -p test_policy; \
 		cp test_policy.if test_policy; \
-		set -e; rm -f test_policy.te; cat $(TARGETS) > test_policy/test_policy.te; \
-		cd test_policy && $(MAKE) -f $(POLICYDEVEL)/Makefile test_policy.pp; \
+		set -e; rm -f test_policy.te; \
+		cat $(TARGETS) > test_policy/test_policy.te; \
+		$(MAKE) -C test_policy -f $(POLDEV)/Makefile test_policy.pp; \
 	else \
 		echo "ERROR: You must have selinux-policy-devel installed."; \
 	fi
@@ -44,7 +48,7 @@ else
 	$(SEMODULE) -i test_policy/test_policy.pp
 endif
 
-unload:	
+unload:
 ifeq (x$(REDHAT_VERS),$(filter x$(REDHAT_VERS),x4 x5))
 	$(MAKE) -C redhat/$(REDHAT_VERS) unload
 else
@@ -54,4 +58,3 @@ endif
 
 clean:
 	rm -rf test_policy tmp
-


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

  parent reply	other threads:[~2013-09-24 16:33 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-24 16:33 [selinux-testsuite RFC PATCH 0/4] selinux-testsuite patches Paul Moore
2013-09-24 16:33 ` [selinux-testsuite RFC PATCH 1/4] test_policy: test_global.te fix for Fedora Rawhide (Sept 24th, 2013) Paul Moore
2013-09-24 16:49   ` Serge E. Hallyn
2013-09-24 19:39     ` Paul Moore
2013-09-25 21:31       ` Serge E. Hallyn
2013-09-25 22:19         ` Paul Moore
2013-09-27 18:15           ` Serge E. Hallyn
2013-09-27 18:27             ` Paul Moore
2013-09-26 18:48       ` Serge E. Hallyn
2013-09-24 16:33 ` Paul Moore [this message]
2013-09-24 16:52   ` [selinux-testsuite RFC PATCH 2/4] test_policy: general Makefile cleanup Serge E. Hallyn
2013-09-24 16:33 ` [selinux-testsuite RFC PATCH 3/4] test_policy: use RHEL instead of REDHAT in Makefile Paul Moore
2013-09-24 16:53   ` Serge E. Hallyn
2013-09-24 16:33 ` [selinux-testsuite RFC PATCH 4/4] test_policy: create a "build" target Paul Moore
2013-09-24 16:53   ` Serge E. Hallyn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130924163327.27393.12285.stgit@localhost \
    --to=pmoore@redhat.com \
    --cc=selinux@tycho.nsa.gov \
    --cc=serge@hallyn.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.