2 # Open \______ \ ____ ____ | | _\_ |__ _______ ___
3 # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4 # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5 # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
16 CFLAGS
+= -arch
$(RBARCH
)
19 # OS X specifics. Needs to consider cross compiling for Windows.
20 ifeq ($(findstring Darwin
,$(shell uname
)),Darwin
)
21 ifneq ($(findstring mingw
,$(CROSS
)$(CC
)),mingw
)
22 # when building libs for OS X build for both i386 and ppc at the same time.
23 # This creates fat objects, and ar can only create the archive but not operate
24 # on it. As a result the ar call must NOT use the u (update) flag.
25 CFLAGS
+= -arch ppc
-arch i386
26 # building against SDK 10.4 is not compatible with gcc-4.2 (default on newer Xcode)
27 # might need adjustment for older Xcode.
29 CFLAGS
+= -isysroot
/Developer
/SDKs
/MacOSX10.4u.sdk
-mmacosx-version-min
=10.4
34 TARGET_DIR ?
= $(shell pwd
)/
35 OBJDIR
= $(TARGET_DIR
)build
$(RBARCH
)
37 SOURCES
= alloc.c io.c n2b_99.c n2b_d.c n2b_ds.c n2b_to.c n2d_99.c \
38 n2d_d.c n2d_ds.c n2d_to.c n2e_99.c n2e_d.c n2e_ds.c n2e_to.c ucl_crc.c \
39 ucl_init.c ucl_ptr.c ucl_str.c ucl_util.c
#ucl_dll.c
41 OBJS
= $(addprefix $(OBJDIR
)/,$(SOURCES
:%.c
=%.o
))
43 # This Makefile is _not_ used to build uclpack for Rockbox builds anymore (they
44 # use tools.make), so we can use $(CC) and $(AR) here.
46 libucl
$(RBARCH
).a
: $(TARGET_DIR
)libucl
$(RBARCH
).a
49 ucl.dll
: $(TARGET_DIR
)ucl.dll
50 $(TARGET_DIR
)ucl.dll
: $(OBJS
)
51 @echo DLL
$(notdir $@
)
52 $(SILENT
)$(CROSS
)$(CC
) $(CFLAGS
) -shared
-o
$@
$^ \
53 -Wl
,--output-def
,$(TARGET_DIR
)ucl.def
55 $(TARGET_DIR
)libucl
$(RBARCH
).a
: $(OBJS
)
58 $(SILENT
)$(CROSS
)$(AR
) rcs
$@
$(OBJS
) >/dev
/null
2>&1
62 $(SILENT
)mkdir
-p
$(dir $@
)
63 $(SILENT
)$(CROSS
)$(CC
) $(CFLAGS
) -c
$< -o
$@
66 rm -f
$(TARGET_DIR
)libucl
*.a