Merge branch 'vendor/BINUTILS221'
[dragonfly.git] / etc / Makefile.usr
1 # Makefile.usr - installed as /usr/Makefile
2 #
3 # Provides simple targets to download and maintain /usr/src, /usr/pkgsrc etc.
4
5 GITHOST?=git.dragonflybsd.org
6
7 help all:
8         @echo "HELP:"
9         @echo ""
10 .if exists(${.CURDIR}/pkgsrc/.git)
11 .if exists(${.CURDIR}/pkgsrc/Makefile)
12         @echo "    make pkgsrc-update       - update your pkgsrc repo from the net"
13 .else
14         @echo "    make pkgsrc-checkout     - initial checkout of your pre-packaged"
15         @echo "                               pkgsrc repo."
16         @echo "    make pkgsrc-update       - update your pkgsrc repo from the net"
17         @echo "                               after the initial checkout."
18 .endif
19 .else
20         @echo "    make pkgsrc-create       - fetch initial pkgsrc repo from the net"
21         @echo "    make pkgsrc-update       - update your pkgsrc repo from the net"
22 .endif
23         @echo ""
24 .if exists(${.CURDIR}/src/.git)
25 .if exists(${.CURDIR}/src/Makefile)
26         @echo "    make src-update          - update your src repo from the net"
27 .else
28         @echo "    make src-checkout        - initial checkout of your pre-packaged src repo"
29         @echo "    make src-update          - update your src repo from the net"
30         @echo "                               after the initial checkout."
31 .endif
32 .else
33         @echo "    make src-create          - fetch initial src repo from the net"
34         @echo "    make src-create-shallow  - fetch initial history-free src repo"
35         @echo "    make src-update          - update your src repo from the net"
36 .endif
37         @echo ""
38 .if exists(${.CURDIR}/src-sys.tgz)
39         @echo "    make release-sys-extract - extract the pre-packaged sys-only sources"
40 .endif
41         @echo ""
42         @echo "If automating please feel free to run git pull's from cron."
43         @echo "We prefer once a day but you can run them more often if you"
44         @echo "desire."
45         @echo ""
46         @echo "If you have a repo previously maintained via CVS you should"
47         @echo "rm -rf it (save any local modifications) and then use the"
48         @echo "make src-create and/or make pkgsrc-create to set up the initial"
49         @echo "git repo."
50
51 pkgsrc-create:
52         @echo "If problems occur you may have to rm -rf pkgsrc and try again."
53         @echo ""
54         mkdir -p ${.CURDIR}/pkgsrc
55         cd ${.CURDIR}/pkgsrc && git init
56         cd ${.CURDIR}/pkgsrc && \
57                 git remote add origin git://${GITHOST}/pkgsrcv2.git
58         cd ${.CURDIR}/pkgsrc && git fetch origin
59         cd ${.CURDIR}/pkgsrc && git branch master origin/master
60         cd ${.CURDIR}/pkgsrc && git branch pkgsrc-2010Q4 origin/pkgsrc-2010Q4
61         cd ${.CURDIR}/pkgsrc && git checkout pkgsrc-2010Q4
62         cd ${.CURDIR}/pkgsrc && git pull
63
64 pkgsrc-checkout:
65         cd ${.CURDIR}/pkgsrc && git checkout pkgsrc-2010Q4
66
67 pkgsrc-update:
68         cd ${.CURDIR}/pkgsrc && git pull
69
70 src-create:
71         @echo "If problems occur you may have to rm -rf src and try again."
72         @echo ""
73         mkdir -p ${.CURDIR}/src
74         cd ${.CURDIR}/src && git init
75         cd ${.CURDIR}/src && \
76                 git remote add origin git://${GITHOST}/dragonfly.git
77         cd ${.CURDIR}/src && git fetch origin
78         cd ${.CURDIR}/src && git branch master origin/master
79         cd ${.CURDIR}/src && git checkout master
80         cd ${.CURDIR}/src && git pull
81
82 src-create-shallow:
83         @echo "If problems occur you may have to rm -rf src and try again."
84         @echo ""
85         mkdir -p ${.CURDIR}/src
86         cd ${.CURDIR}/src && git init
87         cd ${.CURDIR}/src && \
88             git remote add origin git://git.dragonflybsd.org/dragonfly.git
89         cd ${.CURDIR}/src && git fetch --depth=1 origin
90         cd ${.CURDIR}/src && git branch master origin/master
91         cd ${.CURDIR}/src && git checkout master
92         cd ${.CURDIR}/src && git pull
93
94 src-checkout:
95         cd ${.CURDIR}/src && git checkout master
96
97 src-update:
98         cd ${.CURDIR}/src && git pull
99
100 release-sys-extract:
101         cd ${.CURDIR} && tar xvpzf src-sys.tgz
102