Break out 'lemon' as a build target.
Project: http://git-wip-us.apache.org/repos/asf/lucy/repo Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/0fca39e9 Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/0fca39e9 Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/0fca39e9 Branch: refs/heads/master Commit: 0fca39e90099010ac64e07ea234d79ff41a0df00 Parents: 958d71a Author: Marvin Humphrey <[email protected]> Authored: Wed Nov 7 17:44:45 2012 -0800 Committer: Marvin Humphrey <[email protected]> Committed: Wed Nov 7 17:44:45 2012 -0800 ---------------------------------------------------------------------- clownfish/compiler/python/setup.py | 22 +++++++++++++++++----- 1 files changed, 17 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucy/blob/0fca39e9/clownfish/compiler/python/setup.py ---------------------------------------------------------------------- diff --git a/clownfish/compiler/python/setup.py b/clownfish/compiler/python/setup.py index f165852..a4a3295 100644 --- a/clownfish/compiler/python/setup.py +++ b/clownfish/compiler/python/setup.py @@ -37,6 +37,17 @@ def _run_make(command=[], directory=None): if (directory != None): os.chdir(current_directory) +class lemon(_Command): + description = "Compile the Lemon parser generator" + user_options = [] + def initialize_options(self): + pass + def finalize_options(self): + pass + def run(self): + if not os.path.exists(LEMON_EXE_PATH): + _run_make(['CC=' + python_compiler], directory=LEMON_DIR) + class my_clean(_clean): def run(self): _clean.run(self) @@ -44,11 +55,8 @@ class my_clean(_clean): class my_build(_build): def run(self): - self.lemon() + self.run_command('lemon') _build.run(self) - def lemon(self): - if not os.path.exists(LEMON_EXE_PATH): - _run_make(['CC=' + python_compiler], directory=LEMON_DIR) c_filepaths = [] for (dirpath, dirnames, files) in os.walk(CFC_SOURCE_DIR): @@ -67,6 +75,10 @@ setup(name = 'clownfish-cfc', author = 'Apache Lucy Project', author_email = 'dev at lucy dot apache dot org', url = 'http://lucy.apache.org', - cmdclass = {'build': my_build, 'clean': my_clean}, + cmdclass = { + 'build': my_build, + 'clean': my_clean, + 'lemon': lemon, + }, ext_modules = [cfc_extension])
