forked from Xbox-Linux-2/xbeboot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
58 lines (47 loc) · 1.49 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
### compilers and options
CC = gcc
#for 128mb ram support add EXTRA_CFLAGS=-DRAM_UPGRADED_XBOX
CFLAGS = -m32 -march=pentium3 -Werror -DXBE $(EXTRA_CFLAGS)
LD = ld
LDFLAGS = -s -S -T ldscript.ld
OBJCOPY = objcopy
RESOURCES =
TOPDIR := $(shell /bin/pwd)
### objects
OBJECTS = $(TOPDIR)/header.o
OBJECTS += $(TOPDIR)/load.o
OBJECTS += $(TOPDIR)/setup.o
OBJECTS += $(TOPDIR)/escape.o
OBJECTS += $(TOPDIR)/I2C_io.o
OBJECTS += $(TOPDIR)/BootParser.o
OBJECTS += $(TOPDIR)/BootString.o
OBJECTS += $(TOPDIR)/BootEEPROM.o
OBJECTS += $(TOPDIR)/BootMemory.o
OBJECTS += $(TOPDIR)/VideoInitialization.o
OBJECTS += $(TOPDIR)/BootVgaInitialization.o
# target:
all : clean image default.xbe
iso : linux.iso
linux.iso: default.xbe
mkisofs -udf $< linuxboot.cfg vmlinuz initrd > $@
image:
$(CC) $(EXTRA_CFLAGS) $(TOPDIR)/imagebld/imagebld.c $(TOPDIR)/imagebld/sha1.c -o $(TOPDIR)/imagebld/image
default.elf : ${OBJECTS} ${RESOURCES}
${LD} -o default.elf ${OBJECTS} ${RESOURCES} ${LDFLAGS}
clean :
rm -rf *.o *~ core *.core image ${OBJECTS} ${RESOURCES} default.elf
rm -f default.xbe
rm -f linux.iso
rm -f $(TOPDIR)/imagebld/image
rm -f xbeboot.xbe
#mkdir $(TOPDIR)/obj -p
### rules:
%.o : %.c
${CC} ${CFLAGS} -o $@ -c $<
%.o : %.S
${CC} -DASSEMBLER ${CFLAGS} -o $@ -c $<
%.xbe : %.elf
${OBJCOPY} --output-target=binary --strip-all $< $@
$(TOPDIR)/imagebld/image -build $(TOPDIR)/default.xbe $(TOPDIR)/vmlinuz $(TOPDIR)/initramfs.cpio.gz $(TOPDIR)/linuxboot.cfg
cp default.xbe xbeboot.xbe
@ls -l $@