File: Makefile.mol-modules-source

package info (click to toggle)
mol 0.9.70-17
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 6,436 kB
  • ctags: 11,008
  • sloc: ansic: 60,495; asm: 3,306; makefile: 716; yacc: 706; sh: 546; lex: 501; cpp: 370; perl: 228; pascal: 18
file content (54 lines) | stat: -rw-r--r-- 1,293 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
#
# Makefile for mol-modules-source, top-level
# 

# build the Mac-on-Linux kernel modules from an incomplete source tree

# written by Jens Schmalzing <jensen@debian.org> for the Debian
# package mol-modules-source to allow users to build modules for
# custom kernels, while using a binary package for the rest of the
# emulator.

# Sun, 19 Oct 2003

# define a few variables, in case they are not already set by
# make-kpkg or a higher-level Makefile

KVERS	?= `uname -r`
KSRC	?= /lib/modules/$(KVERS)/build
export KVERS KSRC

INSTALL	?= install
MODDIR	?= $(DESTDIR)/lib/modules/$(KVERS)/misc
export INSTALL MODDIR

# upstream Makefiles and scripts expect the kernel tree here
KERNEL_SOURCE=$(KSRC)
export KERNEL_SOURCE

# module source directories
SUBDIRS	= src/kmod src/netdriver

# intermediate module install directory
MOLLIB	= mollib

# descend into subdirectories and build modules
.PHONY:	$(SUBDIRS)
build:	$(SUBDIRS)
$(SUBDIRS):
	-$(MAKE) -C $@

# install the modules
install:
	$(INSTALL) -d -m 755 -o 0 $(MODDIR)
	for file in `find $(MOLLIB) -type f`; do \
		$(INSTALL) -m 644 -o 0 $$file $(MODDIR); \
	done

# descend into subdirectories and clean up
.PHONY:	$(SUBDIRS:=-clean)
clean:	$(SUBDIRS:=-clean)
	rm -rf $(MOLLIB)
$(SUBDIRS:=-clean):
	$(MAKE) -C $(subst -clean,,$@) clean