For instance, an excerpt from one of my projects:
Code:
# Generate the wrapper code with swig
$(SwigDir)/common/$(PyModuleName)_wrap.cc : $(SwigHeaderDir)/$(PyModuleName).i
$(SWIG) -shadow -c++ -python -o $@ $<
# Generate the single wrapper interface file for the module by creating a file that %includes the individual .i files
$(SwigHeaderDir)/$(PyModuleName).i : $(SourcesToWrap:%.i=$(SwigHeaderDir)/%.i)
$(SwigHeaderDir)/makePackageInterface.sh $(PyModuleName).i $(SourcesToWrap)
mv $(PyModuleName).i $@
# Dummy rule - nothing automatically generates the .i files
$(SourcesToWrap:%.i=$(SwigHeaderDir)/%.i) :
# Compile the wrapper to an object file
$(SwigLibDir)/$(PyModuleName)_wrap.o : $(SwigDir)/common/$(PyModuleName)_wrap.cc
$(CXX) -c -fPIC -o $@ $^ -I$(PythonIncDir) $(IncludeDirs:%=-I%)
Syntax is clear as a bell, isn't it...