Subversion Repositories general

Rev

Rev 1173 | Rev 1179 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1173 Rev 1177
Line 1... Line 1...
1
# rebootd
1
# rebootd
2
 
2
 
3
PROJ=		rebootd
3
PROJ=		rebootd
4
OUTDIR=		output
4
OUTDIR=		output
5
PROG=		$(OUTDIR)/$(PROJ)
5
PROG=		$(OUTDIR)/$(PROJ)
-
 
6
SRCDIR=		src
6
SRCS=		rebootd.c
7
SRCS=		$(SRCDIR)/rebootd.c
7
 
8
 
8
VER_MAJOR=	1
9
VER_MAJOR=	1
9
VER_MINOR=	0
10
VER_MINOR=	0
10
VER_REVISION!=	svnversion
11
VER_REVISION!=	svnversion .
11
RELEASE_NAME=	$(PROJ)-$(VER_MAJOR).$(VER_MINOR).$(VER_REVISION)
12
RELEASE_NAME=	$(PROJ)-$(VER_MAJOR).$(VER_MINOR).$(VER_REVISION)
12
 
13
 
13
SAMPLES=	rebootd.conf
14
SAMPLES=	$(SRCDIR)/rebootd.conf
14
PKGDIR=		$(OUTDIR)/package
15
PKGDIR=		$(OUTDIR)/package
-
 
16
FREEBSDDIR=	$(OUTDIR)/freebsd-port
15
 
17
 
-
 
18
.if exists($(OUTDIR)/last_revision.txt)
-
 
19
LAST_REVISION!=	cat $(OUTDIR)/last_revision.txt
-
 
20
LAST_TAR=	$(PROJ)-$(VER_MAJOR).$(VER_MINOR).$(LAST_REVISION).tar.gz
-
 
21
.endif
-
 
22
 
16
$(PROG): $(SRCS)
23
$(PROG): $(SRCS)
17
	cc -pedantic-errors -Wall -o $(PROG) \
24
	cc -pedantic-errors -Wall -o $(PROG) \
18
		-DVER_MAJOR=\"$(VER_MAJOR)\" -DVER_MINOR=\"$(VER_MINOR)\" -DVER_REVISION=\"$(VER_REVISION)\" \
25
		-DVER_MAJOR=\"$(VER_MAJOR)\" -DVER_MINOR=\"$(VER_MINOR)\" -DVER_REVISION=\"$(VER_REVISION)\" \
19
		$(SRCS)
26
		$(SRCS)
20
 
27
 
Line 30... Line 37...
30
		-Wwrite-strings -Wcast-align -Wcast-qual -Wpointer-arith \
37
		-Wwrite-strings -Wcast-align -Wcast-qual -Wpointer-arith \
31
		-Wshadow -pedantic-errors -Wall \
38
		-Wshadow -pedantic-errors -Wall \
32
		-DVER_MAJOR=\"$(VER_MAJOR)\" -DVER_MINOR=\"$(VER_MINOR)\" -DVER_REVISION=\"$(VER_REVISION)\" \
39
		-DVER_MAJOR=\"$(VER_MAJOR)\" -DVER_MINOR=\"$(VER_MINOR)\" -DVER_REVISION=\"$(VER_REVISION)\" \
33
		-o /dev/null $(SRCS)
40
		-o /dev/null $(SRCS)
34
 
41
 
35
package:
42
release:
-
 
43
	./bin/make_release.sh $(VER_MAJOR) $(VER_MINOR)
-
 
44
 
-
 
45
freebsd-port:
36
	rm -rf $(PKGDIR)
46
	rm -rf $(FREEBSDDIR)
37
	mkdir $(PKGDIR) $(PKGDIR)/$(RELEASE_NAME)
47
	mkdir $(FREEBSDDIR)
38
	cp $(SRCS) $(SAMPLES) $(PKGDIR)/$(RELEASE_NAME)
48
	cp -r ports/freebsd $(FREEBSDDIR)/$(PROJ)
39
	sed -e 's/%VER_MAJOR%/$(VER_MAJOR)/' -e 's/%VER_MINOR%/$(VER_MINOR)/' \
49
	sed -e 's/%VER_MAJOR%/$(VER_MAJOR)/' -e 's/%VER_MINOR%/$(VER_MINOR)/' \
40
		-e 's/%VER_REVISION%/$(VER_REVISION)/' Makefile.package \
50
		-e 's/%VER_REVISION%/$(LAST_REVISION)/' ports/freebsd/Makefile \
41
		> $(PKGDIR)/$(RELEASE_NAME)/Makefile
51
		> $(FREEBSDDIR)/$(PROJ)/Makefile
-
 
52
	( cd $(OUTDIR); md5 $(LAST_TAR) ) > $(FREEBSDDIR)/$(PROJ)/distinfo
-
 
53
	echo "SIZE ($(LAST_TAR)) =" `stat -f '%z' $(OUTDIR)/$(LAST_TAR)` >> $(FREEBSDDIR)/$(PROJ)/distinfo
42
	tar cf - -C $(PKGDIR) $(RELEASE_NAME) | gzip > $(OUTDIR)/$(RELEASE_NAME).tar.gz
54
	tar cf - --exclude '*/.svn' -C $(FREEBSDDIR) $(PROJ) | gzip > $(OUTDIR)/$(PROJ)-freebsd-port.tar.gz
43
	rm -rf $(PKGDIR)
55
	rm -rf $(FREEBSDDIR)
44
 
56
 
45
clean:
57
clean:
46
	rm -f $(PROG)
58
	rm -rf $(OUTDIR)/*
47
 
59