xref: /titanic_51/usr/src/grub/grub-0.97/netboot/Makefile.solaris (revision 1e49577a7fcde812700ded04431b49d67cc57d6d)
1#
2# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
3# Use is subject to license terms.
4#
5# ident	"%Z%%M%	%I%	%E% SMI"
6#
7include ../../Makefile.grub
8include ../Makefile.solaris.defs
9
10LIBDRIVERS = libdrivers.a
11
12LIBDRIVERS_OBJS	= $(LIB_OBJS) $(DRIVER_OBJS)
13
14LIB_OBJS	= libdrivers_a-basemem.o	\
15		  libdrivers_a-config.o		\
16		  libdrivers_a-fsys_tftp.o	\
17		  libdrivers_a-i386_timer.o	\
18		  libdrivers_a-misc.o		\
19		  libdrivers_a-nic.o		\
20		  libdrivers_a-pci.o		\
21		  libdrivers_a-pci_io.o		\
22		  libdrivers_a-pic8259.o	\
23		  libdrivers_a-timer.o
24$(LIB_OBJS)	:= CFLAGS = $(BASE_CFLAGS) -Os -fno-builtin -nostdinc \
25			-DFSYS_TFTP=1 $(NET_CFLAGS) $(NET_EXTRAFLAGS)
26
27#
28# The following netboot drivers are available.
29# NOTE: Compiling too many netboot drivers into stage2 could cause GRUB to
30#	crash or misbehave.
31# NOTE: NET_CFLAGS has to be adjusted to correspond to the drivers
32#	selected in $(DRIVER_OBJS).
33#
34#	3c595.o		- 3Com595 driver
35#	3c90x.o		- 3Com90x driver
36#	davicom.o	- Davicom driver
37#	e1000.o		- Etherexpress Pro/1000 driver
38#	eepro100.o	- Etherexpress Pro/100 driver
39#	epic100.o	- SMC 83c170 EPIC/100 driver
40#	forcedeth.o	- Nvidia Geforce driver
41#	natsemi.o	- NatSemi DP8381x driver
42#	ns83820.o	- NS83820 driver
43#	ns8390.o	- NE2000 PCI driver
44#	pcnet32.o	- AMD Lance/PCI PCNet/32 driver
45#	pnic.o		- Bochs Pseudo Nic driver
46#	r8169.o		- Realtek 8169 driver
47#	rtl8139.o	- Realtek 8139 driver
48#	sis900.o	- SIS 900 and SIS 7016 driver
49#	sundance.o	- Sundance ST201 driver
50#	tg3.o		- Broadcom Tigon3 driver
51#	tlan.o		- TI ThunderLAN driver
52#	tulip.o		- Tulip driver
53#	undi.o		- PXE UNDI driver
54#	via-rhine.o	- Rhine-I/II driver
55#	w89c840.o	- Winbond W89c840 driver
56#
57DRIVER_OBJS	= undi.o
58
59NET_CFLAGS	= -DINCLUDE_UNDI=1
60
61$(DRIVER_OBJS)	:= CFLAGS = $(BASE_CFLAGS) -Os -fno-builtin -nostdinc \
62			$(NET_EXTRAFLAGS) $(DRIVER_DEFS)
63
643c595.o		:= DRIVER_DEFS = -DINCLUDE_3C595=1
653c90x.o		:= DRIVER_DEFS = -DINCLUDE_3C90X=1
66davicom.o	:= DRIVER_DEFS = -DINCLUDE_DAVICOM=1
67e1000.o		:= DRIVER_DEFS = -DINCLUDE_E1000=1
68eepro100.o	:= DRIVER_DEFS = -DINCLUDE_EEPRO100=1
69epic100.o	:= DRIVER_DEFS = -DINCLUDE_EPIC100=1
70forcedeth.o	:= DRIVER_DEFS = -DINCLUDE_FORCEDETH=1
71natsemi.o	:= DRIVER_DEFS = -DINCLUDE_NATSEMI=1
72ns83820.o	:= DRIVER_DEFS = -DINCLUDE_NS83820=1
73ns8390.o	:= DRIVER_DEFS = -DINCLUDE_NS8390=1
74pcnet32.o	:= DRIVER_DEFS = -DINCLUDE_PCNET32=1
75pnic.o		:= DRIVER_DEFS = -DINCLUDE_PNIC=1
76r8169.o		:= DRIVER_DEFS = -DINCLUDE_R8169=1
77rtl8139.o	:= DRIVER_DEFS = -DINCLUDE_RTL8139=1
78sis900.o	:= DRIVER_DEFS = -DINCLUDE_SIS900=1
79sundance.o	:= DRIVER_DEFS = -DINCLUDE_SUNDANCE=1
80tg3.o		:= DRIVER_DEFS = -DINCLUDE_TG3=1
81tlan.o		:= DRIVER_DEFS = -DINCLUDE_TLAN=1
82tulip.o		:= DRIVER_DEFS = -DINCLUDE_TULIP=1
83undi.o		:= DRIVER_DEFS = -DINCLUDE_UNDI=1
84via-rhine.o	:= DRIVER_DEFS = -DINCLUDE_VIA_RHINE=1
85w89c840.o	:= DRIVER_DEFS = -DINCLUDE_W89C840=1
86
873c595.o		:= DRIVER_SRC = 3c595.c
883c90x.o		:= DRIVER_SRC = 3c90x.c
89davicom.o	:= DRIVER_SRC = davicom.c
90e1000.o		:= DRIVER_SRC = e1000.c
91eepro100.o	:= DRIVER_SRC = eepro100.c
92epic100.o	:= DRIVER_SRC = epic100.c
93forcedeth.o	:= DRIVER_SRC = forcedeth.c
94natsemi.o	:= DRIVER_SRC = natsemi.c
95ns83820.o	:= DRIVER_SRC = ns83820.c
96ns8390.o	:= DRIVER_SRC = ns8390.c
97pcnet32.o	:= DRIVER_SRC = pcnet32.c
98pnic.o		:= DRIVER_SRC = pnic.c
99r8169.o		:= DRIVER_SRC = r8169.c
100rtl8139.o	:= DRIVER_SRC = rtl8139.c
101sis900.o	:= DRIVER_SRC = sis900.c
102sundance.o	:= DRIVER_SRC = sundance.c
103tg3.o		:= DRIVER_SRC = tg3.c
104tlan.o		:= DRIVER_SRC = tlan.c
105tulip.o		:= DRIVER_SRC = tulip.c
106undi.o		:= DRIVER_SRC = undi.c
107via-rhine.o	:= DRIVER_SRC = via-rhine.c
108w89c840.o	:= DRIVER_SRC = w89c840.c
109
110
111INCLUDES	= -I. -I.. -I../stage2 -I../stage1
112
113NET_EXTRAFLAGS	= -DCONFIG_PCI				\
114		  -DCONFIG_PCI_DIRECT=1			\
115		  -DCONGESTED=1				\
116		  -DNE_SCAN=0x280,0x300,0x320,0x340	\
117		  -DWD_DEFAULT_MEM=0xCC000
118
119#
120# Source files to be installed in $(SRC_DIR).
121#
122SRC_DIR		= $(ROOT_SRC)/netboot
123SRC_FILES	= Makefile.am Makefile.in README.netboot \
124		  3c595.c 3c595.h 3c90x.c basemem.c big_bswap.h bootp.h \
125		  byteswap.h config.c cpu.h davicom.c dev.h e1000.c \
126		  e1000_hw.h eepro100.c elf.h endian.h epic100.c epic100.h \
127		  etherboot.h forcedeth.c fsys_tftp.c grub.h i386_byteswap.h \
128		  i386_elf.h i386_endian.h i386_timer.c if_arp.h if_ether.h \
129		  igmp.h in.h io.h ip.h isa.h latch.h little_bswap.h mii.h \
130		  misc.c natsemi.c nfs.h nic.c nic.h ns83820.c ns8390.c \
131		  ns8390.h osdep.h pci.c pci.h pci_ids.h pci_io.c pcnet32.c \
132		  pic8259.c pic8259.h pnic.c pnic_api.h pxe.h r8169.c \
133		  rtl8139.c segoff.h sis900.c sis900.h stdint.h sundance.c \
134		  tftp.h tg3.c tg3.h timer.c timer.h tlan.c tlan.h tulip.c \
135		  types.h udp.h undi.c undi.h via-rhine.c w89c840.c
136
137INSTALL_TARGETS	= $(SRC_FILES:%=$(SRC_DIR)/%)
138
139
140all: $(LIBDRIVERS)
141
142$(LIBDRIVERS): $(LIBDRIVERS_OBJS)
143	$(RM) $@
144	$(AR) cru $@ $(LIBDRIVERS_OBJS)
145	$(RANLIB) $@
146
147$(LIB_OBJS): $$(@:libdrivers_a-%.o=%.c)
148	$(CC) $(CFLAGS) -c -o $@ $(@:libdrivers_a-%.o=%.c)
149
150$(DRIVER_OBJS): $$(DRIVER_SRC)
151	$(CC) $(CFLAGS) -c -o $@ $(DRIVER_SRC)
152
153
154install: all $(INSTALL_TARGETS)
155
156$(SRC_DIR)/%: $(SRC_DIR) %
157	$(INS.file)
158
159$(SRC_DIR):
160	$(INS.dir)
161
162
163clean: _FORCE
164	$(RM) *.o $(LIBDRIVERS)
165
166clobber: clean
167
168_FORCE:
169