Home | History | Annotate | Download | only in src
      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 #
      7 BORA_ROOT = /build/toolchain/lin32
      8 
      9 #
     10 # userworld library paths, relative to bora-root
     11 #
     12 UWGCC_ROOT       = $(BORA_ROOT)/gcc-3.3.3
     13 UWGLIBC_TOP_DIR  = $(BORA_ROOT)/uwglibc-2.2.5
     14 UWGLIBC_LIB_DIR  = $(UWGLIBC_TOP_DIR)/lib
     15 UWGLIBC_USR_DIR  = $(UWGLIBC_TOP_DIR)/usr/lib
     16 UWGLIBC_DEST_DIR = /usr/lib/vmware/lib
     17 
     18 #
     19 # userworld include paths
     20 #
     21 GCC_INCLUDES   = -isystem $(UWGCC_ROOT)/lib/gcc-lib/i686-linux/3.3.3/include
     22 GLIBC_INCLUDES = -isystem $(BORA_ROOT)/glibc-2.2.5-44/usr/include 
     23 
     24 #
     25 # userworld compiler environment
     26 #
     27 CC = 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 
     32 CC_INCLUDES = -nostdinc $(GCC_INCLUDES) $(GLIBC_INCLUDES) $(UWVER_INCLUDES)
     33 
     34 #
     35 # userworld shared libraries
     36 #
     37 UWGLIBC_LDLINUX_SO = ld-linux.so.2
     38 
     39 UWGLIBC_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 
     46 UWGLIBC_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 
     53 CFLAGS  = -DVMWARE_UW $(CC_INCLUDES) -g -O -mcpu=pentiumpro
     54 CFLAGS += -DDEBUG_LOG_FILE=\"/dev/null\" -DDO_FIRST_BURST -DDO_UNIX
     55 
     56 UWGLIBC_LINK_LIBS = -lm -ldl -lpthread -lresolv -lnss_nis -lnss_nisplus \
     57 	-lnss_files -lnss_compat -lnss_dns -lnsl -lc -lc_nonshared -lgcc
     58 LDFLAGS = $(UWGLIBC_LINK_OPTS) $(UWGLIBC_LINK_CRTS) \
     59 	$(UWGLIBC_LINK_LIBS) ${UWGLIBC_LIB_DIR}/${UWGLIBC_LDLINUX_SO}
     60 
     61 NETSERVER_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 
     67 NETPERF_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 
     73 all: netperf-uw netserver-uw
     74 
     75 netperf-uw: $(NETPERF_OBJS)
     76 	$(CC) -o $@ $(NETPERF_OBJS) $(LDFLAGS)
     77 	strip $@
     78 
     79 netserver-uw: $(NETSERVER_OBJS)
     80 	$(CC) -o $@ $(NETSERVER_OBJS) $(LDFLAGS)
     81 	strip $@
     82 
     83 netperf.o: netperf.c netsh.h Makefile.uw
     84 
     85 netsh.o: netsh.c netsh.h nettest_bsd.h netlib.h Makefile.uw
     86 
     87 netlib.o: netlib.c netlib.h netsh.h Makefile.uw
     88 
     89 nettest_bsd.o: nettest_bsd.c nettest_bsd.h netlib.h netsh.h Makefile.uw
     90 
     91 nettest_dlpi.o: nettest_dlpi.c nettest_dlpi.h netlib.h netsh.h Makefile.uw
     92 
     93 nettest_unix.o: nettest_unix.c nettest_unix.h netlib.h netsh.h Makefile.uw
     94 
     95 nettest_xti.o: nettest_xti.c nettest_xti.h netlib.h netsh.h Makefile.uw
     96 
     97 nettest_ipv6.o: nettest_ipv6.c nettest_ipv6.h netlib.h netsh.h Makefile.uw
     98 
     99 nettest_dns.o: nettest_dns.c nettest_dns.h netlib.h netsh.h Makefile.uw
    100 
    101 netcpu_none.o: netcpu_none.c netsh.h netlib.h
    102 
    103 netserver.o: netserver.c nettest_bsd.h netlib.h Makefile.uw
    104 
    105 clean:
    106 	rm -f *.o netperf-uw netserver-uw
    107