File: Makefile

package info (click to toggle)
ndiswrapper 1.1-4
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 732 kB
  • ctags: 3,458
  • sloc: ansic: 14,609; perl: 956; makefile: 313; asm: 144; sh: 120
file content (87 lines) | stat: -rw-r--r-- 2,606 bytes parent folder | download | duplicates (2)
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
-include version

distdir=ndiswrapper-${NDISWRAPPER_VERSION}
distarchive=${distdir}.tar.gz

DISTFILES=AUTHORS ChangeLog INSTALL Makefile README ndiswrapper.spec version ndiswrapper.8
DIST_SUBDIRS=utils driver debian

DESTDIR = 
mandir = $(DESTDIR)$(shell [ -d /usr/man/man8 ] && echo /usr/man || echo /usr/share/man )

KVERS ?= $(shell uname -r)

.PHONY: all

all: 
	make -C driver
	make -C utils

.PHONY: install
install:
	make -C driver install
	make -C utils install
	mkdir -p -m 0755 $(mandir)/man8
	install -m 644 ndiswrapper.8 $(mandir)/man8

.PHONY: clean distclean
clean:
	make -C driver clean
	make -C utils clean
	rm -f *~
	rm -fr ${distdir} ${distdir}.tar.gz *.deb patch-stamp

distclean: clean
	make -C driver distclean
	make -C utils distclean
	rm -f .\#*

uninstall:
	@echo "NOTE: Not all installed files are removed, as different" \
		"distributions install ndiswrapper files at different places."
	@echo "Run uninstall as many times as necessary until no" \
		"\"removing\" messages appear below."
	@if [ "x$(shell which loadndisdriver)" != "x" ]; then \
		echo "removing $(shell which loadndisdriver)"; \
		/bin/rm -f $(shell which loadndisdriver); \
	fi
	@if [ "x$(shell which ndiswrapper)" != "x" ]; then \
		echo "removing $(shell which ndiswrapper)"; \
		/bin/rm -f $(shell which ndiswrapper); \
	fi
	@for module in $(shell find /lib/modules/$(KVERS) \
			-name "ndiswrapper*"); do \
		echo "removing $$module"; \
		/bin/rm -f $$module; \
	done

dist:
	@rm -rf ${distdir}
	mkdir -p ${distdir}
	@for file in $(DISTFILES); do \
	  cp  $$file $(distdir)/$$file; \
	done
	for subdir in $(DIST_SUBDIRS); do \
	  if test "$$subdir" = .; then :; else \
	    test -d $(distdir)/$$subdir \
	    || mkdir $(distdir)/$$subdir \
	    || exit 1; \
	  fi; \
	done
	make -C driver distdir=../${distdir}/driver dist
	make -C utils distdir=../${distdir}/utils dist
	make -C debian distdir=../${distdir}/debian dist
	# Update version in dist rpm spec file - don't crash if it fails
	-sed -i "s/\%define\s\+ndiswrapper_version\s\+[^\}]\+\}/%define ndiswrapper_version $(NDISWRAPPER_VERSION)\}/" $(distdir)/ndiswrapper.spec
	tar cfz ${distarchive} ${distdir}

rpm: dist ndiswrapper.spec
	rpmbuild -ta $(distarchive) --define="ndiswrapper_version $(NDISWRAPPER_VERSION)"

deb:
	@if [ -d debian ]; then \
		echo -e "ndiswrapper (${NDISWRAPPER_VERSION}) unstable; urgency=low\n\n  * see ChangeLog for details\n\n -- NdisWrapper Team <ndiswrapper-general@lists.sourceforge.net>  `date '+%a, %d %b %Y %H:%M:%S %z'`" > debian/changelog; \
		fakeroot make -f debian/rules binary; \
	else \
		 echo "Huh?"; \
	fi