Subversion Repositories general

Compare Revisions

Regard whitespace Rev 1173 → Rev 1177

/rebootd/trunk/Makefile
3,16 → 3,23
PROJ= rebootd
OUTDIR= output
PROG= $(OUTDIR)/$(PROJ)
SRCS= rebootd.c
SRCDIR= src
SRCS= $(SRCDIR)/rebootd.c
 
VER_MAJOR= 1
VER_MINOR= 0
VER_REVISION!= svnversion
VER_REVISION!= svnversion .
RELEASE_NAME= $(PROJ)-$(VER_MAJOR).$(VER_MINOR).$(VER_REVISION)
 
SAMPLES= rebootd.conf
SAMPLES= $(SRCDIR)/rebootd.conf
PKGDIR= $(OUTDIR)/package
FREEBSDDIR= $(OUTDIR)/freebsd-port
 
.if exists($(OUTDIR)/last_revision.txt)
LAST_REVISION!= cat $(OUTDIR)/last_revision.txt
LAST_TAR= $(PROJ)-$(VER_MAJOR).$(VER_MINOR).$(LAST_REVISION).tar.gz
.endif
 
$(PROG): $(SRCS)
cc -pedantic-errors -Wall -o $(PROG) \
-DVER_MAJOR=\"$(VER_MAJOR)\" -DVER_MINOR=\"$(VER_MINOR)\" -DVER_REVISION=\"$(VER_REVISION)\" \
32,16 → 39,21
-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)
release:
./bin/make_release.sh $(VER_MAJOR) $(VER_MINOR)
 
freebsd-port:
rm -rf $(FREEBSDDIR)
mkdir $(FREEBSDDIR)
cp -r ports/freebsd $(FREEBSDDIR)/$(PROJ)
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)
-e 's/%VER_REVISION%/$(LAST_REVISION)/' ports/freebsd/Makefile \
> $(FREEBSDDIR)/$(PROJ)/Makefile
( cd $(OUTDIR); md5 $(LAST_TAR) ) > $(FREEBSDDIR)/$(PROJ)/distinfo
echo "SIZE ($(LAST_TAR)) =" `stat -f '%z' $(OUTDIR)/$(LAST_TAR)` >> $(FREEBSDDIR)/$(PROJ)/distinfo
tar cf - --exclude '*/.svn' -C $(FREEBSDDIR) $(PROJ) | gzip > $(OUTDIR)/$(PROJ)-freebsd-port.tar.gz
rm -rf $(FREEBSDDIR)
 
clean:
rm -f $(PROG)
rm -rf $(OUTDIR)/*