summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 2f26cdc0b5b478587cab79ccdca2eef776be869d (plain)
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
include Makefile.config

NAME = ldetect-lst
VERSION := 0.1.325

FILES = AUTHORS ChangeLog Makefile Makefile.config convert lst update-ldetect-lst

.PHONY: changelog log ChangeLog

build: 
	$(MAKE) -C lst build
	$(MAKE) -C dkms-modules-info build

check:
	$(MAKE) -C lst check

clean:
	rm -f *~
	$(MAKE) -C lst clean

install: build
	install -d $(bindir) $(sbindir) $(dir)
	$(MAKE) -C lst install
	$(MAKE) -C dkms-modules-info install
	install update-ldetect-lst $(sbindir)
	install convert/merge2pcitable.pl $(bindir)

# rules to build a distributable rpm

dist-svn: 
	svn export -q -rBASE . $(NAME)-$(VERSION)
	tar cfJ ../$(NAME)-$(VERSION).tar.xz $(NAME)-$(VERSION) 
	rm -rf $(NAME)-$(VERSION) 
				 
dist-git: 
	@git archive --prefix=$(NAME)-$(VERSION)/ HEAD | xz >../$(NAME)-$(VERSION).tar.xz;


dist: dis
dis: clean
	rm -rf ../$(NAME)-$(VERSION)*.tar* $(NAME)-$(VERSION)
	@if [ -e ".svn" ]; then \
		$(MAKE) dist-svn; \
	elif [ -e ".git" ]; then \
		$(MAKE) dist-git; \
	else \
		echo "Unknown SCM (not SVN nor GIT)";\
		exit 1; \
	fi;

	$(info $(shell dirname $$PWD)/$(NAME)-$(VERSION).tar.xz is ready)

log: changelog

changelog: ChangeLog

ChangeLog: ../common/username.xml
	@if test -d "$$PWD/.git"; then \
		../common/gitlog-to-changelog > $@.tmp \
	  && mv -f $@.tmp $@ \
	  || (rm -f  $@.tmp; \
	 echo Failed to generate ChangeLog, your ChangeLog may be outdated >&2; \
	 (test -f $@ || echo git-log is required to generate this file >> $@)); \
	else \
	 svn2cl --accum --authors ../common/username.xml; \
	 rm -f *.bak;  \
	 svn commit -m "Generated by svn2cl the `LC_TIME=C date '+%d_%b'`" ChangeLog; \
	fi;

# Makefile ends here