forked from len0rd/rockbox
Rework libskin_parser Makefile for OS X support.
- add similar trickery that is used for the libraries used by Rockbox Utility to allow building as universal binary. - don't overwrite CC, we need to set this from outside for building OS X 10.4 compatible binaries. - extend Theme Editor project file to build 10.4 compatible binaries on OS X. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27323 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
eccc2bd009
commit
e464128c54
2 changed files with 61 additions and 18 deletions
|
|
@ -7,27 +7,62 @@
|
||||||
# $Id$
|
# $Id$
|
||||||
#
|
#
|
||||||
|
|
||||||
BUILDDIR ?= .
|
|
||||||
ifndef V
|
ifndef V
|
||||||
SILENT = @
|
SILENT = @
|
||||||
endif
|
endif
|
||||||
|
|
||||||
SRC = skin_buffer.c skin_parser.c skin_debug.c skin_scan.c tag_table.c
|
CC ?= gcc
|
||||||
OBJ := $(patsubst %.c,$(BUILDDIR)/%.o,$(SRC))
|
|
||||||
OUT = $(BUILDDIR)/libskin_parser.a
|
|
||||||
CC = gcc
|
|
||||||
AR = ar
|
AR = ar
|
||||||
INCLUDES = -I.
|
OUTPUT=libskin_parser
|
||||||
|
TARGET_DIR ?= ./
|
||||||
|
|
||||||
default: $(OUT)
|
# construct build directory if BUILDDIR is not set.
|
||||||
|
BUILDDIR ?= $(TARGET_DIR)build
|
||||||
|
|
||||||
$(BUILDDIR)/%.o: %.c
|
ifdef RBARCH
|
||||||
|
CFLAGS += -arch $(RBARCH)
|
||||||
|
OBJDIR = $(BUILDDIR)/$(RBARCH)/
|
||||||
|
else
|
||||||
|
OBJDIR = $(BUILDDIR)/
|
||||||
|
endif
|
||||||
|
|
||||||
|
# input files
|
||||||
|
SOURCES := skin_buffer.c skin_debug.c skin_parser.c skin_scan.c tag_table.c
|
||||||
|
OBJS := $(patsubst %.c,%.o,$(addprefix $(OBJDIR),$(SOURCES)))
|
||||||
|
|
||||||
|
all: $(OUTPUT).a
|
||||||
|
|
||||||
|
$(OBJDIR)%.o: %.c
|
||||||
@echo CC $<
|
@echo CC $<
|
||||||
$(SILENT)$(CC) $(INCLUDES) $(CFLAGS) -c $< -o $@
|
$(SILENT)mkdir -p $(dir $@)
|
||||||
|
$(SILENT)$(CC) $(CFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
$(OUT): $(OBJ)
|
ifeq ($(findstring Darwin,$(shell uname)),Darwin)
|
||||||
@echo AR $(notdir $(OUT))
|
# some trickery to build ppc and i386 from a single call
|
||||||
$(SILENT)$(AR) rcs $(OUT) $(OBJ)
|
$(OUTPUT).a: $(TARGET_DIR)$(OUTPUT)i386.a $(TARGET_DIR)$(OUTPUT)ppc.a
|
||||||
|
@echo lipo $(TARGET_DIR)$@
|
||||||
|
$(SILENT) rm -f $(TARGET_DIR)$(OUTPUT)
|
||||||
|
$(SILENT)lipo -create $(TARGET_DIR)$(OUTPUT)ppc.a $(TARGET_DIR)$(OUTPUT)i386.a -output $(TARGET_DIR)$(OUTPUT).a
|
||||||
|
|
||||||
|
ifneq ($(RBARCH),)
|
||||||
|
$(OUTPUT)$(RBARCH).a: $(OBJS)
|
||||||
|
@echo AR $@
|
||||||
|
$(SILENT)$(AR) ruc $(TARGET_DIR)$@ $^
|
||||||
|
else
|
||||||
|
$(TARGET_DIR)$(OUTPUT)i386.a:
|
||||||
|
make RBARCH=i386 TARGET_DIR=$(TARGET_DIR) $(OUTPUT)i386.a
|
||||||
|
|
||||||
|
$(TARGET_DIR)$(OUTPUT)ppc.a:
|
||||||
|
make RBARCH=ppc TARGET_DIR=$(TARGET_DIR) $(OUTPUT)ppc.a
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
$(OUTPUT).a: $(OBJS)
|
||||||
|
@echo AR $@
|
||||||
|
$(SILENT)$(AR) ruc $(TARGET_DIR)$@ $^
|
||||||
|
endif
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f $(OBJ) $(OUT)
|
rm -f $(OBJS) $(OUTPUT) $(TARGET_DIR)$(OUTPUT)*.a
|
||||||
|
ifeq ($(findstring Darwin,$(shell uname)),Darwin)
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,15 +14,15 @@ INCLUDEPATH += graphics
|
||||||
|
|
||||||
# Stuff for the parse lib
|
# Stuff for the parse lib
|
||||||
libskin_parser.commands = @$(MAKE) \
|
libskin_parser.commands = @$(MAKE) \
|
||||||
|
TARGET_DIR=$$MYBUILDDIR CC=\"$$QMAKE_CC\" \
|
||||||
BUILDDIR=$$OBJECTS_DIR \
|
BUILDDIR=$$OBJECTS_DIR \
|
||||||
-C \
|
-C $$RBBASE_DIR/lib/skin_parser \
|
||||||
$$RBBASE_DIR/lib/skin_parser \
|
libskin_parser.a
|
||||||
CC=\"$$QMAKE_CC\"
|
|
||||||
QMAKE_EXTRA_TARGETS += libskin_parser
|
QMAKE_EXTRA_TARGETS += libskin_parser
|
||||||
PRE_TARGETDEPS += libskin_parser
|
PRE_TARGETDEPS += libskin_parser
|
||||||
INCLUDEPATH += $$RBBASE_DIR/lib/skin_parser
|
INCLUDEPATH += $$RBBASE_DIR/lib/skin_parser
|
||||||
LIBS += -L$$OBJECTS_DIR \
|
LIBS += -L$$MYBUILDDIR -lskin_parser
|
||||||
-lskin_parser
|
|
||||||
DEPENDPATH = $$INCLUDEPATH
|
DEPENDPATH = $$INCLUDEPATH
|
||||||
HEADERS += models/parsetreemodel.h \
|
HEADERS += models/parsetreemodel.h \
|
||||||
models/parsetreenode.h \
|
models/parsetreenode.h \
|
||||||
|
|
@ -82,3 +82,11 @@ FORMS += gui/editorwindow.ui \
|
||||||
gui/skinviewer.ui \
|
gui/skinviewer.ui \
|
||||||
gui/findreplacedialog.ui
|
gui/findreplacedialog.ui
|
||||||
RESOURCES += resources.qrc
|
RESOURCES += resources.qrc
|
||||||
|
|
||||||
|
macx {
|
||||||
|
QMAKE_MAC_SDK=/Developer/SDKs/MacOSX10.4u.sdk
|
||||||
|
QMAKE_LFLAGS_PPC=-mmacosx-version-min=10.4 -arch ppc
|
||||||
|
QMAKE_LFLAGS_X86=-mmacosx-version-min=10.4 -arch i386
|
||||||
|
CONFIG+=x86 ppc
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue