Makefile.solaris revision 7c478bd95313f5f23a4c958a745db2134aa03244
#
# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# ident "%Z%%M% %I% %E% SMI"
#
include ../../Makefile.grub
include ../Makefile.solaris.defs
LIBDRIVERS = libdrivers.a
LIBDRIVERS_OBJS = $(LIB_OBJS) $(DRIVER_OBJS)
LIB_OBJS = libdrivers_a-basemem.o \
$(LIB_OBJS) := CFLAGS = $(BASE_CFLAGS) -Os -fno-builtin -nostdinc \
-DFSYS_TFTP=1 $(NET_CFLAGS) $(NET_EXTRAFLAGS)
#
# The following netboot drivers are available.
# NOTE: Compiling too many netboot drivers into stage2 could cause GRUB to
# crash or misbehave.
# NOTE: NET_CFLAGS has to be adjusted to correspond to the drivers
# selected in $(DRIVER_OBJS).
#
# 3c595.o - 3Com595 driver
# 3c90x.o - 3Com90x driver
# davicom.o - Davicom driver
# e1000.o - Etherexpress Pro/1000 driver
# eepro100.o - Etherexpress Pro/100 driver
# epic100.o - SMC 83c170 EPIC/100 driver
# forcedeth.o - Nvidia Geforce driver
# natsemi.o - NatSemi DP8381x driver
# ns83820.o - NS83820 driver
# ns8390.o - NE2000 PCI driver
# pnic.o - Bochs Pseudo Nic driver
# r8169.o - Realtek 8169 driver
# rtl8139.o - Realtek 8139 driver
# sis900.o - SIS 900 and SIS 7016 driver
# sundance.o - Sundance ST201 driver
# tg3.o - Broadcom Tigon3 driver
# tlan.o - TI ThunderLAN driver
# tulip.o - Tulip driver
# undi.o - PXE UNDI driver
# via-rhine.o - Rhine-I/II driver
# w89c840.o - Winbond W89c840 driver
#
DRIVER_OBJS = undi.o
NET_CFLAGS = -DINCLUDE_UNDI=1
$(DRIVER_OBJS) := CFLAGS = $(BASE_CFLAGS) -Os -fno-builtin -nostdinc \
$(NET_EXTRAFLAGS) $(DRIVER_DEFS)
3c595.o := DRIVER_DEFS = -DINCLUDE_3C595=1
3c90x.o := DRIVER_DEFS = -DINCLUDE_3C90X=1
davicom.o := DRIVER_DEFS = -DINCLUDE_DAVICOM=1
e1000.o := DRIVER_DEFS = -DINCLUDE_E1000=1
eepro100.o := DRIVER_DEFS = -DINCLUDE_EEPRO100=1
epic100.o := DRIVER_DEFS = -DINCLUDE_EPIC100=1
forcedeth.o := DRIVER_DEFS = -DINCLUDE_FORCEDETH=1
natsemi.o := DRIVER_DEFS = -DINCLUDE_NATSEMI=1
ns83820.o := DRIVER_DEFS = -DINCLUDE_NS83820=1
ns8390.o := DRIVER_DEFS = -DINCLUDE_NS8390=1
pcnet32.o := DRIVER_DEFS = -DINCLUDE_PCNET32=1
pnic.o := DRIVER_DEFS = -DINCLUDE_PNIC=1
r8169.o := DRIVER_DEFS = -DINCLUDE_R8169=1
rtl8139.o := DRIVER_DEFS = -DINCLUDE_RTL8139=1
sis900.o := DRIVER_DEFS = -DINCLUDE_SIS900=1
sundance.o := DRIVER_DEFS = -DINCLUDE_SUNDANCE=1
tg3.o := DRIVER_DEFS = -DINCLUDE_TG3=1
tlan.o := DRIVER_DEFS = -DINCLUDE_TLAN=1
tulip.o := DRIVER_DEFS = -DINCLUDE_TULIP=1
undi.o := DRIVER_DEFS = -DINCLUDE_UNDI=1
via-rhine.o := DRIVER_DEFS = -DINCLUDE_VIA_RHINE=1
w89c840.o := DRIVER_DEFS = -DINCLUDE_W89C840=1
eepro100.o := DRIVER_SRC = eepro100.c
forcedeth.o := DRIVER_SRC = forcedeth.c
sundance.o := DRIVER_SRC = sundance.c
via-rhine.o := DRIVER_SRC = via-rhine.c
INCLUDES = -I. -I.. -I../stage2 -I../stage1
NET_EXTRAFLAGS = -DCONFIG_PCI \
-DCONFIG_PCI_DIRECT=1 \
-DCONGESTED=1 \
-DNE_SCAN=0x280,0x300,0x320,0x340 \
-DWD_DEFAULT_MEM=0xCC000
#
# Source files to be installed in $(SRC_DIR).
#
SRC_DIR = $(ROOT_SRC)/netboot
INSTALL_TARGETS = $(SRC_FILES:%=$(SRC_DIR)/%)
all: $(LIBDRIVERS)
$(LIBDRIVERS): $(LIBDRIVERS_OBJS)
$(RM) $@
$(AR) cru $@ $(LIBDRIVERS_OBJS)
$(RANLIB) $@
$(LIB_OBJS): $$(@:libdrivers_a-%.o=%.c)
$(CC) $(CFLAGS) -c -o $@ $(@:libdrivers_a-%.o=%.c)
$(DRIVER_OBJS): $$(DRIVER_SRC)
$(CC) $(CFLAGS) -c -o $@ $(DRIVER_SRC)
install: all $(INSTALL_TARGETS)
$(SRC_DIR)/%: $(SRC_DIR) %
$(INS.file)
$(SRC_DIR):
$(INS.dir)
clean: _FORCE
$(RM) *.o $(LIBDRIVERS)
clobber: clean
$(RM) $(INSTALL_TARGETS)
_FORCE: