$(clib)/hellolib $(clib)/hellolib $(clib)/hellolib gcc $(clib)/hellolib - - $(clib- - $(clib)/hellolib cleanforcerm - dll pyc core rm - dll pyc core hellolib_wrap hellowrap py when run on the hellolib input file by this makefileswig generates two fileshellolib_wrap the generated extension module glue code file hellowrap py python module that imports the generated extension module the former is named for the input fileand the latter per the %module directive reallyswig generates two modules todayit uses combination of python and code to achieve the integration scripts ultimately import the generated python module filewhich internally imports the generated and compiled module you can wade through this generated code in the book' examples distribution if you are so inclinedbut it is prone to change over time and is too generalized to be simple to build the modulethe makefile runs swig to generate the glue codecompiles its outputcompiles the original library code if neededand then combines the result with the compiled wrapper to produce _hellowrap dllthe dll which hellowrap py will expect to find when imported by python script/pp /integrate/extend/swigdir hellolib makefile hellolib-swig /pp /integrate/extend/swigmake - makefile hellolib-swig /cygdrive/ /temp/swigwin-/swig -python - /hellolib hellolib gcc hellolib_wrap - - /hellolib - /usr/local/include/python - - hellolib_wrap gcc /hellolib/hellolib - - /hellolib - - /hellolib/hellolib gcc -shared hellolib_wrap /hellolib/hellolib - /usr/local/bin -lpython - _hellowrap dll /pp /integrate/extend/swigdir _hellowrap dll hellolib_wrap hellowrap py hellolib hellolib_wrap makefile hellolib-swig the result is dynamically loaded extension module file ready to be imported by python code like all modules_hellowrap dll mustalong with hellowrap pybe placed in directory on your python module search path (the directory where you compile will suffice if you run python there toonotice that the dll file must be built with leading underscore in its namethis is required because swig also created the py file of the same name without the underscore--if named the sameonly one could be python/ integration