Rev 1159 | Rev 1177 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1159 | Rev 1173 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | # rebootd |
1 | # rebootd |
2 | 2 | ||
3 | PROG= rebootd |
3 | PROJ= rebootd |
- | 4 | OUTDIR= output |
|
- | 5 | PROG= $(OUTDIR)/$(PROJ) |
|
4 | SRCS= rebootd.c |
6 | SRCS= rebootd.c |
5 | 7 | ||
- | 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 | ||
6 | $(PROG): $(SRCS) |
16 | $(PROG): $(SRCS) |
7 | cc -pedantic-errors -Wall -o $(PROG) $(SRCS) |
17 | cc -pedantic-errors -Wall -o $(PROG) \ |
- | 18 | -DVER_MAJOR=\"$(VER_MAJOR)\" -DVER_MINOR=\"$(VER_MINOR)\" -DVER_REVISION=\"$(VER_REVISION)\" \ |
|
- | 19 | $(SRCS) |
|
8 | 20 | ||
9 | all: clean $(PROG) |
21 | all: clean $(PROG) |
10 | 22 | ||
11 | pedantic: |
23 | pedantic: |
12 | lint -x -s -p -n -h -e -c -b -aa $(SRCS) | grep -E '^$(PROG)' |
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)' |
|
13 | cc -Wnested-externs -Wredundant-decls -Wmissing-declarations \ |
28 | cc -Wnested-externs -Wredundant-decls -Wmissing-declarations \ |
14 | -Wmissing-prototypes -Wstrict-prototypes -Waggregate-return \ |
29 | -Wmissing-prototypes -Wstrict-prototypes -Waggregate-return \ |
15 | -Wwrite-strings -Wcast-align -Wcast-qual -Wpointer-arith \ |
30 | -Wwrite-strings -Wcast-align -Wcast-qual -Wpointer-arith \ |
16 | -Wshadow -pedantic-errors -Wall -o $(PROG) $(SRCS) |
31 | -Wshadow -pedantic-errors -Wall \ |
- | 32 | -DVER_MAJOR=\"$(VER_MAJOR)\" -DVER_MINOR=\"$(VER_MINOR)\" -DVER_REVISION=\"$(VER_REVISION)\" \ |
|
- | 33 | -o /dev/null $(SRCS) |
|
- | 34 | ||
- | 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) |
|
17 | 44 | ||
18 | clean: |
45 | clean: |
19 | rm -f $(PROG) |
46 | rm -f $(PROG) |
20 | 47 |