summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2012-01-05 21:23:35 +0000
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2012-01-05 21:23:35 +0000
commit1a26524d016c4184a46c118b965889312c1f93c5 (patch)
tree9bd8d1fe95dcaeeb6e35f25f62bf53632f4c26ac
parent139171046677818bf25c384726778f987ff91935 (diff)
downloadrockbox-1a26524d016c4184a46c118b965889312c1f93c5.tar.gz
rockbox-1a26524d016c4184a46c118b965889312c1f93c5.zip
Fix building mkamsboot on OS X.
mkamsboot requires libucl to be linked. Since the introduction of libtools.make the OS X specific universal library isn't triggered anymore so the libucl built uses the wrong architecture. Rockbox Utility builds libucl by itself and still triggers the universal library rule. Since ar can create fat archives but not operate on them adjust the ar call to not try to update the archive -- the archive is created anyway, so asking for an update is not really necessary. Remove any old archive first to make sure we're not trying to update one, since that would now fail. As a result the OS X specific hackery to build both ppc and i386 in a single call isn't necessary anymore. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31585 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--tools/ucl/src/Makefile31
1 files changed, 16 insertions, 15 deletions
diff --git a/tools/ucl/src/Makefile b/tools/ucl/src/Makefile
index c010cdf23c..8875522388 100644
--- a/tools/ucl/src/Makefile
+++ b/tools/ucl/src/Makefile
@@ -16,6 +16,20 @@ ifdef RBARCH
16CFLAGS += -arch $(RBARCH) 16CFLAGS += -arch $(RBARCH)
17endif 17endif
18 18
19# OS X specifics. Needs to consider cross compiling for Windows.
20ifeq ($(findstring Darwin,$(shell uname)),Darwin)
21ifneq ($(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.
25CFLAGS += -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.
28CC ?= gcc-4.0
29CFLAGS += -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4
30NATIVECC ?= gcc-4.0
31endif
32endif
19 33
20TARGET_DIR ?= $(shell pwd) 34TARGET_DIR ?= $(shell pwd)
21OBJDIR = $(TARGET_DIR)build$(RBARCH) 35OBJDIR = $(TARGET_DIR)build$(RBARCH)
@@ -40,27 +54,14 @@ $(TARGET_DIR)ucl.dll: $(OBJS)
40 54
41$(TARGET_DIR)libucl$(RBARCH).a: $(OBJS) 55$(TARGET_DIR)libucl$(RBARCH).a: $(OBJS)
42 @echo AR $(notdir $@) 56 @echo AR $(notdir $@)
43 $(SILENT)$(CROSS)$(AR) rucs $@ $(OBJS) >/dev/null 2>&1 57 $(SILENT)rm -f $@
58 $(SILENT)$(CROSS)$(AR) rcs $@ $(OBJS) >/dev/null 2>&1
44 59
45$(OBJDIR)/%.o: %.c 60$(OBJDIR)/%.o: %.c
46 @echo CC $< 61 @echo CC $<
47 $(SILENT)mkdir -p $(dir $@) 62 $(SILENT)mkdir -p $(dir $@)
48 $(SILENT)$(CROSS)$(CC) $(CFLAGS) -c $< -o $@ 63 $(SILENT)$(CROSS)$(CC) $(CFLAGS) -c $< -o $@
49 64
50# some trickery to build ppc and i386 from a single call
51ifeq ($(RBARCH),)
52$(TARGET_DIR)libucli386.a:
53 make RBARCH=i386 TARGET_DIR=$(TARGET_DIR) libucli386.a
54
55$(TARGET_DIR)libuclppc.a:
56 make RBARCH=ppc TARGET_DIR=$(TARGET_DIR) libuclppc.a
57endif
58
59libucl-universal: $(TARGET_DIR)libucli386.a $(TARGET_DIR)libuclppc.a
60 @echo lipo $(TARGET_DIR)libucl.a
61 $(SILENT) rm -f $(TARGET_DIR)libucl.a
62 $(SILENT)lipo -create $(TARGET_DIR)libuclppc.a $(TARGET_DIR)libucli386.a -output $(TARGET_DIR)libucl.a
63
64clean: 65clean:
65 rm -f $(TARGET_DIR)libucl*.a 66 rm -f $(TARGET_DIR)libucl*.a
66 rm -rf build* 67 rm -rf build*