#!/usr/bin/make -f
###############################################################
# Copyright (C) 1999-2000 VMware, Inc.
# All Rights Reserved
# $Id: Makefile.dist,v 1.2 2000/07/11 01:51:43 hpreg Exp $
###############################################################
#
# VMware vmppuser makefile to be distributed externally
#

DRIVER = vmppuser

####
####  The code is actually identical for SMP vs. UP, but if you
#### Have CONFIG_MODVERSIONS in your kernel, the symbols will 
#### come out differently smp vs. non-smp so we will build with
#### different names just to disambiguate.  If you have an SMP
#### kernel (i.e. uniprocessor but with SMP support or more than
#### one processor) please uncomment the SUPPORT_SMP line.
####
#SUPPORT_SMP=1

# Header directory for the running kernel
HEADER_DIR = /usr/src/linux/include

ifdef SUPPORT_SMP
DRIVERNAME = $(DRIVER)-smp-$(shell uname -r)
else
DRIVERNAME = $(DRIVER)-up-$(shell uname -r)
endif

CC_WARNINGS = -Wall -Wstrict-prototypes
# Don't use -pipe or egcs-2.91.66 (shipped with RedHat) will die
CC_KFLAGS = -D__KERNEL__ -DMODULE -fomit-frame-pointer -fno-strength-reduce -m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2 -DCPU=586
INCLUDE = -I. -I$(HEADER_DIR)
CFLAGS = -O $(CC_WARNINGS) $(CC_KFLAGS) $(INCLUDE)

ifdef SUPPORT_SMP
CFLAGS += -DSUPPORT_SMP
endif

OBJS = ppuser-stub.o

default: all

all: $(DRIVERNAME)

$(DRIVERNAME): $(OBJS)
	$(LD) -r -o $@ $^

../$(DRIVER).o: $(DRIVERNAME)
	cp -f $< $@

auto-build: ../$(DRIVER).o

clean:
	rm -f $(DRIVERNAME) ../$(DRIVERNAME) $(OBJS)

.PHONY: default all auto-build clean

.SILENT:
