4 APPVERSION
=`../../tools/version.sh ../../`
7 # We use the UCL code available in the Rockbox tools/ directory
8 CFLAGS
=-I..
/..
/tools
/ucl
/include -Wall
-DVERSION
=\"$(APPVERSION
)\"
14 ifeq ($(findstring CYGWIN
,$(shell uname
)),CYGWIN
)
18 ifeq ($(findstring MINGW
,$(shell uname
)),MINGW
)
21 ifeq ($(findstring mingw
,$(CC
)),mingw
)
30 CFLAGS
+= -arch
$(RBARCH
)
31 OBJDIR
= $(TARGET_DIR
)build
/$(RBARCH
)/
33 OBJDIR
= $(TARGET_DIR
)build
/
40 LIBSOURCES
:= mkmpioboot.c
41 SOURCES
:= $(LIBSOURCES
) main.c
42 OBJS
:= $(patsubst %.c
,%.o
,$(addprefix $(OBJDIR
),$(SOURCES
)))
43 LIBOBJS
:= $(patsubst %.c
,%.o
,$(addprefix $(OBJDIR
),$(LIBSOURCES
)))
44 EXTRADEPS
:= $(LIBUCL
)
46 # explicit dependencies
47 $(OBJDIR
)mkmpioboot.o
: mkmpioboot.c mkmpioboot.h
48 $(OBJDIR
)main.o
: main.c
52 $(SILENT
)mkdir
-p
$(dir $@
)
53 $(SILENT
)$(CC
) $(CFLAGS
) -c
-o
$@
$<
55 libmkmpioboot
$(RBARCH
).a
: $(LIBOBJS
)
57 $(SILENT
)$(AR
) rucs
$(TARGET_DIR
)$@
$^
59 # building the standalone executable
60 $(OUTPUT
): $(OBJS
) $(EXTRADEPS
)
62 $(SILENT
)$(CC
) $(CFLAGS
) -o
$(OUTPUT
) $(OBJS
) $(EXTRADEPS
)
64 # some trickery to build ppc and i386 from a single call
66 $(TARGET_DIR
)libmkmpiobooti386.a
:
67 make RBARCH
=i386 TARGET_DIR
=$(TARGET_DIR
) libmkmpiobooti386.a
69 $(TARGET_DIR
)libmkmpiobootppc.a
:
70 make RBARCH
=ppc TARGET_DIR
=$(TARGET_DIR
) libmkmpiobootppc.a
73 libmkmpioboot-universal
: $(TARGET_DIR
)libmkmpiobooti386.a
$(TARGET_DIR
)libmkmpiobootppc.a
74 @echo lipo
$(TARGET_DIR
)libmkmpioboot.a
75 $(SILENT
) rm -f
$(TARGET_DIR
)libmkmpioboot.a
76 $(SILENT
)lipo
-create
$(TARGET_DIR
)libmkmpiobootppc.a
$(TARGET_DIR
)libmkmpiobooti386.a
-output
$(TARGET_DIR
)libmkmpioboot.a
79 rm -f
$(OBJS
) $(OUTPUT
) $(TARGET_DIR
)libmkmpioboot
*.a mkmpioboot.dmg
80 rm -rf mkmpioboot-
* i386 ppc
$(OBJDIR
)
84 mv mkmpioboot mkmpioboot-i386
88 mv mkmpioboot mkmpioboot-ppc
90 mkmpioboot-mac
: mkmpioboot-i386 mkmpioboot-ppc
91 $(SILENT
)lipo
-create mkmpioboot-ppc mkmpioboot-i386
-output mkmpioboot-mac
93 mkmpioboot.dmg
: mkmpioboot-mac
94 mkdir
-p mkmpioboot-dmg
95 cp
-p mkmpioboot-mac mkmpioboot-dmg
96 hdiutil create
-srcfolder mkmpioboot-dmg mkmpioboot.dmg