Permalink
Fetching contributors…
Cannot retrieve contributors at this time
227 lines (178 sloc) 8.46 KB
# $Id$
CFLAGS = @CFLAGS@
LDFLAGS = @LDFLAGS@ @POW_LDFLAGS@
LIBS = @LIBS@
PYTHON = @PYTHON@
INSTALL = @INSTALL@ -m 555
TRANG = @TRANG@
SUDO = @SUDO@
prefix = @prefix@
exec_prefix = @exec_prefix@
datarootdir = @datarootdir@
datadir = @datadir@
localstatedir = @localstatedir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
sysconfdir = @sysconfdir@
abs_builddir = @abs_builddir@
abs_top_srcdir = @abs_top_srcdir@
abs_top_builddir= @abs_top_builddir@
srcdir = @srcdir@
OPENSSL_TARGET = @OPENSSL_TARGET@
RP_TARGET = @RP_TARGET@
CA_TARGET = @CA_TARGET@
WSGI_DAEMON_PROCESS = @WSGI_DAEMON_PROCESS@
WSGI_PROCESS_GROUP = @WSGI_PROCESS_GROUP@
RCYNIC_DIR = @RCYNIC_DIR@
RPKI_USER = @RPKI_USER@
RPKI_GROUP = @RPKI_GROUP@
RCYNIC_HTML_DIR = @RCYNIC_HTML_DIR@
RRDTOOL = @RRDTOOL@
APACHE_VERSION = @APACHE_VERSION@
WSGI_PYTHON_EGG_CACHE_DIR = @WSGI_PYTHON_EGG_CACHE_DIR@
WSGI_PYTHON_EGG_CACHE_USER = @WSGI_PYTHON_EGG_CACHE_USER@
SETUP_PY_INSTALL_LAYOUT = @SETUP_PY_INSTALL_LAYOUT@
SETUP_PY_ROOT = `${PYTHON} -c 'import sys; print "--root " + sys.argv[1] if sys.argv[1] else ""' '${DESTDIR}'`
POW_SO = rpki/POW/_POW.so
RNGS = schemas/relaxng/left-right.rng \
schemas/relaxng/up-down.rng \
schemas/relaxng/publication.rng \
schemas/relaxng/publication-control.rng \
schemas/relaxng/myrpki.rng \
schemas/relaxng/router-certificate.rng \
schemas/relaxng/rrdp.rng \
schemas/relaxng/oob-setup.rng
default: all
all: VERSION rpki/autoconf.py setup_autoconf.py
clean:
rm -rf build dist autom4te.cache rpki/autoconf.py setup_autoconf.py setup_autoconf.pyc
test: all
distclean: clean
rm -f Makefile config.log config.status
uninstall: deinstall
all: ${OPENSSL_TARGET}-all rpki-all ${RP_TARGET}-all ${CA_TARGET}-all
clean: ${OPENSSL_TARGET}-clean rpki-clean ${RP_TARGET}-clean ${CA_TARGET}-clean
test: ${OPENSSL_TARGET}-test rpki-test ${RP_TARGET}-test ${CA_TARGET}-test
distclean: ${OPENSSL_TARGET}-distclean rpki-distclean ${RP_TARGET}-distclean ${CA_TARGET}-distclean
install: rpki-install ${RP_TARGET}-install ${CA_TARGET}-install
deinstall: rpki-deinstall ${RP_TARGET}-deinstall ${CA_TARGET}-deinstall
openssl-all: ; cd openssl; ${MAKE} all
openssl-clean: ; cd openssl; ${MAKE} clean
openssl-test: ; cd openssl; ${MAKE} test
openssl-distclean: ; cd openssl; ${MAKE} distclean
rp-all: ; cd rp; ${MAKE} all
rp-clean: ; cd rp; ${MAKE} clean
rp-test: ; cd rp; ${MAKE} test
rp-distclean: ; cd rp; ${MAKE} distclean
rp-install: ; cd rp; ${MAKE} install
rp-deinstall: ; cd rp; ${MAKE} deinstall
ca-all: ; cd ca; ${MAKE} all
ca-clean: ; cd ca; ${MAKE} clean
ca-test: ; cd ca; ${MAKE} test
ca-distclean: ; cd ca; ${MAKE} distclean
ca-install: ; cd ca; ${MAKE} install
ca-deinstall: ; cd ca; ${MAKE} deinstall
noop-all noop-clean noop-test noop-distclean noop-install noop-deinstall:
@true
rpki-all: \
setup_autoconf.py \
${RNGS} \
${abs_top_srcdir}/h/rpki/sk_manifest.h \
${abs_top_srcdir}/h/rpki/sk_roa.h \
${abs_top_srcdir}/rpki/relaxng.py \
${POW_SO} \
build/stamp
rpki-clean:
rm -rf build dist ${POW_SO} h/rpki/*.h.tmp rpki/*.py.tmp
find . -type f -name '*.py[co]' -delete
rpki-test: all
@echo Running unit tests
PWD=`pwd`; for i in rpki/*.py; do echo "[$$i]"; PYTHONPATH=$$PWD ${PYTHON} $$i; done
rpki-distclean:
rm -f installed
rpki-install:
${PYTHON} setup.py install ${SETUP_PY_ROOT} ${SETUP_PY_INSTALL_LAYOUT} --record installed
rpki-deinstall:
xargs rm -fv <installed
VERSION: .FORCE
${PYTHON} buildtools/make-version.py
rpki/autoconf.py: Makefile
@echo 'Generating $@'; \
(echo '# Automatically generated. DO NOT EDIT.'; \
echo ; \
echo 'bindir = "${bindir}"'; \
echo 'datarootdir = "${datarootdir}"'; \
echo 'localstatedir = "${localstatedir}"'; \
echo 'sbindir = "${sbindir}"'; \
echo 'sharedstatedir = "${sharedstatedir}"'; \
echo 'sysconfdir = "${sysconfdir}"'; \
echo 'libexecdir = "${libexecdir}"'; \
echo ; \
echo 'WSGI_DAEMON_PROCESS = "${WSGI_DAEMON_PROCESS}"'; \
echo 'WSGI_PROCESS_GROUP = "${WSGI_PROCESS_GROUP}"'; \
echo 'RCYNIC_DIR = "${RCYNIC_DIR}"'; \
echo 'RPKI_USER = "${RPKI_USER}"'; \
echo 'RPKI_GROUP = "${RPKI_GROUP}"'; \
echo 'RCYNIC_HTML_DIR = "${RCYNIC_HTML_DIR}"'; \
echo 'RRDTOOL = "${RRDTOOL}"'; \
echo 'APACHE_VERSION = "${APACHE_VERSION}"'; \
echo 'WSGI_PYTHON_EGG_CACHE_DIR = "${WSGI_PYTHON_EGG_CACHE_DIR}"'; \
echo 'WSGI_PYTHON_EGG_CACHE_USER = "${WSGI_PYTHON_EGG_CACHE_USER}"'; \
echo 'SUDO = "${SUDO}"'; \
) > $@
setup_autoconf.py: rpki/autoconf.py
@echo 'Generating $@'; \
(cat rpki/autoconf.py; \
echo ; \
echo 'CFLAGS = """${CFLAGS}"""'; \
echo 'LDFLAGS = """${LDFLAGS}"""'; \
echo 'LIBS = """${LIBS}"""'; \
echo 'RP_TARGET = """${RP_TARGET}"""'; \
echo 'CA_TARGET = """${CA_TARGET}"""'; \
) > $@
.FORCE:
${POW_SO}: .FORCE setup_autoconf.py
${PYTHON} setup.py build_ext --inplace
build/stamp: .FORCE setup_autoconf.py
${PYTHON} setup.py build
touch $@
${abs_top_srcdir}/h/rpki/sk_manifest.h: ${abs_top_srcdir}/h/rpki/manifest.h
${PYTHON} buildtools/defstack.py h/rpki/manifest.h >$@.tmp
mv $@.tmp $@
${abs_top_srcdir}/h/rpki/sk_roa.h: ${abs_top_srcdir}/h/rpki/roa.h
${PYTHON} buildtools/defstack.py h/rpki/roa.h >$@.tmp
mv $@.tmp $@
${abs_top_srcdir}/rpki/relaxng.py: buildtools/make-relaxng.py ${RNGS}
cd schemas/relaxng; ${PYTHON} ${abs_top_srcdir}/buildtools/make-relaxng.py *.rng >$@.tmp
mv $@.tmp $@
schemas/relaxng/left-right.rng: schemas/relaxng/left-right.rnc
${TRANG} schemas/relaxng/left-right.rnc schemas/relaxng/left-right.rng
schemas/relaxng/up-down.rng: schemas/relaxng/up-down.rnc
${TRANG} schemas/relaxng/up-down.rnc schemas/relaxng/up-down.rng
schemas/relaxng/publication.rng: schemas/relaxng/publication.rnc
${TRANG} schemas/relaxng/publication.rnc schemas/relaxng/publication.rng
schemas/relaxng/publication-control.rng: schemas/relaxng/publication-control.rnc
${TRANG} schemas/relaxng/publication-control.rnc schemas/relaxng/publication-control.rng
schemas/relaxng/myrpki.rng: schemas/relaxng/myrpki.rnc
${TRANG} schemas/relaxng/myrpki.rnc schemas/relaxng/myrpki.rng
schemas/relaxng/router-certificate.rng: schemas/relaxng/router-certificate.rnc
${TRANG} schemas/relaxng/router-certificate.rnc schemas/relaxng/router-certificate.rng
schemas/relaxng/rrdp.rng: schemas/relaxng/rrdp.rnc
${TRANG} schemas/relaxng/rrdp.rnc schemas/relaxng/rrdp.rng
schemas/relaxng/oob-setup.rng: schemas/relaxng/oob-setup.rnc
${TRANG} schemas/relaxng/oob-setup.rnc schemas/relaxng/oob-setup.rng
# Eg: PYLINT_FLAGS='--disable=W0311'
lint: .FORCE
pylint --rcfile ${abs_top_srcdir}/buildtools/pylint.rc ${PYLINT_FLAGS} rpki `find rp ca -type f -perm -1 ! -name '*~' -print | xargs grep -El '^#!.+python'`
tags: Makefile .FORCE
{ find rpki rp ca schemas -type f \( -name '*.[ch]' -o -name '*.py' -o -name '*.sql' -o -name '*.rnc' \) ! -name relaxng.py -print; find rp ca -type f -perm -1 ! -name '*~' -print | xargs grep -El '^#!.+python'; } | etags -
makemigrations:
PYTHONPATH=. RPKI_CONF=makemigrations.conf.$$$$ TEMP_DB=makemigrations.db.$$$$; export PYTHONPATH RPKI_CONF TEMP_DB; trap "rm -f $$RPKI_CONF $$TEMP_DB" 0; \
${PYTHON} rp/config/rpki-confgen --read-xml rp/config/rpki-confgen.xml --autoconf --set myrpki::shared_sql_engine=sqlite3 \
--set myrpki::rpkid_sql_database=$$TEMP_DB --set myrpki::irdbd_sql_database=$$TEMP_DB --set myrpki::pubd_sql_database=$$TEMP_DB \
--pwgen myrpki::shared_sql_password --pwgen web_portal::secret-key --write-conf $$RPKI_CONF; \
for i in rpkid pubd irdb rcynic; do django-admin makemigrations --settings rpki.django_settings.$$i; done
.FORCE: