changeset 320:6e164a9dd46c

Fix the Makefile to generate files correctly. The filebrowser is not working yet.
author wycc
date Thu, 05 Mar 2009 08:19:43 +0800
parents 1633b5aadfc3
children 44cc65e7e234
files examples/menu/Makefile.am examples/menu/main.c
diffstat 2 files changed, 11 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/examples/menu/Makefile.am	Thu Mar 05 07:54:35 2009 +0800
+++ b/examples/menu/Makefile.am	Thu Mar 05 08:19:43 2009 +0800
@@ -4,29 +4,29 @@
 
 list.so:list.c list.h
 	$(MAKE) $(<:.svg=.o)
-	$(CC) -shared -o $@ $(<:.svg=.o)
+	$(CC) $(CFLAGS) -I ../../include -shared -o $@ $(<:.svg=.o)
 
-list.mb: $(srcdir)/list.svg
+list.svg.mb: $(srcdir)/list.svg
 	$(top_srcdir)/tools/svg2code.py $< $<.mb
 
-list.c: list.mb list.h
-	m4 -I $(top_srcdir)/tools mb_c_source.m4 $<.mb > $(<:.svg=.c)
+list.c: list.svg.mb list.h
+	m4 -I $(top_srcdir)/tools mb_c_source.m4 $< > $(<:.svg.mb=.c)
 
-list.h: list.mb
-	m4 -I $(top_srcdir)/tools mb_c_header.m4 $<.mb > $(<:.svg=.h)
+list.h: list.svg.mb
+	m4 -I $(top_srcdir)/tools mb_c_header.m4 $< > $(<:.svg.mb=.h)
 
 browser.so: browser.c browser.h
 	$(MAKE) $(<:.svg=.o)
-	$(CC) -shared -o $@ $(<:.svg=.o)
+	$(CC) $(CFLAGS) -I../../include  -I ../../include -shared -o $@ $(<:.svg=.o)
 
 browser.h: browser.mb
-	m4 -I $(top_srcdir)/tools mb_c_header.m4 $<.mb > $(<:.svg=.h)
+	m4 -I $(top_srcdir)/tools mb_c_header.m4 $(<:.svg=.mb) > $(<:.mb=.h)
 
 browser.c: browser.mb browser.h
-	m4 -I $(top_srcdir)/tools mb_c_source.m4 $<.mb > $(<:.svg=.c)
+	m4 -I $(top_srcdir)/tools mb_c_source.m4 $(<:.svg=.mb) > $(<:.mb=.c)
 
 browser.mb: $(srcdir)/browser.svg
-	$(top_srcdir)/tools/svg2code.py $< $<.mb
+	$(top_srcdir)/tools/svg2code.py $< $(<:.svg=.mb)
 
 noinst_PROGRAMS = menu filebrowser list.so browser.so
 EXTRA_DIST = 
--- a/examples/menu/main.c	Thu Mar 05 07:54:35 2009 +0800
+++ b/examples/menu/main.c	Thu Mar 05 08:19:43 2009 +0800
@@ -15,23 +15,9 @@
 #include <string.h>
 #include "menu.h"
 #include "mbapp.h"
+#include "animated_menu.h"
 
 
-typedef struct _mb_animated_menu {
-	char **titles;
-	int *menus_y;
-	int *items;
-	int top;
-	int cur;
-	int max;
-	int ready;
-	int speed;
-	MBApp *app;
-	mb_sprite_t *sprite;
-	mb_obj_t **objects;
-	mb_obj_t *lightbar;
-	void (*callback)(struct _mb_animated_menu *m, int sel);
-} mb_animated_menu_t;
 
 char *menus[] = {
 	"Item 1",