changeset 331:2a8bf3efbc67

Change makefile to support building in other directory. - Autoconf support building directory other than source directory.
author Thinker K.F. Li <thinker@branda.to>
date Fri, 06 Mar 2009 23:02:32 +0800
parents b0571f10c1b8
children f90c60967a9c
files examples/dynamic/Makefile.am
diffstat 1 files changed, 42 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/examples/dynamic/Makefile.am	Fri Mar 06 21:04:52 2009 +0800
+++ b/examples/dynamic/Makefile.am	Fri Mar 06 23:02:32 2009 +0800
@@ -2,26 +2,6 @@
 
 #SUFFIXES=.svg .mbso
 
-button.so:button.svg
-	$(top_srcdir)/tools/svg2code.py $< $<.mb
-	m4 -I $(top_srcdir)/tools mb_c_source.m4 $<.mb > $(<:.svg=.c)
-	m4 -I $(top_srcdir)/tools mb_c_header.m4 $<.mb > $(<:.svg=.h)
-	$(MAKE) $(<:.svg=.o)
-	$(CC) -shared -o $@ $(<:.svg=.o)
-
-mytext.so:mytext.svg
-	$(top_srcdir)/tools/svg2code.py $< $<.mb
-	m4 -I $(top_srcdir)/tools mb_c_source.m4 $<.mb > $(<:.svg=.c)
-	m4 -I $(top_srcdir)/tools mb_c_header.m4 $<.mb > $(<:.svg=.h)
-	$(MAKE) $(<:.svg=.o)
-	$(CC) -shared -o $@ $(<:.svg=.o)
-scene.so:scene.svg
-	$(top_srcdir)/tools/svg2code.py $< $<.mb
-	m4 -I $(top_srcdir)/tools mb_c_source.m4 $<.mb > $(<:.svg=.c)
-	m4 -I $(top_srcdir)/tools mb_c_header.m4 $<.mb > $(<:.svg=.h)
-	$(MAKE) $(<:.svg=.o)
-	$(CC) -shared -o $@ $(<:.svg=.o)
-
 noinst_PROGRAMS = dynamic hello text button.so mytext.so scene.so
 EXTRA_DIST = menu.svg button.svg
 
@@ -43,3 +23,45 @@
 text_LDFLAGS = @pangocairo_LIBS@ 
 text_LDADD = $(top_builddir)/src/libmbfly.la
 
+button.so: button.o
+	$(CC) $(CFLAGS) -I ../../include -shared -o $@ $<
+
+button.o: button.c button.h
+
+button.c: button.mb
+	m4 -I $(top_srcdir)/tools mb_c_source.m4 $< > $@
+
+button.h: button.mb
+	m4 -I $(top_srcdir)/tools mb_c_header.m4 $< > $@
+
+button.mb: button.svg
+	$(top_srcdir)/tools/svg2code.py $< $@
+
+mytext.so: mytext.o
+	$(CC) $(CFLAGS) -I ../../include -shared -o $@ $<
+
+mytext.o: mytext.c mytext.h
+
+mytext.c: mytext.mb
+	m4 -I $(top_srcdir)/tools mb_c_source.m4 $< > $@
+
+mytext.h: mytext.mb
+	m4 -I $(top_srcdir)/tools mb_c_header.m4 $< > $@
+
+mytext.mb: mytext.svg
+	$(top_srcdir)/tools/svg2code.py $< $@
+
+scene.so: scene.o
+	$(CC) $(CFLAGS) -I ../../include -shared -o $@ $<
+
+scene.o: scene.c scene.h
+
+scene.c: scene.mb
+	m4 -I $(top_srcdir)/tools mb_c_source.m4 $< > $@
+
+scene.h: scene.mb
+	m4 -I $(top_srcdir)/tools mb_c_header.m4 $< > $@
+
+scene.mb: scene.svg
+	$(top_srcdir)/tools/svg2code.py $< $@
+