diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 23 |
1 files changed, 21 insertions, 2 deletions
@@ -439,12 +439,14 @@ clean: | |||
439 | ##### PYTHON STUFF ##### | 439 | ##### PYTHON STUFF ##### |
440 | 440 | ||
441 | PYTHON_INCLUDES = `python-config --includes` | 441 | PYTHON_INCLUDES = `python-config --includes` |
442 | PYTHON_LDFLAGS = `python-config --ldflags` \ | ||
443 | $(shell python -c "import distutils.sysconfig; print distutils.sysconfig.get_config_var('LINKFORSHARED')") | ||
442 | PYGTK_CFLAGS = `pkg-config --cflags pygtk-2.0` | 444 | PYGTK_CFLAGS = `pkg-config --cflags pygtk-2.0` |
443 | 445 | ||
444 | ctracecmd.so: $(TCMD_LIB_OBJS) | 446 | ctracecmd.so: $(TCMD_LIB_OBJS) ctracecmd.i |
445 | swig -Wall -python -noproxy ctracecmd.i | 447 | swig -Wall -python -noproxy ctracecmd.i |
446 | gcc -fpic -c $(PYTHON_INCLUDES) ctracecmd_wrap.c | 448 | gcc -fpic -c $(PYTHON_INCLUDES) ctracecmd_wrap.c |
447 | $(CC) --shared $^ ctracecmd_wrap.o -o ctracecmd.so | 449 | $(CC) --shared $(TCMD_LIB_OBJS) ctracecmd_wrap.o -o ctracecmd.so |
448 | 450 | ||
449 | ctracecmdgui.so: $(TRACE_VIEW_OBJS) $(LIB_FILE) | 451 | ctracecmdgui.so: $(TRACE_VIEW_OBJS) $(LIB_FILE) |
450 | swig -Wall -python -noproxy ctracecmdgui.i | 452 | swig -Wall -python -noproxy ctracecmdgui.i |
@@ -457,6 +459,23 @@ python: ctracecmd.so | |||
457 | PHONY += python-gui | 459 | PHONY += python-gui |
458 | python-gui: ctracecmd.so ctracecmdgui.so | 460 | python-gui: ctracecmd.so ctracecmdgui.so |
459 | 461 | ||
462 | PHONY += python-plugin | ||
463 | python-plugin: plugin_python.so python | ||
464 | |||
465 | do_compile_python_plugin_obj = \ | ||
466 | ($(print_plugin_obj_compile) \ | ||
467 | $(CC) -c $(CFLAGS) $(PYTHON_INCLUDES) -fPIC -o $@ $<) | ||
468 | |||
469 | do_python_plugin_build = \ | ||
470 | ($(print_plugin_build) \ | ||
471 | $(CC) -shared $(PYTHON_LDFLAGS) -o $@ $<) | ||
472 | |||
473 | plugin_python.o: %.o : $(src)/%.c | ||
474 | $(Q)$(do_compile_python_plugin_obj) | ||
475 | |||
476 | plugin_python.so: %.so: %.o | ||
477 | $(Q)$(do_python_plugin_build) | ||
478 | |||
460 | endif # skip-makefile | 479 | endif # skip-makefile |
461 | 480 | ||
462 | PHONY += force | 481 | PHONY += force |