Advertisement
Guest User

Untitled

a guest
Jul 21st, 2016
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. #-------------------------------------------------------------------------------
  2. # Makefile for MOXA UPort 1100 Series drvier
  3. #-------------------------------------------------------------------------------
  4. DRV_VER := 1.0
  5. REL_DATE := 03/18/2008
  6. KVER := $(shell uname -r)
  7. KDISVER := $(shell uname -a)
  8. KDIR := /lib/modules/$(KVER)/build/include
  9. PWD := $(shell pwd)
  10. TARGET := mxu1100_24
  11.  
  12. #############################2.4########################################
  13. CC=gcc -c
  14. ARCH=$(shell uname -m | sed s/i.86/i86/)
  15.  
  16. ifeq ($(ARCH),i86)
  17. OPTS=-DMODULE -D__KERNEL__ -Wall -Wstrict-prototypes -O2 \
  18. -fomit-frame-pointer -I$(KDIR) -I/usr/src/linux-2.4/include \
  19. -I/usr/src/linux/include
  20. else
  21. OPTS=-DMODULE -D__KERNEL__ -Wall -Wstrict-prototypes -O2 \
  22. -fomit-frame-pointer -pipe -I/usr/src/linux/include -ffixed-8
  23. endif
  24.  
  25. ifeq "$(findstring install, $(MAKECMDGOALS))" "install"
  26. OPTS+=-DMODVERSIONS
  27. endif
  28.  
  29.  
  30. ifeq "$(findstring SMP, $(shell uname -a))" "SMP"
  31. OPTS+=-D__SMP__
  32. endif
  33.  
  34. all: module
  35.  
  36. installmod: install
  37.  
  38. install: module
  39. mkdir -p /lib/modules/$(shell uname -r)/kernel/drivers/usb/serial/
  40. cp -f ./mxu1100_24.o /lib/modules/$(shell uname -r)/kernel/drivers/usb/serial
  41. depmod -a
  42.  
  43. clean :
  44. rm -f *.o
  45. rm -f /lib/modules/$(shell uname -r)/kernel/drivers/usb/serial/mxu1100_24.o
  46.  
  47. module : mxu1100_24.c
  48. $(CC) $(OPTS) mxu1100_24.c
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement