1# User-world netperf Makefile. 2# Copyright 2008, VMware, Inc. 3# Portions Copyright 2008, Hewlett-Packard Company. 4# 5# Assume we're building in a DDK universe. 6# 7BORA_ROOT = /build/toolchain/lin32 8 9# 10# userworld library paths, relative to bora-root 11# 12UWGCC_ROOT = $(BORA_ROOT)/gcc-3.3.3 13UWGLIBC_TOP_DIR = $(BORA_ROOT)/uwglibc-2.2.5 14UWGLIBC_LIB_DIR = $(UWGLIBC_TOP_DIR)/lib 15UWGLIBC_USR_DIR = $(UWGLIBC_TOP_DIR)/usr/lib 16UWGLIBC_DEST_DIR = /usr/lib/vmware/lib 17 18# 19# userworld include paths 20# 21GCC_INCLUDES = -isystem $(UWGCC_ROOT)/lib/gcc-lib/i686-linux/3.3.3/include 22GLIBC_INCLUDES = -isystem $(BORA_ROOT)/glibc-2.2.5-44/usr/include 23 24# 25# userworld compiler environment 26# 27CC = GCC_EXEC_PREFIX="$(UWGCC_ROOT)/lib/gcc-lib/" \ 28 KROOT=$(BORA_ROOT) \ 29 PATH="$(UWGCC_ROOT)/bin:$(BORA_ROOT)/binutils-2.16.1-vt/bin:/bin:/sbin:/usr/sbin:/usr/bin" \ 30 $(UWGCC_ROOT)/bin/i686-linux-gcc 31 32CC_INCLUDES = -nostdinc $(GCC_INCLUDES) $(GLIBC_INCLUDES) $(UWVER_INCLUDES) 33 34# 35# userworld shared libraries 36# 37UWGLIBC_LDLINUX_SO = ld-linux.so.2 38 39UWGLIBC_LINK_OPTS = -nostdlib -nostartfiles \ 40 -Xlinker --dynamic-linker=$(UWGLIBC_DEST_DIR)/$(UWGLIBC_LDLINUX_SO) \ 41 -Xlinker -z -Xlinker nodefaultlib \ 42 -Xlinker -rpath -Xlinker $(UWGLIBC_DEST_DIR) \ 43 -L$(UWGLIBC_USR_DIR) \ 44 -L$(UWGLIBC_LIB_DIR) 45 46UWGLIBC_LINK_CRTS = \ 47 ${UWGLIBC_TOP_DIR}/usr/lib/crt1.o \ 48 ${UWGLIBC_TOP_DIR}/usr/lib/crti.o \ 49 ${UWGCC_ROOT}/lib/gcc-lib/i686-linux/3.3.3/crtbegin.o \ 50 ${UWGCC_ROOT}/lib/gcc-lib/i686-linux/3.3.3/crtend.o \ 51 ${UWGLIBC_TOP_DIR}/usr/lib/crtn.o 52 53CFLAGS = -DVMWARE_UW $(CC_INCLUDES) -g -O -mcpu=pentiumpro 54CFLAGS += -DDEBUG_LOG_FILE=\"/dev/null\" -DDO_FIRST_BURST -DDO_UNIX 55 56UWGLIBC_LINK_LIBS = -lm -ldl -lpthread -lresolv -lnss_nis -lnss_nisplus \ 57 -lnss_files -lnss_compat -lnss_dns -lnsl -lc -lc_nonshared -lgcc 58LDFLAGS = $(UWGLIBC_LINK_OPTS) $(UWGLIBC_LINK_CRTS) \ 59 $(UWGLIBC_LINK_LIBS) ${UWGLIBC_LIB_DIR}/${UWGLIBC_LDLINUX_SO} 60 61NETSERVER_OBJS = netserver.o nettest_bsd.o nettest_dlpi.o \ 62 nettest_unix.o netlib.o netsh.o \ 63 nettest_xti.o nettest_ipv6.o \ 64 netcpu_none.c \ 65 nettest_dns.o 66 67NETPERF_OBJS = netperf.o netsh.o netlib.o nettest_bsd.o \ 68 nettest_dlpi.o nettest_unix.o \ 69 nettest_xti.o nettest_ipv6.o \ 70 netcpu_none.c \ 71 nettest_dns.o 72 73all: netperf-uw netserver-uw 74 75netperf-uw: $(NETPERF_OBJS) 76 $(CC) -o $@ $(NETPERF_OBJS) $(LDFLAGS) 77 strip $@ 78 79netserver-uw: $(NETSERVER_OBJS) 80 $(CC) -o $@ $(NETSERVER_OBJS) $(LDFLAGS) 81 strip $@ 82 83netperf.o: netperf.c netsh.h Makefile.uw 84 85netsh.o: netsh.c netsh.h nettest_bsd.h netlib.h Makefile.uw 86 87netlib.o: netlib.c netlib.h netsh.h Makefile.uw 88 89nettest_bsd.o: nettest_bsd.c nettest_bsd.h netlib.h netsh.h Makefile.uw 90 91nettest_dlpi.o: nettest_dlpi.c nettest_dlpi.h netlib.h netsh.h Makefile.uw 92 93nettest_unix.o: nettest_unix.c nettest_unix.h netlib.h netsh.h Makefile.uw 94 95nettest_xti.o: nettest_xti.c nettest_xti.h netlib.h netsh.h Makefile.uw 96 97nettest_ipv6.o: nettest_ipv6.c nettest_ipv6.h netlib.h netsh.h Makefile.uw 98 99nettest_dns.o: nettest_dns.c nettest_dns.h netlib.h netsh.h Makefile.uw 100 101netcpu_none.o: netcpu_none.c netsh.h netlib.h 102 103netserver.o: netserver.c nettest_bsd.h netlib.h Makefile.uw 104 105clean: 106 rm -f *.o netperf-uw netserver-uw 107