1
0
mirror of https://github.com/sjlongland/adv950.git synced 2025-09-14 03:03:15 +10:00
adv950/3.x/Makefile
Stuart Longland 98f879a253
Initial check-in, Advantech ADV950 serial driver v3.33.
This is a check-in of the Advantech ADV950 serial driver, used with the
UNO-1150 series of industrial computers, as sourced from:

http://support.advantech.com/support/DownloadSRDetail_New.aspx?SR_ID=1-GLBRCD&Doc_Source=Download

This builds with kernel 3.0.1, but does not build with contemporary
kernels (i.e. ones that are still in support).

I suspect this is a hacked up version of Russel King's 8250 serial
driver from 2001.  First step, let's get it building against the current
kernel (v4.10.1) and then we'll look at integrating this into 8250
proper.
2017-03-05 10:29:50 +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 := 8250.o 8250_pci.o serial_core.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