diff options
author | Rob Austein <sra@hactrn.net> | 2014-04-08 23:14:52 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2014-04-08 23:14:52 +0000 |
commit | 1786df7be1be1a8c7af23d0701cafcb9d8fb6d48 (patch) | |
tree | 5c5e7e4396558eda91117f791f0e25d46b983dc8 | |
parent | 4b18b371047d97257a908803e0c60bf1f3619222 (diff) |
First cut at revised top-level rules and macros. Tediously verbose at
the moment, clean that up later, but seems to work as intended.
svn path=/branches/tk685/; revision=5769
-rw-r--r-- | Makefile.in | 128 | ||||
-rw-r--r-- | ca/Makefile.in | 5 | ||||
-rwxr-xr-x | configure | 13 | ||||
-rw-r--r-- | configure.ac | 11 |
4 files changed, 124 insertions, 33 deletions
diff --git a/Makefile.in b/Makefile.in index 4465ef9e..bd08aae9 100644 --- a/Makefile.in +++ b/Makefile.in @@ -24,36 +24,126 @@ abs_top_srcdir = @abs_top_srcdir@ abs_top_builddir= @abs_top_builddir@ srcdir = @srcdir@ -SUBDIRS = @TOP_LEVEL_SUBDIRS@ +OPENSSL_TARGET = @OPENSSL_TARGET@ +RP_TARGET = @RP_TARGET@ +CA_TARGET = @CA_TARGET@ SETUP_PY_INSTALL_LAYOUT = @SETUP_PY_INSTALL_LAYOUT@ +POW_SO = rpki/POW/_POW.so + +# Generic targets. The macros are to deal with ./configure options. + default: all -test:: all +all: VERSION rpki/autoconf.py setup_autoconf.py ${RP_TARGET}-all ${CA_TARGET}-all + +clean: ${RP_TARGET}-clean ${CA_TARGET}-clean + rm -rf build dist autom4te.cache rpki/autoconf.py setup_autoconf.py setup_autoconf.pyc + +test: all ${RP_TARGET}-test ${CA_TARGET}-test + +distclean: clean ${RP_TARGET}-distclean ${CA_TARGET}-distclean + rm -f Makefile config.log config.status + +install: ${RP_TARGET}-install ${CA_TARGET}-install + +deinstall: ${RP_TARGET}-deinstall ${CA_TARGET}-deinstall + +uninstall: deinstall + +# Harmless do-nothing targets to simplify the macro-based mess above. + +noop-all noop-clean noop-test noop-distclean noop-install noop-deinstall: + @true + +# Targets for the RP package. This includes the libraries, thus the bulk +# of the code, although some of it won't run without dependencies and setup +# that only come with the CA package. + +rp-all: h-all schemas-all ${OPENSSL_TARGET}-all rpki-all + cd rp; ${MAKE} all + +rp-clean: ${OPENSSL_TARGET}-clean rpki-clean + cd rp; ${MAKE} clean + +rp-test: ${OPENSSL_TARGET}-test rpki-test + cd rp; ${MAKE} test + +rp-distclean: ${OPENSSL_TARGET}-distclean rpki-distclean + cd rp; ${MAKE} distclean + +rp-install: rpki-install + cd rp; ${MAKE} install + +rp-deinstall: rpki-deinstall + cd rp; ${MAKE} deinstall + + +# Targets for the CA package. + +ca-all: + cd ca; ${MAKE} all -all:: VERSION rpki/autoconf.py setup_autoconf.py +ca-clean: + cd ca; ${MAKE} clean -all install clean test distclean deinstall uninstall:: - @for i in ${SUBDIRS}; do echo "Making $@ in $$i"; (cd $$i && ${MAKE} $@); done +ca-test: + cd ca; ${MAKE} test -export: - svn export http://subvert-rpki.hactrn.net/ - tar czf subvert-rpki.hactrn.net-$$(date +%Y.%m.%d).tar.gz subvert-rpki.hactrn.net - rm -rf subvert-rpki.hactrn.net +ca-distclean: + cd ca; ${MAKE} distclean -clean distclean:: - rm -rf build autom4te.cache rpki/autoconf.py setup_autoconf.py setup_autoconf.pyc ${POW_SO} build dist +ca-install: + cd ca; ${MAKE} install + +ca-deinstall: + cd ca; ${MAKE} deinstall + +# Supporting targets. First pass on a lot of this is going to look +# very silly, will simplify after this is working. + +h-all: + cd h; ${MAKE} all + +schemas-all: + cd schemas; ${MAKE} all + +openssl-all: + cd openssl; ${MAKE} all + +openssl-clean: + cd openssl; ${MAKE} clean + +openssl-test: + cd openssl; ${MAKE} test + +openssl-distclean: + cd openssl; ${MAKE} distclean + + +rpki-all: setup_autoconf.py ${POW_SO} build/stamp + +rpki-clean: + rm -rf build dist ${POW_SO} find . -type f -name '*.py[co]' -delete -distclean:: - rm -rf Makefile config.log config.status +rpki-test: unit-tests + +rpki-distclean: + @true + +rpki-install: + @false + +rpki-deinstall: + @false + +### VERSION: .FORCE ${PYTHON} buildtools/make-version.py -.FORCE: - rpki/autoconf.py: Makefile @echo 'Generating $@'; \ (echo '# Automatically generated. DO NOT EDIT.'; \ @@ -85,10 +175,6 @@ setup_autoconf.py: rpki/autoconf.py SETUP_PY_ROOT = `${PYTHON} -c 'import sys; print "--root " + sys.argv[1] if sys.argv[1] else ""' '${DESTDIR}'` -POW_SO = rpki/POW/_POW.so - -all:: setup_autoconf.py ${POW_SO} build/stamp - .FORCE: ${POW_SO}: .FORCE setup_autoconf.py @@ -98,6 +184,10 @@ build/stamp: .FORCE setup_autoconf.py ${PYTHON} setup.py build touch $@ +unit-tests: all + @echo Running unit tests + PWD=`pwd`; for i in rpki/*.py; do echo "[$$i]"; PYTHONPATH=$$PWD ${PYTHON} $$i; done + lint: find rpki -name '*.py' | xargs pylint --rcfile ${abs_top_srcdir}/buildtools/pylint.rc diff --git a/ca/Makefile.in b/ca/Makefile.in index 317b8395..8da54712 100644 --- a/ca/Makefile.in +++ b/ca/Makefile.in @@ -61,10 +61,7 @@ relaxng: xmllint --noout --relaxng ../schemas/relaxng/up-down-schema.rng tests/up-down-protocol-samples/*.xml xmllint --noout --relaxng ../schemas/relaxng/publication-schema.rng tests/publication-protocol-samples/*.xml -unit-tests: all - PWD=`pwd`; for i in rpki/*.py; do echo "[$$i]"; PYTHONPATH=$$PWD ${PYTHON} $$i; done - -all-tests:: unit-tests relaxng +all-tests:: relaxng test all-tests parse-test profile yamltest yamlconf:: all cd tests; $(MAKE) $@ @@ -625,7 +625,9 @@ WSGI_PROCESS_GROUP WSGI_DAEMON_PROCESS OPENSSL_SO_GLOB OPENSSL_CONFIG_COMMAND -TOP_LEVEL_SUBDIRS +CA_TARGET +RP_TARGET +OPENSSL_TARGET WSGI_PYTHON_EGG_CACHE_USER WSGI_PYTHON_EGG_CACHE_DIR SETUP_PY_INSTALL_LAYOUT @@ -4990,10 +4992,11 @@ fi # Figure out which parts of this package we have to build. - TOP_LEVEL_SUBDIRS="h schemas" -test $build_openssl = yes && TOP_LEVEL_SUBDIRS="$TOP_LEVEL_SUBDIRS openssl" -test $build_rp_tools = yes && TOP_LEVEL_SUBDIRS="$TOP_LEVEL_SUBDIRS rp" -test $build_ca_tools = yes && TOP_LEVEL_SUBDIRS="$TOP_LEVEL_SUBDIRS ca" +if test $build_openssl = yes; then OPENSSL_TARGET=openssl; else OPENSSL_TARGET=noop; fi +if test $build_rp_tools = yes; then RP_TARGET=rp; else RP_TARGET=noop; fi +if test $build_ca_tools = yes; then CA_TARGET=ca; else CA_TARGET=noop; fi + + diff --git a/configure.ac b/configure.ac index c8f153d7..ac67871a 100644 --- a/configure.ac +++ b/configure.ac @@ -752,12 +752,13 @@ fi # Figure out which parts of this package we have to build. - TOP_LEVEL_SUBDIRS="h schemas" -test $build_openssl = yes && TOP_LEVEL_SUBDIRS="$TOP_LEVEL_SUBDIRS openssl" -test $build_rp_tools = yes && TOP_LEVEL_SUBDIRS="$TOP_LEVEL_SUBDIRS rp" -test $build_ca_tools = yes && TOP_LEVEL_SUBDIRS="$TOP_LEVEL_SUBDIRS ca" +if test $build_openssl = yes; then OPENSSL_TARGET=openssl; else OPENSSL_TARGET=noop; fi +if test $build_rp_tools = yes; then RP_TARGET=rp; else RP_TARGET=noop; fi +if test $build_ca_tools = yes; then CA_TARGET=ca; else CA_TARGET=noop; fi -AC_SUBST(TOP_LEVEL_SUBDIRS) +AC_SUBST(OPENSSL_TARGET) +AC_SUBST(RP_TARGET) +AC_SUBST(CA_TARGET) AC_CONFIG_FILES([Makefile h/Makefile |