Commit graph

19 commits

Author SHA1 Message Date
Christian Göttsche
d3c21371d8 Enable missing prototypes
Check for missing prototypes like file local functions not declared
static or external functions not being declared to avoid declaration/
definition desynchronizations.

Acked-by: James Carter <jwcart2@gmail.com>
Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
2022-04-20 14:03:44 -04:00
Christian Göttsche
cee0fe36a7 Enable extra global compiler warnings
Enable some extra compiler warnings in the global Makefile. These are
supported by GCC and Clang. The global Makefile is almost solely used by
developers and the CI, so the interaction with the preexisting -Werror
flag is desirable.

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
2021-11-15 16:00:54 -05:00
Ondrej Mosnacek
a551b2d35a Makefile: always build with -fno-common
GCC 10 has it enabled by default and everything now builds OK with it,
so add it to CFLAGS to avoid breaking the build in the future.

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
2020-01-27 10:51:23 -05:00
Marcus Folkesson
a46776cdcf build: setup buildpaths if DESTDIR is specified
Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
2018-02-14 20:02:03 +01:00
Nicolas Iooss
7e9d1344db Makefile: define a default value for CFLAGS
When building the project with "make DESTDIR=... install", the root
Makefile defines CFLAGS and LDFLAGS without any warning flags ("CFLAGS
+= -I$(DESTDIR)/usr/include" and "LDFLAGS += -L$(DESTDIR)/usr/lib"). As
the Makefiles in subdirectories do not override the flags with warning
flags, the code gets compiled without any enabled warning.

This leads for example to code being introduced which breaks building
libsepol from its directory, while building it from the root Makefile
still works fine.

This issue can be fixed by defining a set of flags in the root Makefile
which are used by all Makefiles in subdirectories. The flags have been
chosen following these principles:
* they are compatible with both clang and gcc,
* they already appear in at least one Makefile, and
* they are not triggered with the current git master version.

Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
2017-09-05 12:37:41 -04:00
Jason Zaman
9a7763e186 Add includes for DESTDIR only in root Makefile
Signed-off-by: Jason Zaman <jason@perfinion.com>
2017-04-25 08:31:10 -04:00
Stephen Smalley
fe74095490 Build mcstrans.
We should build it by default or else it will bitrot.
But you can still omit it by overriding OPT_SUBDIRS.

Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2016-11-16 11:19:50 -05:00
Stephen Smalley
3dcdc46378 Make it easy to omit optional components.
Split optional components into their own overridable OPT_SUBDIRS
definition.  Then you can build without them via make OPT_SUBDIRS=
or specify a subset of them in that manner.

Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2016-11-16 11:19:50 -05:00
Stephen Smalley
c9c97d6e8b Move policycoreutils/semodule_{deps,expand,link} to semodule-utils.
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2016-11-16 11:19:50 -05:00
Stephen Smalley
48dc232627 Move policycoreutils/{sepolicy,audit2allow,semanage,scripts/chcat*} and sepolgen to python.
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2016-11-16 11:19:50 -05:00
Stephen Smalley
63e6dba9ca Move policycoreutils/sepolicy dbus service files to dbus.
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2016-11-16 11:19:50 -05:00
Stephen Smalley
97bf196c89 Move policycoreutils/sandbox to sandbox.
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2016-11-16 11:19:50 -05:00
Stephen Smalley
00be13634a Move policycoreutils/restorecond to restorecond.
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2016-11-16 11:19:50 -05:00
Stephen Smalley
2e4d0bc862 Move policycoreutils/gui to gui.
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2016-11-16 11:19:50 -05:00
Nicolas Iooss
b08d7c159e Makefile: make distclean target work
A mispelling in the Makefile in the root directory prevented "make
distclean" to go into subdirectories.

In libsemanage/src/, semanageswig_python_exception.i was not cleaned by
"make distclean" because the target did not use $(GENERATED) and this
variable was being redefined in the Makefile.

Fix these two bugs.

Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
2016-09-29 10:48:14 -04:00
Yuli Khodorkovskiy
36f62b78f1 libsepol: Move secilc out of libsepol
Since the secilc compiler is independent of libsepol, move secilc out of
libsepol. Linke secilc dynamically rather than statically with libsepol.

- Move secilc source, test policies, docs, and secilc manpage to secilc
  directory.
- Remove unneeded Makefile from libsepol/cil. To build secilc, run make
  in the secilc directory.
- Add target to install the secilc binary to /usr/bin/.
- Create an Android makefile for secilc and move secilc out of libsepol
  Android makefile.
- Add cil_set_mls to libsepol public API as it is needed by secilc.
- Remove policy.conf from testing since it is no longer used.

Signed-off-by: Yuli Khodorkovskiy <ykhodorkovskiy@tresys.com>
2015-03-31 12:31:38 -04:00
Eric Paris
824df4b60b libselinux: additional makefile support for rubywrap
SELinux ruby bindings didn't build from the top level
the swig generated .c file wasn't gitignored
use pkg-config for ruby info like we do for python

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2012-06-28 11:21:16 -04:00
Eric Paris
142209161f global: Makefile: create global 'all' target
This does 2 things.  It does a little cleanup by de-duplicating code.
It also adds a new target 'all' as the default target.  Previous the
default target was 'install'.  There was no 'all' target.  This patch
should allow one to build all of the tree as a non-root user.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
2011-08-26 14:27:57 -04:00
Joshua Brindle
13cd4c8960 initial import from svn trunk revision 2950 2008-08-19 15:30:36 -04:00