Skip to contentSkip to conversation

trace-view: cleanup python make targets

PATCH New Darren Hart 1 participant 1 message Jan 5, 2010 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 trace-view: cleanup python make targets

Please pull the latest for-rostedt/trace-view git tree from:

git://git.kernel.org/pub/scm/linux/kernel/git/dvhart/trace-cmd.git for-rostedt/trace-view

---
 Makefile |   21 ++++++++++++---------
 1 files changed, 12 insertions(+), 9 deletions(-)
Makefile +12 -9
index 3d17256..4826dd1 100644
@@ -129,21 +129,24 @@ plugin_mac80211.so: plugin_mac80211.o
 	$(CC) -shared -nostartfiles -o $@ $<
 
 
-.PHONY: python
-python:	$(TCMD_LIB_OBJS)
+PYTHON_INCLUDES = `python-config --includes`
+PYGTK_CFLAGS = `pkg-config --cflags pygtk-2.0`
+
+ctracecmd.so: $(TCMD_LIB_OBJS)
 	swig -Wall -python -noproxy ctracecmd.i
-	#swig -Wall -python ctracecmd.i
-	gcc -fpic -c  `python-config --includes` ctracecmd_wrap.c
+	gcc -fpic -c $(PYTHON_INCLUDES)  ctracecmd_wrap.c
 	$(CC) --shared $^ ctracecmd_wrap.o -o ctracecmd.so
-	#$(CC) --shared $^ ctracecmd_wrap.o -o _ctracecmd.so
 
-.PHONY: python-gui
-python-gui: $(TRACE_VIEW_OBJS)
+ctracecmdgui.so: $(TRACE_VIEW_OBJS) $(LIB_FILE)
 	swig -Wall -python -noproxy ctracecmdgui.i
-	# FIXME: where do we get the pygtk include from?
-	gcc -fpic -c  `python-config --includes` $(CFLAGS) $(INCLUDES) -I/usr/include/pygtk-2.0/ ctracecmdgui_wrap.c
+	gcc -fpic -c  $(CFLAGS) $(INCLUDES) $(PYTHON_INCLUDES) $(PYGTK_CFLAGS) ctracecmdgui_wrap.c
 	$(CC) --shared $^ $(LIBS) $(CONFIG_LIBS) ctracecmdgui_wrap.o -o ctracecmdgui.so
 
+.PHONY: python
+python: ctracecmd.so
+
+.PHONY: python-gui
+python-gui: ctracecmd.so ctracecmdgui.so 
 
 .PHONY: force
 force:
Signature · 1 line
1.6.3.3