Subversion Repositories general

Rev

Rev 1159 | Rev 1177 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1159 dev 1
# rebootd
1141 dev 2
 
1173 dev 3
PROJ=		rebootd
4
OUTDIR=		output
5
PROG=		$(OUTDIR)/$(PROJ)
6
SRCS=		rebootd.c
1159 dev 7
 
1173 dev 8
VER_MAJOR=	1
9
VER_MINOR=	0
10
VER_REVISION!=	svnversion
11
RELEASE_NAME=	$(PROJ)-$(VER_MAJOR).$(VER_MINOR).$(VER_REVISION)
12
 
13
SAMPLES=	rebootd.conf
14
PKGDIR=		$(OUTDIR)/package
15
 
1159 dev 16
$(PROG): $(SRCS)
1173 dev 17
	cc -pedantic-errors -Wall -o $(PROG) \
18
		-DVER_MAJOR=\"$(VER_MAJOR)\" -DVER_MINOR=\"$(VER_MINOR)\" -DVER_REVISION=\"$(VER_REVISION)\" \
19
		$(SRCS)
1144 dev 20
 
1159 dev 21
all:	clean $(PROG)
1156 dev 22
 
23
pedantic:
1173 dev 24
	lint -x -s -p -n -h -e -c -b -aa \
25
		-DVER_MAJOR=\"$(VER_MAJOR)\" -DVER_MINOR=\"$(VER_MINOR)\" -DVER_REVISION=\"$(VER_REVISION)\" \
26
		$(SRCS) \
27
		| grep -E '^$(PROJ)'
1156 dev 28
	cc -Wnested-externs -Wredundant-decls -Wmissing-declarations \
29
		-Wmissing-prototypes -Wstrict-prototypes -Waggregate-return \
30
		-Wwrite-strings -Wcast-align -Wcast-qual -Wpointer-arith \
1173 dev 31
		-Wshadow -pedantic-errors -Wall \
32
		-DVER_MAJOR=\"$(VER_MAJOR)\" -DVER_MINOR=\"$(VER_MINOR)\" -DVER_REVISION=\"$(VER_REVISION)\" \
33
		-o /dev/null $(SRCS)
1156 dev 34
 
1173 dev 35
package:
36
	rm -rf $(PKGDIR)
37
	mkdir $(PKGDIR) $(PKGDIR)/$(RELEASE_NAME)
38
	cp $(SRCS) $(SAMPLES) $(PKGDIR)/$(RELEASE_NAME)
39
	sed -e 's/%VER_MAJOR%/$(VER_MAJOR)/' -e 's/%VER_MINOR%/$(VER_MINOR)/' \
40
		-e 's/%VER_REVISION%/$(VER_REVISION)/' Makefile.package \
41
		> $(PKGDIR)/$(RELEASE_NAME)/Makefile
42
	tar cf - -C $(PKGDIR) $(RELEASE_NAME) | gzip > $(OUTDIR)/$(RELEASE_NAME).tar.gz
43
	rm -rf $(PKGDIR)
44
 
1144 dev 45
clean:
1156 dev 46
	rm -f $(PROG)
1144 dev 47