1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
|
Description: Various Makefile bugfixes and improvements
Fix 1: Allow Debian packaging to override which directory we expect to find
libsepol.a in.
.
Fix 2: Add clean-pywrap/clean-rubywrap targets and pass all of the *wrap
targets through to the src/Makefile (EG: install-pywrap/install-rubywrap).
.
Fix 3: Newer SWIG only wants a single .i file on the command line, and
errors out if you give it extras (which are already included). Fix the
command line in the $(SWIGCOUT) target and make "swigify" depend on it.
.
The first fix was extracted from the old Debian patch.
.
Tweaked for version 2.1.9 by Russell Coker
Author: Kyle Moffett <Kyle.D.Moffett@boeing.com>
---
Forwarded: no
Last-Update: 2012-09-25
--- a/Makefile
+++ b/Makefile
@@ -32,16 +32,8 @@ all install relabel clean distclean inde
swigify: all
$(MAKE) -C src swigify $@
-pywrap:
- $(MAKE) -C src pywrap $@
-
-rubywrap:
- $(MAKE) -C src rubywrap $@
-
-install-pywrap:
- $(MAKE) -C src install-pywrap $@
-
-install-rubywrap:
- $(MAKE) -C src install-rubywrap $@
+## Various pywrap/rubywrap targets
+%wrap:
+ $(MAKE) -C src $@
test:
--- a/src/Makefile
+++ b/src/Makefile
@@ -85,6 +85,10 @@ ifneq (,$(filter i386,$(ARCH)))
TLSFLAGS += -mno-tls-direct-seg-refs
endif
+ifeq (,$(strip $(LIBSEPOLDIR)))
+LIBSEPOLDIR=$(LIBDIR)
+endif
+
SWIG = swig -Wall -python -o $(SWIGCOUT) -outdir ./ $(EMFLAGS)
SWIGRUBY = swig -Wall -ruby -o $(SWIGRUBYCOUT) -outdir ./ $(EMFLAGS)
@@ -125,7 +129,7 @@ $(AUDIT2WHYLOBJ): audit2why.c
$(CC) $(filter-out -Werror, $(CFLAGS)) $(PYINC) -fPIC -DSHARED -c -o $@ $<
$(AUDIT2WHYSO): $(AUDIT2WHYLOBJ)
- $(CC) $(CFLAGS) -shared -o $@ $^ -L. $(LDFLAGS) -lselinux $(LIBDIR)/libsepol.a -L$(LIBDIR)
+ $(CC) $(CFLAGS) -shared -o $@ $^ -L. $(LDFLAGS) -lselinux $(LIBSEPOLDIR)/libsepol.a -L$(LIBDIR)
%.o: %.c policy.h
$(CC) $(CFLAGS) $(TLSFLAGS) -c -o $@ $<
@@ -133,6 +137,7 @@ $(AUDIT2WHYSO): $(AUDIT2WHYLOBJ)
%.lo: %.c policy.h
$(CC) $(CFLAGS) -fPIC -DSHARED -c -o $@ $<
+swigify: $(SWIGCOUT)
$(SWIGCOUT): $(SWIGIF)
$(SWIG) $<
@@ -141,9 +146,6 @@ $(SWIGPYOUT): $(SWIGCOUT)
$(SWIGRUBYCOUT): $(SWIGRUBYIF)
$(SWIGRUBY) $<
-swigify: $(SWIGIF)
- $(SWIG) $<
-
install: all
test -d $(LIBDIR) || install -m 755 -d $(LIBDIR)
install -m 644 $(LIBA) $(LIBDIR)
@@ -166,8 +168,14 @@ install-rubywrap: rubywrap
relabel:
/sbin/restorecon $(SHLIBDIR)/$(LIBSO)
-clean:
- -rm -f $(LIBPC) $(OBJS) $(LOBJS) $(LIBA) $(LIBSO) $(SWIGLOBJ) $(SWIGRUBYLOBJ) $(SWIGSO) $(TARGET) $(AUDIT2WHYSO) *.o *.lo *~
+clean-pywrap:
+ -rm -f $(SWIGLOBJ) $(SWIGSO) $(AUDIT2WHYLOBJ) $(AUDIT2WHYSO)
+
+clean-rubywrap:
+ -rm -f $(SWIGRUBYLOBJ) $(SWIGRUBYSO)
+
+clean: clean-pywrap clean-rubywrap
+ -rm -f $(LIBPC) $(OBJS) $(LOBJS) $(LIBA) $(LIBSO) $(TARGET) *.o *.lo *~
distclean: clean
rm -f $(GENERATED) $(SWIGFILES)
|