File: Makefile

package info (click to toggle)
z8530-utils 2.4c-9
  • links: PTS
  • area: main
  • in suites: potato
  • size: 380 kB
  • ctags: 636
  • sloc: ansic: 6,541; makefile: 84; sh: 14
file content (71 lines) | stat: -rw-r--r-- 2,186 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
VERSION = 2.4c.dl1bke
KERNEL  = `cat /proc/version | cut -d" " -f3`
CCOPT   = -O2 -g -Wall -Wstrict-prototypes \
	  -I/usr/src/kernel-headers-2.0.38/include \
	   # -DCONFIG_SCC_STANDALONE
MODOPT  = -c -pipe -D__KERNEL__ -DMODULE -DMODVERSIONS -fomit-frame-pointer\
	  -DCONFIG_SCC_DEV -DCONFIG_SCC_TTY -I/usr/src/linux/include
# MODVER  = -DMODVERSIONS -include /usr/src/linux/include/linux/modversions.h
DEVNAME = scc
MAJOR   = 34

all: dep utils

for_kernel: install_source all

module: scc.o all install_module

utils: sccparam sccstat sccinit gencfg

scc.o: scc.c
	gcc ${CCOPT} ${MODOPT} ${MODVER} scc.c -o $@

sccparam: sccparam.c
	gcc ${CCOPT} sccparam.c -o $@

sccstat: sccstat.c
	gcc ${CCOPT} sccstat.c -o $@

sccinit: sccinit.c
	gcc ${CCOPT} sccinit.c -o $@

gencfg: gencfg.c
	gcc ${CCOPT} gencfg.c -o $@

install:
	install -s sccstat $(DESTDIR)/usr/bin/sccstat
	install -s gencfg $(DESTDIR)/usr/bin/gencfg
	install -s -m 0700 sccinit $(DESTDIR)/usr/sbin/sccinit
	install -s -m 0700 sccparam $(DESTDIR)/usr/sbin/sccparam
	install -m 0644 z8530drv.conf $(DESTDIR)/etc/z8530drv.conf

install_module:
	install -g root -o root -m 0644 scc.o /lib/modules/${KERNEL}/misc/scc.o

install_source:
	cp -f scc.c /usr/src/linux/drivers/char/
	cp -f scc.h /usr/src/linux/include/linux/

clean:
	rm -f .depend *.o *~ doc/*~ sccstat sccinit sccparam gencfg

distrib:
	( cd .. && tar zcvvf z8530drv-${VERSION}.tar.gz \
	z8530drv-2.4/README z8530drv-2.4/FAQ z8530drv-2.4/Makefile z8530drv-2.4/doc \
	z8530drv-2.4/*.c z8530drv-2.4/scc.h z8530drv-2.4/sccinit z8530drv-2.4/sccparam \
	z8530drv-2.4/sccstat z8530drv-2.4/gencfg z8530drv-2.4/z8530drv.conf \
	z8530drv-2.4/*.lsm z8530drv-2.4/*patch z8530drv-2.4/kernel-2.1.x)

lharc:
	( cd .. && lharc a z8530drv-${VERSION}.lzh \
	z8530drv-2.4/README z8530drv-2.4/FAQ z8530drv-2.4/Makefile z8530drv-2.4/doc \
	z8530drv-2.4/*.c z8530drv-2.4/scc.h z8530drv-2.4/sccinit z8530drv-2.4/sccparam \
	z8530drv-2.4/sccstat z8530drv-2.4/gencfg z8530drv-2.4/z8530drv.conf \
	z8530drv-2.4/*.lsm z8530drv-2.4/*patch z8530drv-2.4/kernel-2.1.x)

dep:
	gcc ${CCOPT} -M sccstat.c sccinit.c sccparam.c >.depend

ifeq (.depend,$(wildcard .depend))
include .depend
endif