force enable DO_CUMULATE
[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 \
25             $(DESTDIR)$(pkglibdir)/Build \
26             $(DESTDIR)$(bindir) \
27             $(DESTDIR)$(man1dir)
28         install -m755 \
29             build \
30             build_kiwi.sh \
31             vc \
32             createrpmdeps \
33             order \
34             expanddeps \
35             computeblocklists \
36             extractbuild \
37             getbinaryid \
38             killchroot \
39             getmacros \
40             getoptflags \
41             gettype \
42             getchangetarget \
43             common_functions \
44             init_buildsystem \
45             initscript_qemu_vm \
46             substitutedeps \
47             debtransform \
48             debtransformbz2 \
49             debtransformzip \
50             mkbaselibs \
51             mkdrpms \
52             createarchdeps \
53             createrepomddeps \
54             createyastdeps \
55             changelog2spec \
56             spec2changelog \
57             download \
58             spec_add_patch \
59             spectool \
60             signdummy \
61             unrpm \
62             $(DESTDIR)$(pkglibdir)
63         install -m644 Build/*.pm $(DESTDIR)$(pkglibdir)/Build
64         install -m644 qemu-reg $(DESTDIR)$(pkglibdir)
65         install -m644 *.pm baselibs_global*.conf lxc.conf $(DESTDIR)$(pkglibdir)
66         install -m644 configs/* $(DESTDIR)$(pkglibdir)/configs
67         install -m644 build.1 $(DESTDIR)$(man1dir)
68         ln -sf $(pkglibdir)/build $(DESTDIR)$(bindir)/build
69         ln -sf $(pkglibdir)/vc    $(DESTDIR)$(bindir)/buildvc
70         ln -sf $(pkglibdir)/unrpm $(DESTDIR)$(bindir)/unrpm
71
72 # Allow initvm to be packaged seperately from the rest of build.  This
73 # is useful because it is distributed as a static binary package (e.g.
74 # build-initvm-static) whereas the build scripts package is noarch.
75
76 initvm: initvm.c
77         $(CC) -o $@ -static $(CFLAGS) initvm.c
78
79 initvm-all: initvm
80
81 initvm-build: initvm
82
83 initvm-install: initvm
84         install -m755 -d $(DESTDIR)$(pkglibdir)
85         install -m755 initvm $(DESTDIR)$(pkglibdir)/initvm
86
87
88 dist:
89 ifeq ($(SCM),svn)
90         rm -rf $(BUILD)-$(VERSION)$(SVNVER)
91         svn export . $(BUILD)-$(VERSION)$(SVNVER)
92         tar --force-local -cjf $(BUILD)-$(VERSION)$(SVNVER).tar.bz2 $(BUILD)-$(VERSION)$(SVNVER)
93         rm -rf $(BUILD)-$(VERSION)$(SVNVER)
94 else
95 ifeq ($(SCM),git)
96         git archive --prefix=$(BUILD)-$(VERSION)_git$(DATE)/ HEAD| bzip2 > $(BUILD)-$(VERSION)_git$(DATE).tar.bz2
97 endif
98 endif