1 # Makefile for the fsync package
2 # Copyright 2008 Parliament Hill Computers Ltd, all rights reserved.
3 # Author: ADDW December 2008
4 # SCCS: @(#)Makefile 1.1 11/14/11 22:37:38
6 # The distribution version # comes from the SCCS id of the spec file.
7 # To do a test build run something like:
8 # make VERSION=test dist
9 # If the spec file is out on delta, go:
10 # make VERSION=1.1 dist
17 CONFIGS=configure.in config.h.in
18 DOCS=README Contributors License Hacks
20 SPECFILE=$(PACKAGE).spec
21 VERSION := $(shell sed -ne '/^%define \+version \+/s///p' $(SPECFILE) )
23 BINDIR=$(DESTDIR)/bin/
24 DOCDIR=$(DESTDIR)/share/doc/$(PACKAGE)-$(VERSION)
26 BUILDFILES=$(SPECFILE) $(MAKEFILE)
28 # Default target is to make the programs - not install
31 # Create directories then copy in script and documentation:
33 install -d $(BINDIR) $(DOCDIR)
34 install -p $(PROGS) $(BINDIR)
35 install -p -m 644 $(DOCS) $(DOCDIR)
36 for d in $(SUBDIRS); do make -C $$d install ; done
38 # Create a tar file for distribution
39 dist: $(PACKAGE)-$(VERSION).tar.gz
41 # The tar file for distribution:
42 $(PACKAGE)-$(VERSION).tar.gz: $(DOCS) $(BUILDPROGS) $(BUILDFILES) $(SOURCES) $(CONFIGS)
43 mkdir -p .BuildDist/$(PACKAGE)-$(VERSION)
44 cp -al $^ .BuildDist/$(PACKAGE)-$(VERSION)
45 for d in $(SUBDIRS); do make -C $$d VERSION=$(VERSION) copy-dist ; done
46 cd .BuildDist && tar czf ../$@ $(PACKAGE)-$(VERSION)
47 rm -rf .BuildDist/$(PACKAGE)-$(VERSION)
50 rm -f $(PACKAGE)-$(VERSION).tar.gz
53 for d in $(SUBDIRS); do make -C $$d VERSION=$(VERSION) clean ; done
55 fsync: fsync.c config.h