Subversion Repositories general

Rev

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

# rebootd

PROJ=           rebootd
OUTDIR=         output
PROG=           $(OUTDIR)/$(PROJ)
SRCS=           rebootd.c

VER_MAJOR=      1
VER_MINOR=      0
VER_REVISION!=  svnversion
RELEASE_NAME=   $(PROJ)-$(VER_MAJOR).$(VER_MINOR).$(VER_REVISION)

SAMPLES=        rebootd.conf
PKGDIR=         $(OUTDIR)/package

$(PROG): $(SRCS)
        cc -pedantic-errors -Wall -o $(PROG) \
                -DVER_MAJOR=\"$(VER_MAJOR)\" -DVER_MINOR=\"$(VER_MINOR)\" -DVER_REVISION=\"$(VER_REVISION)\" \
                $(SRCS)

all:    clean $(PROG)

pedantic:
        lint -x -s -p -n -h -e -c -b -aa \
                -DVER_MAJOR=\"$(VER_MAJOR)\" -DVER_MINOR=\"$(VER_MINOR)\" -DVER_REVISION=\"$(VER_REVISION)\" \
                $(SRCS) \
                | grep -E '^$(PROJ)'
        cc -Wnested-externs -Wredundant-decls -Wmissing-declarations \
                -Wmissing-prototypes -Wstrict-prototypes -Waggregate-return \
                -Wwrite-strings -Wcast-align -Wcast-qual -Wpointer-arith \
                -Wshadow -pedantic-errors -Wall \
                -DVER_MAJOR=\"$(VER_MAJOR)\" -DVER_MINOR=\"$(VER_MINOR)\" -DVER_REVISION=\"$(VER_REVISION)\" \
                -o /dev/null $(SRCS)

package:
        rm -rf $(PKGDIR)
        mkdir $(PKGDIR) $(PKGDIR)/$(RELEASE_NAME)
        cp $(SRCS) $(SAMPLES) $(PKGDIR)/$(RELEASE_NAME)
        sed -e 's/%VER_MAJOR%/$(VER_MAJOR)/' -e 's/%VER_MINOR%/$(VER_MINOR)/' \
                -e 's/%VER_REVISION%/$(VER_REVISION)/' Makefile.package \
                > $(PKGDIR)/$(RELEASE_NAME)/Makefile
        tar cf - -C $(PKGDIR) $(RELEASE_NAME) | gzip > $(OUTDIR)/$(RELEASE_NAME).tar.gz
        rm -rf $(PKGDIR)

clean:
        rm -f $(PROG)