Rev 1177 | Rev 1181 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1177 | Rev 1179 | ||
---|---|---|---|
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 | SRCDIR= src |
7 | SRCS= $(SRCDIR)/rebootd.c |
7 | SRCS= $(SRCDIR)/rebootd.c |
8 | 8 | ||
9 | VER_MAJOR= 1 |
9 | VER_MAJOR= 1 |
10 | VER_MINOR= 0 |
10 | VER_MINOR= 0 |
11 | VER_REVISION!= svnversion . |
11 | VER_REVISION!= svnversion . |
12 | RELEASE_NAME= $(PROJ)-$(VER_MAJOR).$(VER_MINOR).$(VER_REVISION) |
- | |
13 | 12 | ||
14 | SAMPLES= $(SRCDIR)/rebootd.conf |
- | |
15 | PKGDIR= $(OUTDIR)/package |
- | |
16 | FREEBSDDIR= $(OUTDIR)/freebsd-port |
- | |
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 | - | ||
23 | $(PROG): $(SRCS) |
13 | $(PROG): $(SRCS) |
24 | cc -pedantic-errors -Wall -o $(PROG) \ |
14 | cc -pedantic-errors -Wall -o $(PROG) \ |
25 | -DVER_MAJOR=\"$(VER_MAJOR)\" -DVER_MINOR=\"$(VER_MINOR)\" -DVER_REVISION=\"$(VER_REVISION)\" \ |
15 | -DVER_MAJOR=\"$(VER_MAJOR)\" -DVER_MINOR=\"$(VER_MINOR)\" -DVER_REVISION=\"$(VER_REVISION)\" \ |
26 | $(SRCS) |
16 | $(SRCS) |
27 | 17 | ||
28 | all: clean $(PROG) |
18 | all: clean $(PROG) |
29 | 19 | ||
30 | pedantic: |
20 | pedantic: |
31 | lint -x -s -p -n -h -e -c -b -aa \ |
21 | lint -x -s -p -n -h -e -c -b -aa \ |
32 | -DVER_MAJOR=\"$(VER_MAJOR)\" -DVER_MINOR=\"$(VER_MINOR)\" -DVER_REVISION=\"$(VER_REVISION)\" \ |
22 | -DVER_MAJOR=\"$(VER_MAJOR)\" -DVER_MINOR=\"$(VER_MINOR)\" -DVER_REVISION=\"$(VER_REVISION)\" \ |
33 | $(SRCS) \ |
23 | $(SRCS) \ |
34 | | grep -E '^$(PROJ)' |
24 | | grep -E '^$(PROJ)' |
35 | cc -Wnested-externs -Wredundant-decls -Wmissing-declarations \ |
25 | cc -Wnested-externs -Wredundant-decls -Wmissing-declarations \ |
36 | -Wmissing-prototypes -Wstrict-prototypes -Waggregate-return \ |
26 | -Wmissing-prototypes -Wstrict-prototypes -Waggregate-return \ |
37 | -Wwrite-strings -Wcast-align -Wcast-qual -Wpointer-arith \ |
27 | -Wwrite-strings -Wcast-align -Wcast-qual -Wpointer-arith \ |
38 | -Wshadow -pedantic-errors -Wall \ |
28 | -Wshadow -pedantic-errors -Wall \ |
39 | -DVER_MAJOR=\"$(VER_MAJOR)\" -DVER_MINOR=\"$(VER_MINOR)\" -DVER_REVISION=\"$(VER_REVISION)\" \ |
29 | -DVER_MAJOR=\"$(VER_MAJOR)\" -DVER_MINOR=\"$(VER_MINOR)\" -DVER_REVISION=\"$(VER_REVISION)\" \ |
40 | -o /dev/null $(SRCS) |
30 | -o /dev/null $(SRCS) |
41 | 31 | ||
42 | release: |
32 | release: |
43 | ./bin/make_release.sh $(VER_MAJOR) $(VER_MINOR) |
33 | ./bin/make_release.sh $(VER_MAJOR) $(VER_MINOR) |
- | 34 | ./bin/make_freebsd_port.sh |
|
44 | 35 | ||
45 | freebsd-port: |
36 | freebsd-port: |
46 | rm -rf $(FREEBSDDIR) |
37 | ./bin/make_freebsd_port.sh |
47 | mkdir $(FREEBSDDIR) |
- | |
48 | cp -r ports/freebsd $(FREEBSDDIR)/$(PROJ) |
- | |
49 | sed -e 's/%VER_MAJOR%/$(VER_MAJOR)/' -e 's/%VER_MINOR%/$(VER_MINOR)/' \ |
- | |
50 | -e 's/%VER_REVISION%/$(LAST_REVISION)/' ports/freebsd/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 |
- | |
54 | tar cf - --exclude '*/.svn' -C $(FREEBSDDIR) $(PROJ) | gzip > $(OUTDIR)/$(PROJ)-freebsd-port.tar.gz |
- | |
55 | rm -rf $(FREEBSDDIR) |
- | |
56 | 38 | ||
57 | clean: |
39 | clean: |
58 | rm -rf $(OUTDIR)/* |
40 | rm -rf $(OUTDIR)/* |
59 | 41 |