2007-04-12 20:07:50 +00:00
|
|
|
#
|
|
|
|
#
|
2015-01-23 20:40:40 +01:00
|
|
|
.PHONY: all
|
|
|
|
all:
|
|
|
|
@echo "*** See README for information how to build AppArmor ***"
|
|
|
|
exit 1
|
|
|
|
|
2015-01-23 15:52:09 -08:00
|
|
|
COMMONDIR=common
|
|
|
|
include ${COMMONDIR}/Make.rules
|
2007-04-12 20:07:50 +00:00
|
|
|
|
|
|
|
DIRS=parser \
|
|
|
|
profiles \
|
|
|
|
utils \
|
2012-03-22 13:17:48 -07:00
|
|
|
libraries/libapparmor \
|
2007-04-12 20:07:50 +00:00
|
|
|
changehat/mod_apparmor \
|
|
|
|
changehat/pam_apparmor \
|
|
|
|
tests
|
|
|
|
|
2017-12-21 21:36:16 -08:00
|
|
|
# with conversion to git, we don't export from the remote
|
|
|
|
REPO_URL?=git@gitlab.com:apparmor/apparmor.git
|
|
|
|
REPO_BRANCH?=apparmor-2.10
|
2010-10-07 15:25:21 -07:00
|
|
|
|
|
|
|
RELEASE_DIR=apparmor-${VERSION}
|
2011-02-08 07:05:39 -08:00
|
|
|
__SETUP_DIR?=.
|
2007-04-12 20:07:50 +00:00
|
|
|
|
2011-06-02 18:54:56 -07:00
|
|
|
# We create a separate version for tags because git can't handle tags
|
|
|
|
# with embedded ~s in them. No spaces around '-' or they'll get
|
|
|
|
# embedded in ${VERSION}
|
2017-12-21 21:36:16 -08:00
|
|
|
# apparmor version tag format 'vX.Y.ZZ'
|
|
|
|
# apparmor branch name format 'apparmor-X.Y'
|
|
|
|
TAG_VERSION="v$(subst ~,-,${VERSION})"
|
2011-06-02 18:54:56 -07:00
|
|
|
|
2014-03-20 14:52:03 -07:00
|
|
|
# Add exclusion entries arguments for tar here, of the form:
|
|
|
|
# --exclude dir_to_exclude --exclude other_dir
|
|
|
|
TAR_EXCLUSIONS=
|
|
|
|
|
2007-08-16 22:11:01 +00:00
|
|
|
.PHONY: tarball
|
2010-10-07 15:25:21 -07:00
|
|
|
tarball: clean
|
2010-10-18 12:12:37 -07:00
|
|
|
REPO_VERSION=`$(value REPO_VERSION_CMD)` ; \
|
|
|
|
make export_dir __EXPORT_DIR=${RELEASE_DIR} __REPO_VERSION=$${REPO_VERSION} ; \
|
|
|
|
make setup __SETUP_DIR=${RELEASE_DIR} ; \
|
2014-03-20 14:52:03 -07:00
|
|
|
tar ${TAR_EXCLUSIONS} -cvzf ${RELEASE_DIR}.tar.gz ${RELEASE_DIR}
|
2007-08-16 22:11:01 +00:00
|
|
|
|
2010-10-07 15:25:21 -07:00
|
|
|
.PHONY: snapshot
|
|
|
|
snapshot: clean
|
2017-12-21 21:36:16 -08:00
|
|
|
$(eval REPO_VERSION:=$(shell $(value REPO_VERSION_CMD)))
|
|
|
|
$(eval SNAPSHOT_NAME=apparmor-$(VERSION)~$(shell echo $(REPO_VERSION) | cut -d '-' -f 2-))
|
|
|
|
$(MAKE) export_dir __EXPORT_DIR=${SNAPSHOT_NAME} __REPO_VERSION=${REPO_VERSION} && \
|
|
|
|
$(MAKE) setup __SETUP_DIR=${SNAPSHOT_NAME} && \
|
|
|
|
tar ${TAR_EXCLUSIONS} -cvzf ${SNAPSHOT_NAME}.tar.gz ${SNAPSHOT_NAME}
|
2007-08-16 22:11:01 +00:00
|
|
|
|
|
|
|
|
2010-10-07 15:25:21 -07:00
|
|
|
.PHONY: export_dir
|
|
|
|
export_dir:
|
|
|
|
mkdir $(__EXPORT_DIR)
|
2017-12-21 21:36:16 -08:00
|
|
|
/usr/bin/git archive --prefix=$(__EXPORT_DIR)/ --format tar $(__REPO_VERSION) | tar xv
|
|
|
|
echo "$(REPO_URL) $(REPO_BRANCH) $(__REPO_VERSION)" > $(__EXPORT_DIR)/common/.stamp_rev
|
2007-08-16 22:11:01 +00:00
|
|
|
|
2010-10-07 15:25:21 -07:00
|
|
|
.PHONY: clean
|
2007-04-12 20:07:50 +00:00
|
|
|
clean:
|
2011-02-16 09:41:14 -08:00
|
|
|
-rm -rf ${RELEASE_DIR} ./apparmor-${VERSION}~*
|
[v2: added clean-ups, backed off on some of the build silencing]
This is a rather large rearrangement of how a subset of the parser global
variables are defined. Right now, there are unit tests built without
linking against parser_main.c. As a result, none of the globals defined in
parser_main.c could be used in the code that is built for unit tests
(misc, regex, symtab, variable). To get a clean build, either stubs needed
to be added to "#ifdef UNIT_TEST" blocks in each .c file, or we had to
depend on link-time optimizations that would throw out the unused routines.
First, this is a problem because all the compile-time warnings had to be
explicitly silenced, so reviewing the build logs becomes difficult on
failures, and we can potentially (in really unlucky situations) test
something that isn't actually part of the "real" parser.
Second, not all compilers will allow this kind of linking (e.g. mips gcc),
and the missing symbols at link time will fail the entire build even though
they're technically not needed.
To solve all of this, I've moved all of the global variables used in lex,
yacc, and main to parser_common.c, and adjusted the .h files. On top of
this, I made sure to fully link the tst builds so all symbols are resolved
(including aare lib) and removedonly tst build-log silencing (for now,
deferring to another future patchset to consolidate the build silencing).
Signed-off-by: Kees Cook <kees.cook@canonical.com>
2011-05-13 02:12:49 -07:00
|
|
|
for dir in $(DIRS); do \
|
|
|
|
make -C $$dir clean; \
|
|
|
|
done
|
2010-10-07 15:25:21 -07:00
|
|
|
|
|
|
|
.PHONY: setup
|
|
|
|
setup:
|
|
|
|
cd $(__SETUP_DIR)/libraries/libapparmor && ./autogen.sh
|
2010-10-07 15:33:11 -07:00
|
|
|
|
|
|
|
.PHONY: tag
|
|
|
|
tag:
|
2017-12-21 21:36:16 -08:00
|
|
|
git tag -m 'AppArmor $(VERSION)' -s $(TAG_VERSION)
|