run vc when calling buildvc
[platform/upstream/build.git] / Makefile
1 VERSION=0.1
2 SCM=$(shell if test -d .svn; then echo svn; elif test -d .git; then echo git; fi)
3 DATE=$(shell date +%Y%m%d%H%M)
4 BUILD=build
5
6 ifeq ($(SCM),svn)
7 SVNVER=_SVN$(shell LANG=C svnversion .)
8 endif
9
10 prefix=/usr
11 bindir=$(prefix)/bin
12 datadir=$(prefix)/share
13 libdir=$(prefix)/lib
14 pkglibdir=$(libdir)/$(BUILD)
15 mandir=$(datadir)/man
16 man1dir=$(mandir)/man1
17 sysconfdir=/etc
18 DESTDIR=
19
20 all:
21
22 install:
23         install -m755 -d \
24             $(DESTDIR)$(pkglibdir)/{configs,Build} \
25             $(DESTDIR)$(bindir) \
26             $(DESTDIR)$(man1dir)
27         install -m755 \
28             build \
29             vc \
30             createrpmdeps \
31             order \
32             expanddeps \
33             computeblocklists \
34             extractbuild \
35             getbinaryid \
36             killchroot \
37             xen.conf \
38             getmacros \
39             getoptflags \
40             init_buildsystem \
41             substitutedeps \
42             debtransform \
43             mkbaselibs \
44             createrepomddeps \
45             createyastdeps \
46             changelog2spec \
47             $(DESTDIR)$(pkglibdir)
48         install -m644 Build/*.pm $(DESTDIR)$(pkglibdir)/Build
49         install -m644 *.pm baselibs_global.conf $(DESTDIR)$(pkglibdir)
50         install -m644 configs/* $(DESTDIR)$(pkglibdir)/configs
51         rm -f $(DESTDIR)$(pkglibdir)/configs/default.conf
52         cp -a configs/default.conf $(DESTDIR)$(pkglibdir)/configs/default.conf
53         install -m644 build.1 $(DESTDIR)$(man1dir)
54         install -m755 unrpm $(DESTDIR)$(bindir)
55         ln -sf $(pkglibdir)/build $(DESTDIR)$(bindir)/build
56         ln -sf $(pkglibdir)/vc    $(DESTDIR)$(bindir)/buildvc
57
58 dist:
59 ifeq ($(SCM),svn)
60         rm -rf $(BUILD)-$(VERSION)$(SVNVER)
61         svn export . $(BUILD)-$(VERSION)$(SVNVER)
62         tar --force-local -cjf $(BUILD)-$(VERSION)$(SVNVER).tar.bz2 $(BUILD)-$(VERSION)$(SVNVER)
63         rm -rf $(BUILD)-$(VERSION)$(SVNVER)
64 else
65 ifeq ($(SCM),git)
66         git archive --prefix=$(BUILD)-$(VERSION)_git$(DATE)/ HEAD| bzip2 > $(BUILD)-$(VERSION)_git$(DATE).tar.bz2
67 endif
68 endif