[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: make and swig
From: |
Philip Guenther |
Subject: |
Re: make and swig |
Date: |
Wed, 17 Sep 2008 08:00:45 -0700 |
On Wed, Sep 17, 2008 at 12:38 AM, debutant <address@hidden> wrote:
> A made Boris' idea works like that:
>
> """
> OUTPUT_PYTHON_DIR = ...
> OUTPUT_SWIG_DIR= ...
> INPUT_INTERFACE_DIR = ...
>
> $(OUTPUT_SWIG_DIR)/%_wrap.cxx: $(INPUT_INTERFACE_DIR)/%.i
> swig -cxx -python -o $@ -outdir $(OUTPUT_PYTHON_DIR) $<
> """
>
> Philip's idea is even better:
> """
> $(OUTPUT_SWIG_DIR)/%_wrap.cxx %.py: $(INPUT_INTERFACE_DIR)/%.i
> swig -cxx -python -o ${@:.py=_wrap.cxx} -outdir $(OUTPUT_PYTHON_DIR)
> $<
> """
Note that if you never use or reference the python target, then those
would effectively be the same.
Also, you need to include the paths in a couple more places in that
rule for it to really work if you do reference the python target:
$(OUTPUT_SWIG_DIR)/%_wrap.cxx $(OUTPUT_PYTHON_DIR)/%.py: \
$(INPUT_INTERFACE_DIR)/%.i
swig -cxx -python -outdir $(OUTPUT_PYTHON_DIR) \
-o
${@:$(OUTPUT_PYTHON_DIR)/%.py=$(OUTPUT_SWIG_DIR)/%_wrap.cxx} \
$<
Philip Guenther