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
/
39 # additional link dependencies for the standalone executable
40 LIBUCL
=..
/..
/tools
/ucl
/src
/libucl
$(RBARCH
).a
43 $(MAKE
) -C ..
/..
/tools
/ucl
/src
$(TARGET_DIR
)libucl
$(RBARCH
).a
46 LIBSOURCES
:= dualboot.c md5.c mkamsboot.c
47 SOURCES
:= $(LIBSOURCES
) main.c
48 OBJS
:= $(patsubst %.c
,%.o
,$(addprefix $(OBJDIR
),$(SOURCES
)))
49 LIBOBJS
:= $(patsubst %.c
,%.o
,$(addprefix $(OBJDIR
),$(LIBSOURCES
)))
50 EXTRADEPS
:= $(LIBUCL
)
52 # explicit dependencies on dualboot.{c,h} and mkamsboot.h
53 $(OBJDIR
)mkamsboot.o
: dualboot.h dualboot.c mkamsboot.c mkamsboot.h
54 $(OBJDIR
)main.o
: dualboot.h dualboot.c main.c mkamsboot.h
58 $(SILENT
)mkdir
-p
$(dir $@
)
59 $(SILENT
)$(CC
) $(CFLAGS
) -c
-o
$@
$<
61 libmkamsboot
$(RBARCH
).a
: $(LIBOBJS
)
63 $(SILENT
)$(AR
) ruc
$(TARGET_DIR
)$@
$^
65 # building the standalone executable
66 $(OUTPUT
): $(OBJS
) $(EXTRADEPS
)
68 $(SILENT
)$(CC
) $(CFLAGS
) -o
$(OUTPUT
) $(OBJS
) $(EXTRADEPS
)
70 # some trickery to build ppc and i386 from a single call
72 $(TARGET_DIR
)libmkamsbooti386.a
:
73 make RBARCH
=i386 TARGET_DIR
=$(TARGET_DIR
) libmkamsbooti386.a
75 $(TARGET_DIR
)libmkamsbootppc.a
:
76 make RBARCH
=ppc TARGET_DIR
=$(TARGET_DIR
) libmkamsbootppc.a
79 libmkamsboot-universal
: $(TARGET_DIR
)libmkamsbooti386.a
$(TARGET_DIR
)libmkamsbootppc.a
80 @echo lipo
$(TARGET_DIR
)libmkamsboot.a
81 $(SILENT
) rm -f
$(TARGET_DIR
)libmkamsboot.a
82 $(SILENT
)lipo
-create
$(TARGET_DIR
)libmkamsbootppc.a
$(TARGET_DIR
)libmkamsbooti386.a
-output
$(TARGET_DIR
)libmkamsboot.a
85 rm -f
$(OBJS
) $(OUTPUT
) libmkamsboot.o
$(TARGET_DIR
)libmkamsboot
*.a mkamsboot.dmg
86 rm -rf mkamsboot-
* i386 ppc
$(OBJDIR
)
90 mv mkamsboot mkamsboot-i386
94 mv mkamsboot mkamsboot-ppc
96 mkamsboot-mac
: mkamsboot-i386 mkamsboot-ppc
97 $(SILENT
)lipo
-create mkamsboot-ppc mkamsboot-i386
-output mkamsboot-mac
99 mkamsboot.dmg
: mkamsboot-mac
100 mkdir
-p mkamsboot-dmg
101 cp
-p mkamsboot-mac mkamsboot-dmg
102 hdiutil create
-srcfolder mkamsboot-dmg mkamsboot.dmg