This repository has been archived by the owner on Jan 22, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
/
Makefile
161 lines (140 loc) · 5.77 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
#
# Copyright (c) 2005 Dario Freni
#
# See COPYING for licence terms.
#
# $FreeBSD$
# $Id: Makefile,v 1.3 2008/05/05 20:51:04 sullrich Exp $
#
# FreeSBIE makefile. Main targets are:
#
# iso: build an iso image
# img: build a loopback image
# flash: copy the built system on a device (interactive)
# freesbie: same of `iso'
#
# pkgselect: choose packages to include in the built system (interactive)
.if defined(MAKEOBJDIRPREFIX)
CANONICALOBJDIR:=${MAKEOBJDIRPREFIX}${.CURDIR}
.elif defined(MAKEOBJDIR)
CANONICALOBJDIR:=${MAKEOBJDIR}
.else
CANONICALOBJDIR:=/usr/obj${.CURDIR}
.endif
.if defined(CUSTOM_MAKEOBJDIRPREFIX)
PRE_LAUNCH=env MAKEOBJDIRPREFIX=${CUSTOM_MAKEOBJDIRPREFIX}
.endif
.if ${FREEBSD_VERSION} < 9
pkgtarget=pkginstall
.else
pkgtarget=pkgnginstall
.endif
all: freesbie
freesbie: iso
pkgselect: obj
@sh ${.CURDIR}/scripts/launch.sh ${.CURDIR} pkgselect
obj: .done_objdir
.done_objdir:
@if ! test -d ${CANONICALOBJDIR}/; then \
mkdir -p ${CANONICALOBJDIR}; \
if ! test -d ${CANONICALOBJDIR}/; then \
${ECHO} ">>> Unable to create ${CANONICALOBJDIR}."; \
exit 1; \
fi; \
fi
@${ECHO} ">>> Setting CANONICALOBJDIR to ${CANONICALOBJDIR}."
@if ! test -f ${CANONICALOBJDIR}/.done_objdir; then \
touch ${CANONICALOBJDIR}/.done_objdir; \
fi
buildworld: .done_buildworld
.done_buildworld: .done_objdir
@-rm -f ${CANONICALOBJDIR}/.tmp_buildworld
@touch ${CANONICALOBJDIR}/.tmp_buildworld
@${ECHO} ">>> Starting buildworld `LC_ALL=C date`."
@${PRE_LAUNCH} sh ${.CURDIR}/scripts/launch.sh ${.CURDIR} buildworld ${CANONICALOBJDIR}/.tmp_buildworld
@${ECHO} ">>> Finished buildworld `LC_ALL=C date`."
@mv ${CANONICALOBJDIR}/.tmp_buildworld ${CANONICALOBJDIR}/.done_buildworld
installworld: .done_installworld
.done_installworld: .done_buildworld
@-rm -f ${CANONICALOBJDIR}/.tmp_installworld
@touch ${CANONICALOBJDIR}/.tmp_installworld
@${ECHO} ">>> Starting installworld `LC_ALL=C date`."
@${PRE_LAUNCH} sh ${.CURDIR}/scripts/launch.sh ${.CURDIR} installworld ${CANONICALOBJDIR}/.tmp_installworld
@${ECHO} ">>> Finished installworld `LC_ALL=C date`."
@mv ${CANONICALOBJDIR}/.tmp_installworld ${CANONICALOBJDIR}/.done_installworld
buildkernel: .done_buildkernel
.done_buildkernel: .done_buildworld
@-rm -f ${CANONICALOBJDIR}/.tmp_buildkernel
@touch ${CANONICALOBJDIR}/.tmp_buildkernel
@${PRE_LAUNCH} sh ${.CURDIR}/scripts/launch.sh ${.CURDIR} buildkernel ${CANONICALOBJDIR}/.tmp_buildkernel
@mv ${CANONICALOBJDIR}/.tmp_buildkernel ${CANONICALOBJDIR}/.done_buildkernel
installkernel: .done_installkernel
.done_installkernel: .done_buildkernel .done_installworld
@-rm -f ${CANONICALOBJDIR}/.tmp_installkernel
@touch ${CANONICALOBJDIR}/.tmp_installkernel
@${PRE_LAUNCH} sh ${.CURDIR}/scripts/launch.sh ${.CURDIR} installkernel ${CANONICALOBJDIR}/.tmp_installkernel
@mv ${CANONICALOBJDIR}/.tmp_installkernel ${CANONICALOBJDIR}/.done_installkernel
pkginstall: .done_pkginstall
.done_pkginstall: .done_installworld
@-rm -f ${CANONICALOBJDIR}/.tmp_pkginstall
@touch ${CANONICALOBJDIR}/.tmp_pkginstall
@${ECHO} ">>> Started pkginstall `LC_ALL=C date`."
@sh ${.CURDIR}/scripts/launch.sh ${.CURDIR} pkginstall ${CANONICALOBJDIR}/.tmp_pkginstall
@${ECHO} ">>> Finished pkginstall `LC_ALL=C date`."
@mv ${CANONICALOBJDIR}/.tmp_pkginstall ${CANONICALOBJDIR}/.done_pkginstall
pkgnginstall: .done_pkgnginstall
.done_pkgnginstall: .done_installworld
@-rm -f ${CANONICALOBJDIR}/.tmp_pkgnginstall
@touch ${CANONICALOBJDIR}/.tmp_pkgnginstall
@${ECHO} ">>> Started pkgnginstall `LC_ALL=C date`."
@sh ${.CURDIR}/scripts/launch.sh ${.CURDIR} pkgnginstall ${CANONICALOBJDIR}/.tmp_pkgnginstall
@${ECHO} ">>> Finished pkgnginstall `LC_ALL=C date`."
@mv ${CANONICALOBJDIR}/.tmp_pkgnginstall ${CANONICALOBJDIR}/.done_pkgnginstall
extra: .done_extra
.done_extra: .done_installworld
@-rm -f ${CANONICALOBJDIR}/.tmp_extra
@touch ${CANONICALOBJDIR}/.tmp_extra
@${ECHO} ">>> Started extra `LC_ALL=C date`."
@sh ${.CURDIR}/scripts/launch.sh ${.CURDIR} extra ${CANONICALOBJDIR}/.tmp_extra
@${ECHO} ">>> Finished extra `LC_ALL=C date`."
@mv ${CANONICALOBJDIR}/.tmp_extra ${CANONICALOBJDIR}/.done_extra
clonefs: .done_clonefs
.done_clonefs: ${pkgtarget} .done_extra
@-rm -f ${CANONICALOBJDIR}/.tmp_clonefs
@touch ${CANONICALOBJDIR}/.tmp_clonefs
@${ECHO} ">>> Started clonefs `LC_ALL=C date`."
@sh ${.CURDIR}/scripts/launch.sh ${.CURDIR} clonefs ${CANONICALOBJDIR}/.tmp_clonefs
@${ECHO} ">>> Finished clonefs `LC_ALL=C date`."
@mv ${CANONICALOBJDIR}/.tmp_clonefs ${CANONICALOBJDIR}/.done_clonefs
compressfs:
@${ECHO} ">>> Started compressfs `LC_ALL=C date`."
@sh ${.CURDIR}/scripts/launch.sh ${.CURDIR} compressfs ${CANONICALOBJDIR}/.tmp_extra
@${ECHO} ">>> Finished compressfs `LC_ALL=C date`."
iso: .done_iso
.done_iso: .done_clonefs
@-rm -f ${CANONICALOBJDIR}/.tmp_iso
@touch ${CANONICALOBJDIR}/.tmp_iso
@${ECHO} ">>> Started iso `LC_ALL=C date`."
@sh ${.CURDIR}/scripts/launch.sh ${.CURDIR} iso ${CANONICALOBJDIR}/.tmp_iso
@${ECHO} ">>> Finished iso `LC_ALL=C date`."
@mv ${CANONICALOBJDIR}/.tmp_iso ${CANONICALOBJDIR}/.done_iso
img: .done_img
.done_img: .done_clonefs
@-rm -f ${CANONICALOBJDIR}/.tmp_img
@touch ${CANONICALOBJDIR}/.tmp_img
@${ECHO} ">>> Started img `LC_ALL=C date`."
@sh ${.CURDIR}/scripts/launch.sh ${.CURDIR} img ${CANONICALOBJDIR}/.tmp_img
@${ECHO} ">>> Finished img `LC_ALL=C date`."
@mv ${CANONICALOBJDIR}/.tmp_img ${CANONICALOBJDIR}/.done_img
flash: .done_flash
.done_flash: .done_clonefs
@-rm -f ${CANONICALOBJDIR}/.tmp_flash
@${ECHO} ">>> Started flash `LC_ALL=C date`."
@touch ${CANONICALOBJDIR}/.tmp_flash
@${ECHO} ">>> Finished flash `LC_ALL=C date`."
@sh ${.CURDIR}/scripts/launch.sh ${.CURDIR} flash ${CANONICALOBJDIR}/.tmp_flash
@mv ${CANONICALOBJDIR}/.tmp_flash ${CANONICALOBJDIR}/.done_flash
clean:
@-rm -f .tmp* .done* > /dev/null 2>&1
cleandir: clean
@sh ${.CURDIR}/scripts/launch.sh ${.CURDIR} cleandir