File: Makefile

package info (click to toggle)
i2c 2.6.3-5
  • links: PTS
  • area: main
  • in suites: woody
  • size: 592 kB
  • ctags: 1,051
  • sloc: ansic: 6,419; perl: 637; makefile: 186
file content (47 lines) | stat: -rw-r--r-- 1,217 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#################################################
# config
KERNEL_LOCATION=/usr/src/linux
CURRENT=$(shell uname -r)
I2CINCLUDES := i2c.h i2c-dev.h i2c-algo-bit.h i2c-algo-pcf.h \
               i2c-elektor.h i2c-pcf8584.h i2c-id.h i2c-proc.h
I2CKERNELDIR := /usr/include/linux
I2CMODDIR := /lib/modules/$(CURRENT)/misc

#################################################
# some magic for using linux kernel settings
# when compiling module(s)

MOD_SUB_DIRS =
MX_OBJS       = i2c-core.o i2c-algo-bit.o i2c-algo-pcf.o i2c-proc.o

M_OBJS      = i2c-dev.o i2c-philips-par.o i2c-elv.o i2c-velleman.o i2c-elektor.o
EXTRA_CFLAGS = -Wno-unused


here:
	DIR=`pwd`; (cd $(KERNEL_LOCATION); make SUBDIRS=$$DIR modules)

install:
	su -c "cp -v $(M_OBJS) $(MX_OBJS) $(I2CMODDIR)"
	# Don't install for debian.
	#su -c "cp -v $(I2CINCLUDES) $(I2CKERNELDIR)"

clean:
	-rm -f $(M_OBJS) $(MX_OBJS) .*.o.flags *~ $(M_OBJS:.o=.d) \
               $(MX_OBJS:.o=.d)

up:
	insmod i2c-core.o i2c_debug=0
	insmod algo-bit.o bit_test=1  i2c_debug=1
	insmod bit-lp.o base=0x278
	insmod i2c-dev.o
	insmod i2c-proc.o

down:
	-rmmod i2c-proc.o
	-rmmod i2c-dev
	-rmmod bit-lp
	-rmmod algo-bit
	-rmmod i2c-core

include $(KERNEL_LOCATION)/Rules.make