4 KERNEL = /usr/src/linux
5 #KERNEL = /lib/modules/`uname -r`/build
7 ARCH = $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/)
9 ifeq ($(KERNEL)/.config,$(wildcard $(KERNEL)/.config))
10 include $(KERNEL)/.config
13 CFLAGS = -D__KERNEL__ -I${KERNEL}/include -Wall \
14 -Wstrict-prototypes -Wno-trigraphs -O2 \
15 -fomit-frame-pointer -fno-common \
16 -fno-strict-aliasing -pipe -DMODULE
18 # comment this if you don't want debugging information
21 # see if we need module versions
22 ifdef CONFIG_MODVERSIONS
23 CFLAGS += -DMODVERSIONS
27 CFLAGS += -mno-fp-regs -ffixed-8 -mcpu=ev5 -Wa,-mev6
28 LDFLAGS = -m elf64alpha
31 ifeq ($(ARCH),sparc64)
32 CFLAGS += -mno-fpu -mtune=ultrasparc -mmedlow -ffixed-g4 \
33 -fcall-used-g5 -fcall-used-g7
34 LDFLAGS = -m elf_sparc64
38 CFLAGS += -mpreferred-stack-boundary=2 -march=i586
42 ifeq ($(ARCH), x86_64)
43 CFLAGS += -mno-red-zone -mcmodel=kernel -fno-reorder-blocks \
44 -finline-limit=2000 -fno-strength-reduce
45 LDFLAGS = -m elf_x86_64
49 CFLAGS += -ffixed-r13 -mfixed-range=f10-f15,f32-f127 \
51 LDFLAGS = -m elf64_ia64
57 OBJS = bios_core.o flashchips.o pcisets.o \
58 filesystem.o procfs.o programming.o
63 $(LD) $(LDFLAGS) -r -o $(TARGET) $(OBJS)
66 -rm -f $(TARGET) $(OBJS) comp *.o
69 $(CC) $(INCLUDES) -c $(INCDIRS) $(CFLAGS) $(X_CFLAGS) $(DEBUGFLAGS) $*.c -o $@
72 $(CC) comp.c -O2 -o comp
75 bios_core.o: bios_core.c bios.h pcisets.h flashchips.h programming.h
76 filesystem.o: filesystem.c bios.h pcisets.h flashchips.h programming.h
77 flashchips.o: flashchips.c bios.h flashchips.h
78 pcisets.o: pcisets.c bios.h pcisets.h flashchips.h programming.h
79 procfs.o: procfs.c bios.h pcisets.h flashchips.h programming.h
80 programming.o: programming.c bios.h pcisets.h flashchips.h programming.h