2 # Open \______ \ ____ ____ | | _\_ |__ _______ ___
3 # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4 # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5 # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
19 # construct build directory if BUILDDIR is not set.
20 BUILDDIR ?
= $(TARGET_DIR
)build
21 TARGETPLATFORM ?
= $(shell uname
)
24 CFLAGS
+= -arch
$(RBARCH
)
25 OBJDIR
= $(BUILDDIR
)/$(RBARCH
)/
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
)))
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
49 $(OUTPUT
)$(RBARCH
).a
: $(OBJS
)
51 $(SILENT
)$(AR
) ruc
$(TARGET_DIR
)$@
$^
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
62 $(SILENT
)$(AR
) ruc
$(TARGET_DIR
)$@
$^
66 rm -f
$(OBJS
) $(OUTPUT
) $(TARGET_DIR
)$(OUTPUT
)*.a
67 ifeq ($(findstring Darwin
,$(shell uname
)),Darwin
)