blob: 85717c4d4ce1f5f8d920ccb120cf11248cb34959 (
plain)
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
CC = gcc
LD = ld
KERNEL = /usr/src/linux
#KERNEL = /lib/modules/`uname -r`/build
ARCH = $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/)
ifeq ($(KERNEL)/.config,$(wildcard $(KERNEL)/.config))
include $(KERNEL)/.config
endif
CFLAGS = -D__KERNEL__ -I${KERNEL}/include -Wall \
-Wstrict-prototypes -Wno-trigraphs -O2 \
-fomit-frame-pointer -fno-common \
-fno-strict-aliasing -pipe -DMODULE
# comment this if you don't want debugging information
CFLAGS += -DDEBUG
# see if we need module versions
ifdef CONFIG_MODVERSIONS
CFLAGS += -DMODVERSIONS
endif
ifeq ($(ARCH),alpha)
CFLAGS += -mno-fp-regs -ffixed-8 -mcpu=ev5 -Wa,-mev6
LDFLAGS = -m elf64alpha
endif
ifeq ($(ARCH),sparc64)
CFLAGS += -mno-fpu -mtune=ultrasparc -mmedlow -ffixed-g4 \
-fcall-used-g5 -fcall-used-g7
LDFLAGS = -m elf_sparc64
endif
ifeq ($(ARCH),i386)
CFLAGS += -mpreferred-stack-boundary=2 -march=i586
LDFLAGS = -m elf_i386
endif
ifeq ($(ARCH), x86_64)
CFLAGS += -mno-red-zone -mcmodel=kernel -fno-reorder-blocks \
-finline-limit=2000 -fno-strength-reduce
LDFLAGS = -m elf_x86_64
endif
ifeq ($(ARCH),ia64)
CFLAGS += -ffixed-r13 -mfixed-range=f10-f15,f32-f127 \
-falign-functions=32
LDFLAGS = -m elf64_ia64
endif
.SUFFIXES: .o .c .h
TARGET = bios.o
OBJS = bios_core.o flashchips.o pcisets.o \
filesystem.o procfs.o programming.o
all: $(TARGET) comp
$(TARGET): $(OBJS)
$(LD) $(LDFLAGS) -r -o $(TARGET) $(OBJS)
clean:
-rm -f $(TARGET) $(OBJS) comp *.o
.c.o:
$(CC) $(INCLUDES) -c $(INCDIRS) $(CFLAGS) $(X_CFLAGS) $(DEBUGFLAGS) $*.c -o $@
comp: comp.c
$(CC) comp.c -O2 -o comp
strip comp
bios_core.o: bios_core.c bios.h pcisets.h flashchips.h programming.h
filesystem.o: filesystem.c bios.h pcisets.h flashchips.h programming.h
flashchips.o: flashchips.c bios.h flashchips.h
pcisets.o: pcisets.c bios.h pcisets.h flashchips.h programming.h
procfs.o: procfs.c bios.h pcisets.h flashchips.h programming.h
programming.o: programming.c bios.h pcisets.h flashchips.h programming.h
|