From 36b934d241d2560be6693f90c9aba501a1ec0ae7 Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Thu, 17 Jun 2010 06:52:02 +0000 Subject: [PATCH] Move the skin parser to a seperate library git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26877 a1c6a512-1295-4272-9138-f99709370657 --- lib/skin_parser/Makefile | 28 ++++++++++++++++++ .../parser => lib/skin_parser}/skin_debug.c | 0 .../parser => lib/skin_parser}/skin_debug.h | 0 .../parser => lib/skin_parser}/skin_parser.c | 0 .../parser => lib/skin_parser}/skin_parser.h | 0 .../parser => lib/skin_parser}/skin_scan.c | 0 .../parser => lib/skin_parser}/skin_scan.h | 0 .../parser => lib/skin_parser}/symbols.h | 0 .../parser => lib/skin_parser}/tag_table.c | 0 .../parser => lib/skin_parser}/tag_table.h | 0 utils/themeeditor/themeeditor.pro | 29 +++++++++++-------- 11 files changed, 45 insertions(+), 12 deletions(-) create mode 100644 lib/skin_parser/Makefile rename {utils/themeeditor/parser => lib/skin_parser}/skin_debug.c (100%) rename {utils/themeeditor/parser => lib/skin_parser}/skin_debug.h (100%) rename {utils/themeeditor/parser => lib/skin_parser}/skin_parser.c (100%) rename {utils/themeeditor/parser => lib/skin_parser}/skin_parser.h (100%) rename {utils/themeeditor/parser => lib/skin_parser}/skin_scan.c (100%) rename {utils/themeeditor/parser => lib/skin_parser}/skin_scan.h (100%) rename {utils/themeeditor/parser => lib/skin_parser}/symbols.h (100%) rename {utils/themeeditor/parser => lib/skin_parser}/tag_table.c (100%) rename {utils/themeeditor/parser => lib/skin_parser}/tag_table.h (100%) diff --git a/lib/skin_parser/Makefile b/lib/skin_parser/Makefile new file mode 100644 index 0000000000..5c1be67578 --- /dev/null +++ b/lib/skin_parser/Makefile @@ -0,0 +1,28 @@ +# __________ __ ___. +# Open \______ \ ____ ____ | | _\_ |__ _______ ___ +# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / +# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < +# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ +# \/ \/ \/ \/ \/ +# $Id$ +# + +BUILDDIR ?= . + +SRC = skin_parser.c skin_debug.c skin_scan.c tag_table.c +OBJ := $(patsubst %.c,$(BUILDDIR)/%.o,$(SRC)) +OUT = $(BUILDDIR)/libskin_parser.a +CC = gcc +AR = ar +INCLUDES = -I. + +default: $(OUT) + +$(BUILDDIR)/%.o: %.c + $(CC) $(INCLUDES) $(CFLAGS) -c $< -o $@ + +$(OUT): $(OBJ) + $(AR) rcs $(OUT) $(OBJ) + +clean: + rm -f $(OBJ) $(OUT) diff --git a/utils/themeeditor/parser/skin_debug.c b/lib/skin_parser/skin_debug.c similarity index 100% rename from utils/themeeditor/parser/skin_debug.c rename to lib/skin_parser/skin_debug.c diff --git a/utils/themeeditor/parser/skin_debug.h b/lib/skin_parser/skin_debug.h similarity index 100% rename from utils/themeeditor/parser/skin_debug.h rename to lib/skin_parser/skin_debug.h diff --git a/utils/themeeditor/parser/skin_parser.c b/lib/skin_parser/skin_parser.c similarity index 100% rename from utils/themeeditor/parser/skin_parser.c rename to lib/skin_parser/skin_parser.c diff --git a/utils/themeeditor/parser/skin_parser.h b/lib/skin_parser/skin_parser.h similarity index 100% rename from utils/themeeditor/parser/skin_parser.h rename to lib/skin_parser/skin_parser.h diff --git a/utils/themeeditor/parser/skin_scan.c b/lib/skin_parser/skin_scan.c similarity index 100% rename from utils/themeeditor/parser/skin_scan.c rename to lib/skin_parser/skin_scan.c diff --git a/utils/themeeditor/parser/skin_scan.h b/lib/skin_parser/skin_scan.h similarity index 100% rename from utils/themeeditor/parser/skin_scan.h rename to lib/skin_parser/skin_scan.h diff --git a/utils/themeeditor/parser/symbols.h b/lib/skin_parser/symbols.h similarity index 100% rename from utils/themeeditor/parser/symbols.h rename to lib/skin_parser/symbols.h diff --git a/utils/themeeditor/parser/tag_table.c b/lib/skin_parser/tag_table.c similarity index 100% rename from utils/themeeditor/parser/tag_table.c rename to lib/skin_parser/tag_table.c diff --git a/utils/themeeditor/parser/tag_table.h b/lib/skin_parser/tag_table.h similarity index 100% rename from utils/themeeditor/parser/tag_table.h rename to lib/skin_parser/tag_table.h diff --git a/utils/themeeditor/themeeditor.pro b/utils/themeeditor/themeeditor.pro index 213bcd82d3..bf48bda7f2 100644 --- a/utils/themeeditor/themeeditor.pro +++ b/utils/themeeditor/themeeditor.pro @@ -5,17 +5,26 @@ UI_DIR = $$MYBUILDDIR/ui MOC_DIR = $$MYBUILDDIR/moc RCC_DIR = $$MYBUILDDIR/rcc +RBBASE_DIR = $$_PRO_FILE_PWD_ +RBBASE_DIR = $$replace(RBBASE_DIR,/utils/themeeditor,) + #Include directories INCLUDEPATH += gui -INCLUDEPATH += parser INCLUDEPATH += models -HEADERS += parser/tag_table.h \ - parser/symbols.h \ - parser/skin_parser.h \ - parser/skin_scan.h \ - parser/skin_debug.h \ - models/parsetreemodel.h \ + +# Stuff for the parse lib +libskin_parser.commands = @$(MAKE) \ + BUILDDIR=$$OBJECTS_DIR -C $$RBBASE_DIR/lib/skin_parser CC=\"$$QMAKE_CC\" +QMAKE_EXTRA_TARGETS += libskin_parser +PRE_TARGETDEPS += libskin_parser +INCLUDEPATH += $$RBBASE_DIR/lib/skin_parser +LIBS += -L$$OBJECTS_DIR -lskin_parser + + +DEPENDPATH = $$INCLUDEPATH + +HEADERS += models/parsetreemodel.h \ models/parsetreenode.h \ gui/editorwindow.h \ gui/skinhighlighter.h \ @@ -26,11 +35,7 @@ HEADERS += parser/tag_table.h \ gui/tabcontent.h \ gui/configdocument.h \ gui/skinviewer.h -SOURCES += parser/tag_table.c \ - parser/skin_parser.c \ - parser/skin_scan.c \ - parser/skin_debug.c \ - main.cpp \ +SOURCES += main.cpp \ models/parsetreemodel.cpp \ models/parsetreenode.cpp \ gui/editorwindow.cpp \