1
0
mirror of https://github.com/sjlongland/adv950.git synced 2025-09-13 18:53:15 +10:00
adv950/driver/Makefile
Stuart Longland 55ce014443
adv950_core: Ditch copy of serial_core.
On closer inspection, this is more like the standard `serial_core`
module than first expected.  We should try to use the in-kernel version.
2017-03-05 17:22:44 +10:00

63 lines
1.3 KiB
Makefile

#
# Makefile for the kernel serial device drivers.
#
# Advantech eAutomation Division
#
UNAME := $(shell uname -r)
PWD := $(shell pwd)
ADVMOD := adv950
SERIAL_NAME= ttyAP
MAX_TTY= 64
ADV_TTY_MAJOR= 30
SERIAL_FLAGS= -DSERIAL_NAME=\"$(SERIAL_NAME)\" \
-DADV_TTY_MAJOR=$(ADV_TTY_MAJOR) \
-DADV_TTY_CUMAJOR=$(ADV_TTY_CUMAJOR)
SERIAL_FLAGS:= $(SERIAL_FLAGS)
ifneq ($(KERNELRELEASE),)
EXTRA_CFLAGS = $(SERIAL_FLAGS)
obj-m := adv950.o
adv950-objs := adv950_base.o adv950_pci.o
else
KDIR := /lib/modules/$(shell uname -r)/build/
PWD := $(shell pwd)
all:
$(MAKE) -w -C $(KDIR) SUBDIRS=$(PWD) modules
endif
install:
$(shell if grep $(ADVMOD) /proc/modules > /dev/null ; then \
rmmod $(ADVMOD) ; fi)
@insmod $(ADVMOD).ko
node: default install
@echo "Creating serial device nodes $(SERIAL_NAME) ..."
@chmod 777 ../advmknod
@../advmknod $(SERIAL_NAME) \
$$(awk '$$2=="$(SERIAL_NAME)" {print $$1}' /proc/devices) $(MAX_TTY)
@echo "Done"
uninstall:
$(shell if grep $(ADVMOD) /proc/modules > /dev/null ; then \
rmmod $(ADVMOD) ; fi)
test:
@cd ../getconfig; make; ./getconfig $(SERIAL_NAME) $(MAX_TTY)
clean:
@rm -f *.o
@rm -f *.ko
@rm -f *.mod.c modules.order Module.symvers Module.markers
@rm -f .*.cmd
@rm -rf .tmp_versions
@rm -rf *~
@cd ../getconfig; make clean