Skip to content
Browse files

created /etc/widgets for widgets

  • Loading branch information...
1 parent 8907e02 commit 0476c3fc2c943618bcc31a948d84dbfabeaf33a2 @jrepan jrepan committed Jul 12, 2011
Showing with 13 additions and 4 deletions.
  1. +1 −1 Makefile
  2. +11 −2 libtoolkit/Makefile
  3. +1 −1 libtoolkit/widget.c
  4. 0 {etc → libtoolkit/widgets}/label.lua
View
2 Makefile
@@ -66,7 +66,7 @@ image: all
@ cp bin/* boot/bin
@ cp lib/dl.so boot/lib
@ cp sbin/* boot/sbin
- @ cp etc/* boot/etc
+ @ cp -r etc/* boot/etc
@ export BUILDDIR
@ run/make_image.sh
View
13 libtoolkit/Makefile
@@ -1,5 +1,6 @@
SOURCES := $(patsubst %.c,%.o,$(shell find . -name "*.c"))
HEADERS := $(shell find inc -name "*.h")
+WIDGETS := $(shell find widgets -name "*.lua")
SUBDIR := libtoolkit
STATIC := libtoolkit.a
CFLAGS += -I$(BUILDDIR)/$(SUBDIR)/inc
@@ -10,13 +11,21 @@ all: $(STATIC)
headers_dir:
@ echo " MKDIR " $(BUILDDIR)/inc/toolkit
- @ mkdir -p $(BUILDDIR)/inc/toolkit
+ @ mkdir -p $(BUILDDIR)/inc/toolkit
+
+widgets_dir:
+ @ echo " MKDIR " $(BUILDDIR)/etc/widgets
+ @ mkdir -p $(BUILDDIR)/etc/widgets
$(HEADERS): headers_dir
@ echo " CP " $(SUBDIR)/$@ "->" $(BUILDDIR)/inc
@ cp $@ $(BUILDDIR)/inc/toolkit/
-$(STATIC): $(HEADERS) $(SOURCES)
+$(WIDGETS): widgets_dir
+ @ echo " CP " $(SUBDIR)/$@ "->" $(BUILDDIR)/etc/widgets
+ @ cp $@ $(BUILDDIR)/etc/widgets
+
+$(STATIC): $(WIDGETS) $(HEADERS) $(SOURCES)
@ echo " AR " $(SUBDIR)/$(STATIC)
@ $(AR) $(ARFLAGS) $(STATIC) $(SOURCES)
@ echo " CP " $(SUBDIR)/$(STATIC) "->" $(BUILDDIR)/lib
View
2 libtoolkit/widget.c
@@ -88,7 +88,7 @@ struct widget *add_widget(const char *name, int x, int y, int w, int h) {
mutex_spin(&mutex);
- filename = saprintf("/etc/%s.lua", name);
+ filename = saprintf("/etc/widgets/%s.lua", name);
if (luaL_loadfile(L, filename)) {
free(widget);
free(filename);
View
0 etc/label.lua → libtoolkit/widgets/label.lua
File renamed without changes.

0 comments on commit 0476c3f

Please sign in to comment.
Something went wrong with that request. Please try again.