OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rc203soc/] [sw/] [uClinux/] [arch/] [i386/] [boot/] [compressed/] [Makefile] - Blame information for rev 1777

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1623 jcastillo
#
2
# linux/arch/i386/boot/compressed/Makefile
3
#
4
# create a compressed vmlinux image from the original vmlinux
5
#
6
 
7
HEAD = head.o
8
SYSTEM = $(TOPDIR)/vmlinux
9
 
10
OBJECTS = $(HEAD) misc.o
11
 
12
CFLAGS = -O2 -DSTDC_HEADERS
13
 
14
ifdef SMP
15
CFLAGS := $(CFLAGS) -D__SMP__
16
endif
17
 
18
ifdef CONFIG_KERNEL_ELF
19
TARGET=--target elf32-i386
20
INPUT_DATA=input_data
21
INPUT_LEN=input_len
22
endif
23
 
24
all: vmlinux
25
 
26
vmlinux: piggy.o $(OBJECTS)
27
        $(LD) $(ZLINKFLAGS) -o vmlinux $(OBJECTS) piggy.o
28
 
29
bvmlinux: piggy.o $(OBJECTS)
30
        $(LD) $(BZLINKFLAGS) -o bvmlinux $(OBJECTS) piggy.o
31
 
32
ifdef SMP
33
 
34
head.o: head.S $(TOPDIR)/include/linux/tasks.h
35
        $(CC) -D__SMP__ -traditional -c head.S
36
 
37
else
38
 
39
head.o: head.S $(TOPDIR)/include/linux/tasks.h
40
        $(CC) -traditional -c head.S
41
 
42
endif
43
 
44
ifdef CONFIG_KERNEL_ELF
45
 
46
# You cannot compress a file and have the kernel uncompress it, it must
47
# be stdin
48
piggy.o:        $(SYSTEM)
49
        tmppiggy=/tmp/$$$$piggy; \
50
        rm -f $$tmppiggy $$tmppiggy.gz $$tmppiggy.lnk; \
51
        if hash $(ENCAPS) 2> /dev/null; then \
52
          $(OBJDUMP) $(OBJDUMP_FLAGS) -o $(IMAGE_OFFSET) $(SYSTEM) > $$tmppiggy; \
53
        else \
54
          $(OBJCOPY) $(SYSTEM) $$tmppiggy; \
55
        fi; \
56
        gzip -f -9 < $$tmppiggy > $$tmppiggy.gz; \
57
        if hash $(ENCAPS) 2> /dev/null; then \
58
          $(ENCAPS) $(TARGET) piggy.o $$tmppiggy.gz $(INPUT_DATA) $(INPUT_LEN); \
59
        else \
60
          echo "SECTIONS { .data : { input_len = .; LONG(input_data_end - input_data) input_data = .; *(.data) input_data_end = .; }}" > $$tmppiggy.lnk; \
61
          $(LD) -m elf_i386 -r -o piggy.o -b binary $$tmppiggy.gz -b elf32-i386 -T $$tmppiggy.lnk; \
62
        fi; \
63
        rm -f $$tmppiggy $$tmppiggy.gz $$tmppiggy.lnk
64
else
65
 
66
piggy.o:        $(SYSTEM) xtract piggyback
67
                ./xtract $(SYSTEM) | gzip -9 | ./piggyback > piggy.o
68
 
69
xtract: xtract.c
70
        $(HOSTCC) $(CFLAGS) -o xtract xtract.c
71
 
72
piggyback: piggyback.c
73
        $(HOSTCC) $(CFLAGS) -o piggyback piggyback.c
74
 
75
endif
76
 
77
clean:
78
        rm -f xtract piggyback vmlinux bvmlinux

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.