File: Makefile

package info (click to toggle)
bcm5700 2.0.32-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 9,756 kB
  • ctags: 2,720
  • sloc: ansic: 10,152; makefile: 135
file content (76 lines) | stat: -rw-r--r-- 2,280 bytes parent folder | download
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
#!/usr/bin/make
# Makefile for building Linux Broadcom Gigabit ethernet driver as a module.
# $id$

# PREFIX may be set by the RPM build to set the effective root.
PREFIX=
ifeq ($(shell ls /lib/modules/`uname -r`/build > /dev/null 2>&1 && echo build),)
LINUX=/usr/src/linux
else
LINUX=/lib/modules/`uname -r`/build
endif

ifeq ($(shell which kgcc > /dev/null 2>&1 && echo kgcc),)
CC = gcc
else
CC = kgcc
endif
LD = ld
CFLAGS=-DMODULE -D__KERNEL__ -DDBG=0 -DT3_JUMBO_RCV_RCB_ENTRY_COUNT=256 -DNICE_SUPPORT -DPCIX_TARGET_WORKAROUND=1 -DINCLUDE_TBI_SUPPORT -DINCLUDE_5701_AX_FIX=1 -Wall -Wstrict-prototypes -O6 -I$(LINUX)/include

ifeq ($(wildcard ~/rpmdir),)
  rpmdir = /usr/src/redhat
else
  rpmdir = $(wildcard ~/rpmdir)
endif

# If the modversion.h file exists we should pass a flag.
# Most of my drivers have been updated to not need this, but not the other
# kernel source files.
#MODVER_H = $(LINUX)/include/linux/modversions.h
#ifneq ($(wildcard $(MODVER_H)),"")
#  CFLAGS += -DMODVERSIONS
#endif

ifdef DBG
  CFLAGS += -DTIGON3_DEBUG=1
endif

all: bcm5700.o
tar: bcm5700.tgz

bcm5700.o: b57um.o b57proc.o tigon3.o autoneg.o 5701rls.o
	$(LD) -i $^ -o $@

install: bcm5700.o
	@if [ -d $(PREFIX)/lib/modules/`uname -r`/kernel/drivers/net/bcm ];\
	then install -m 444 bcm5700.o $(PREFIX)/lib/modules/`uname -r`/kernel/drivers/net/bcm;\
	elif [ -d $(PREFIX)/lib/modules/`uname -r`/kernel ];\
	then mkdir -p $(PREFIX)/lib/modules/`uname -r`/kernel/drivers/net;\
	install -m 444 bcm5700.o $(PREFIX)/lib/modules/`uname -r`/kernel/drivers/net;\
	else mkdir -p $(PREFIX)/lib/modules/`uname -r`/net;\
	install -m 444 bcm5700.o $(PREFIX)/lib/modules/`uname -r`/net/;\
	fi
	@if [ "$(PREFIX)" = "" ]; then /sbin/depmod -a ;\
	else echo " *** Run '/sbin/depmod -a' to update the module database.";\
	fi
	@if [ -d $(PREFIX)/usr/share/man ];\
	then install -m 444 bcm5700.4.gz $(PREFIX)/usr/share/man/man4;\
	elif [ -d $(PREFIX)/usr/man ];\
	then install -m 444 bcm5700.4.gz $(PREFIX)/usr/man/man4;\
	fi

bcm5700.tgz: Makefile *.[cho] LICENSE RELEASE.TXT
	tar cfvz $@ $^

rpm: bcm5700.tgz bcm5700.spec
	cp -p $< ${rpmdir}/SOURCES/
	rpm -ba bcm5700.spec

.PHONEY: all clean install tar

debug:
	@make DBG=1

clean:
	-rm -f bcm5700.o b57um.o b57proc.o tigon3.o autoneg.o 5701rls.o bcm5700.tgz