/alps/pcitool

To get this branch, use:
bzr branch http://darksoft.org/webbzr/alps/pcitool

« back to all changes in this revision

Viewing changes to driver/Makefile.in

  • Committer: Suren A. Chilingaryan
  • Date: 2016-04-09 18:45:52 UTC
  • Revision ID: csa@suren.me-20160409184552-lxknsjbx6lsb4pjv
Fix driver installation on Ubuntu

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
KERNELDIR ?= /lib/modules/$(KERNELVER)/build
8
8
INSTALLDIR ?= /lib/modules/$(KERNELVER)/extra
9
9
MAININSTALLDIR ?= /lib/modules/$(KERNELVER)/kernel/extra
 
10
ifneq ("$(wildcard /lib/modules/$(KERNELVER)/build/include/linux)","")
 
11
HEADERDIR ?= /lib/modules/$(KERNELVER)/build/include
 
12
else ifneq ("$(wildcard /lib/modules/$(KERNELVER)/source/include/linux)","")
10
13
HEADERDIR ?= /lib/modules/$(KERNELVER)/source/include
 
14
else
 
15
HEADERDIR ?= ""
 
16
endif
 
17
 
11
18
PWD := $(shell pwd)
12
19
 
13
20
EXTRA_CFLAGS += -I$(M)/.. ${PCILIB_DYNAMIC_HEADERS_INC}
84
91
        @install -m 755 pciDriver.ko $(INSTALLDIR)
85
92
        @echo "INSTALL $(INSTALLDIR)/pciDriver.symvers"
86
93
        @install -m 644 Module.symvers $(INSTALLDIR)/pciDriver.symvers
87
 
        @echo "INSTALL $(HEADERDIR)/linux/pcidriver.h"
88
 
        @install -m 644 pcidriver.h $(HEADERDIR)/linux/
 
94
        @if [ "$(HEADERDIR)" != "" ]; then \
 
95
            echo "INSTALL $(HEADERDIR)/linux/pcidriver.h" ;\
 
96
            install -m 644 pcidriver.h $(HEADERDIR)/linux/ ;\
 
97
        fi
89
98
        @echo "INSTALL /usr/include/linux/pcidriver.h"
90
99
        @mkdir -p /usr/include/linux
91
100
        @install -m 644 ioctl.h /usr/include/linux/pcidriver.h
99
108
 
100
109
 
101
110
uninstall:
102
 
        @echo "UNINSTALL $(INSTALLDIR)/pciDriver.ko"
103
 
        @rm -f $(INSTALLDIR)/pciDriver.ko
104
 
        @rm -f $(MAININSTALLDIR)/pciDriver.ko
105
 
        @rm -f $(INSTALLDIR)/pciDriver.symvers
106
 
        @rm -f $(MAININSTALLDIR)/pciDriver.symvers
107
 
        @echo "UNINSTALL /usr/include/linux/pcidriver.h"
108
 
        @rm -rf /usr/include/pciDriver/
109
 
        @rm -rf /usr/include/linux/pcidriver.h
110
 
        @echo "UNINSTALL $(HEADERDIR)/linux/pcidriver.h"
111
 
        @rm -rf $(HEADERDIR)/linux/pcidriver.h
 
111
        @if [ -f $(INSTALLDIR)/pciDriver.ko ]; then \
 
112
            echo "UNINSTALL $(INSTALLDIR)/pciDriver.ko" ;\
 
113
            rm -f $(INSTALLDIR)/pciDriver.ko ;\
 
114
        fi
 
115
        @if [ -f $(MAININSTALLDIR)/pciDriver.ko ]; then \
 
116
            echo "UNINSTALL $(MAININSTALLDIR)/pciDriver.ko" ;\
 
117
            rm -f $(MAININSTALLDIR)/pciDriver.ko ;\
 
118
        fi
 
119
        @if [ -f $(INSTALLDIR)/pciDriver.symvers ]; then \
 
120
            echo "UNINSTALL $(INSTALLDIR)/pciDriver.symvers" ;\
 
121
            rm -f $(INSTALLDIR)/pciDriver.symvers ;\
 
122
        fi
 
123
        @if [ -f $(MAININSTALLDIR)/pciDriver.symvers ]; then \
 
124
            echo "UNINSTALL $(MAININSTALLDIR)/pciDriver.symvers" ;\
 
125
            rm -f $(MAININSTALLDIR)/pciDriver.symvers ;\
 
126
        fi
 
127
        @if [ -f /usr/include/linux/pcidriver.h ]; then \
 
128
            echo "UNINSTALL /usr/include/linux/pcidriver.h" ;\
 
129
            rm -rf /usr/include/linux/pcidriver.h ;\
 
130
        fi
 
131
        @if [ -d /usr/include/pciDriver/ ]; then \
 
132
            echo "UNINSTALL /usr/include/pciDriver/" ;\
 
133
            rm -rf /usr/include/pciDriver/ ;\
 
134
        fi
 
135
        @if [ "$(HEADERDIR)" != "" -a -f $(HEADERDIR)/linux/pcidriver.h ]; then \
 
136
            echo "UNINSTALL $(HEADERDIR)/linux/pcidriver.h" ;\
 
137
            rm -rf $(HEADERDIR)/linux/pcidriver.h ;\
 
138
        fi
112
139
 
113
140
clean:
114
141
        rm -rf *.o *.ko *.mod.c .*.o.cmd .*.o.tmp .*.ko.cmd  .*.o *.symvers modules.order .tmp_versions