Rev 1173 | Rev 1179 | 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) |
||
1177 | dev | 6 | SRCDIR= src |
7 | SRCS= $(SRCDIR)/rebootd.c |
||
1159 | dev | 8 | |
1173 | dev | 9 | VER_MAJOR= 1 |
10 | VER_MINOR= 0 |
||
1177 | dev | 11 | VER_REVISION!= svnversion . |
1173 | dev | 12 | RELEASE_NAME= $(PROJ)-$(VER_MAJOR).$(VER_MINOR).$(VER_REVISION) |
13 | |||
1177 | dev | 14 | SAMPLES= $(SRCDIR)/rebootd.conf |
1173 | dev | 15 | PKGDIR= $(OUTDIR)/package |
1177 | dev | 16 | FREEBSDDIR= $(OUTDIR)/freebsd-port |
1173 | dev | 17 | |
1177 | dev | 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 | |||
1159 | dev | 23 | $(PROG): $(SRCS) |
1173 | dev | 24 | cc -pedantic-errors -Wall -o $(PROG) \ |
25 | -DVER_MAJOR=\"$(VER_MAJOR)\" -DVER_MINOR=\"$(VER_MINOR)\" -DVER_REVISION=\"$(VER_REVISION)\" \ |
||
26 | $(SRCS) |
||
1144 | dev | 27 | |
1159 | dev | 28 | all: clean $(PROG) |
1156 | dev | 29 | |
30 | pedantic: |
||
1173 | dev | 31 | lint -x -s -p -n -h -e -c -b -aa \ |
32 | -DVER_MAJOR=\"$(VER_MAJOR)\" -DVER_MINOR=\"$(VER_MINOR)\" -DVER_REVISION=\"$(VER_REVISION)\" \ |
||
33 | $(SRCS) \ |
||
34 | | grep -E '^$(PROJ)' |
||
1156 | dev | 35 | cc -Wnested-externs -Wredundant-decls -Wmissing-declarations \ |
36 | -Wmissing-prototypes -Wstrict-prototypes -Waggregate-return \ |
||
37 | -Wwrite-strings -Wcast-align -Wcast-qual -Wpointer-arith \ |
||
1173 | dev | 38 | -Wshadow -pedantic-errors -Wall \ |
39 | -DVER_MAJOR=\"$(VER_MAJOR)\" -DVER_MINOR=\"$(VER_MINOR)\" -DVER_REVISION=\"$(VER_REVISION)\" \ |
||
40 | -o /dev/null $(SRCS) |
||
1156 | dev | 41 | |
1177 | dev | 42 | release: |
43 | ./bin/make_release.sh $(VER_MAJOR) $(VER_MINOR) |
||
44 | |||
45 | freebsd-port: |
||
46 | rm -rf $(FREEBSDDIR) |
||
47 | mkdir $(FREEBSDDIR) |
||
48 | cp -r ports/freebsd $(FREEBSDDIR)/$(PROJ) |
||
1173 | dev | 49 | sed -e 's/%VER_MAJOR%/$(VER_MAJOR)/' -e 's/%VER_MINOR%/$(VER_MINOR)/' \ |
1177 | dev | 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) |
||
1173 | dev | 56 | |
1144 | dev | 57 | clean: |
1177 | dev | 58 | rm -rf $(OUTDIR)/* |
1144 | dev | 59 |