# Makefile template

# Defines MSR, KERNELSRCROOT and RPROOT.  Note that MSR could be
# defined in the shell environment if you do not want to use the
# standard files.  For example
#   setenv MSR /users/kenw/arl/repository/msr
#  OR
#   export MSR=/users/kenw/arl/repository/msr
MSR ?= /users/onl/wu_arl/msr
KERNELSRCROOT = ${MSR}/usr/src/sys
RPROOT        = ${MSR}/rp

MODOBJ=combined.o

# name of kernel plugin
KMOD=mycounter

CC=gcc

INCLUDES =-I${KERNELSRCROOT} -I${RPROOT} -I.

#	MSR			used in <msr/xxx>
#	MSR_PLUGIN		req'd for plugins
#	_KERNEL and _LKM	req'd in apic
CFLAGS = -DMSR -D_KERNEL -DMSR_PLUGIN -D_LKM ${INCLUDES}

SRCS=$(KMOD).c

# ---------------------------------------------------------------------
# In most cases, you should not have to change anything below this line
# ---------------------------------------------------------------------

# turn on some other diagnostics
#CFLAGS+= -DMSRDEBUG

OBJS=$(SRCS:.c=.o)

remote:
	ssh onlbsd1 "cd `pwd`; make all"

all:	$(MODOBJ)

touch:
	touch *
	touch *.o
	touch $(MODOBJ)

clean:
	rm -f $(OBJS) $(MODOBJ)

$(OBJS):	stdinc.h $(KMOD).h

$(MODOBJ): $(OBJS)
	$(LD) -r -o $(MODOBJ) $(OBJS)

