ipodpatcher: replace ipod2c with bin2c.
[maemo-rb.git] / lib / skin_parser / Makefile
blob5105b040fd9352ee2ec4d223cfad0af2edc5a370
1 # __________ __ ___.
2 # Open \______ \ ____ ____ | | _\_ |__ _______ ___
3 # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4 # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5 # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6 # \/ \/ \/ \/ \/
7 # $Id$
10 ifndef V
11 SILENT = @
12 endif
14 CC ?= gcc
15 AR ?= ar
16 OUTPUT=libskin_parser
17 TARGET_DIR ?= ./
19 # construct build directory if BUILDDIR is not set.
20 BUILDDIR ?= $(TARGET_DIR)build
21 TARGETPLATFORM ?= $(shell uname)
23 ifdef RBARCH
24 CFLAGS += -arch $(RBARCH)
25 OBJDIR = $(BUILDDIR)/$(RBARCH)/
26 else
27 OBJDIR = $(BUILDDIR)/
28 endif
30 # input files
31 SOURCES := skin_buffer.c skin_debug.c skin_parser.c skin_scan.c tag_table.c
32 OBJS := $(patsubst %.c,%.o,$(addprefix $(OBJDIR),$(SOURCES)))
34 all: $(OUTPUT).a
36 $(OBJDIR)%.o: %.c
37 @echo CC $<
38 $(SILENT)mkdir -p $(dir $@)
39 $(SILENT)$(CC) $(CFLAGS) -c -o $@ $<
41 ifeq ($(findstring Darwin,$(TARGETPLATFORM)),Darwin)
42 # some trickery to build ppc and i386 from a single call
43 $(OUTPUT).a: $(TARGET_DIR)$(OUTPUT)i386.a $(TARGET_DIR)$(OUTPUT)ppc.a
44 @echo lipo $(TARGET_DIR)$@
45 $(SILENT) rm -f $(TARGET_DIR)$(OUTPUT)
46 $(SILENT)lipo -create $(TARGET_DIR)$(OUTPUT)ppc.a $(TARGET_DIR)$(OUTPUT)i386.a -output $(TARGET_DIR)$(OUTPUT).a
48 ifneq ($(RBARCH),)
49 $(OUTPUT)$(RBARCH).a: $(OBJS)
50 @echo AR $@
51 $(SILENT)$(AR) ruc $(TARGET_DIR)$@ $^
52 else
53 $(TARGET_DIR)$(OUTPUT)i386.a:
54 make RBARCH=i386 TARGET_DIR=$(TARGET_DIR) $(OUTPUT)i386.a
56 $(TARGET_DIR)$(OUTPUT)ppc.a:
57 make RBARCH=ppc TARGET_DIR=$(TARGET_DIR) $(OUTPUT)ppc.a
58 endif
59 else
60 $(OUTPUT).a: $(OBJS)
61 @echo AR $@
62 $(SILENT)$(AR) ruc $(TARGET_DIR)$@ $^
63 endif
65 clean:
66 rm -f $(OBJS) $(OUTPUT) $(TARGET_DIR)$(OUTPUT)*.a
67 ifeq ($(findstring Darwin,$(shell uname)),Darwin)
68 endif