# Compiles blazepps_ethernet driver
#
# Authors
# 	
# 	Christopher Campbell (cc3769@columbia.edu)
#	Valeh Valiollahpour Amiri (vv2252@columbia.edu)
#
# Last Modified
#
# 	April 23rd, 2015

ifneq (${KERNELRELEASE},)

# KERNELRELEASE defined: we are being compiled as part of the Kernel
obj-m := blazepps_ethernet.o

else

# We are being compiled as a module: use the Kernel build system
PWD := $(shell pwd)
KDIR := /usr/src/linux
DTC := $(KDIR)/scripts/dtc/dtc

default: module tree

module:
	${MAKE} -C ${KDIR} SUBDIRS=${PWD} modules

tree: socfpga.dts
	$(DTC) -O dtb -o socfpga.dtb socfpga.dts

clean:
	${MAKE} -C ${KDIR} SUBDIRS=${PWD} clean
	${RM} socfpga.dtb test_client.o test_server.o *~

endif 
