-
Notifications
You must be signed in to change notification settings - Fork 36
/
Makefile
92 lines (80 loc) · 1.92 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
#
# Top level makefile for the LiteBSD project.
# Usage:
# make all -- Compile binaries and create SD image
# make clean -- Delete build results
# make build -- Compile binaries
# make kernel -- Compile kernels for all board types
# make fs -- Create SD image
# make installfs -- Write the image to SD card
#
SUBDIR= bin contrib games include lib libexec old sbin \
share usr.bin usr.sbin
#
# Build binaries and create a filesystem image.
#
all: build fs
#
# Delete all results of the build.
#
clean: cleandir
rm -rf sdcard.img ${DESTDIR}
#
# Create the DESTDIR tree.
# Install /etc and /usr/include files.
# Build and install the libraries.
#
${DESTDIR}:
${MAKE} -Cetc install
${MAKE} -Cinclude install
${MAKE} cleandir
${MAKE} -Clib depend
${MAKE} -Clib all install
${MAKE} depend
#
# Build all the binaries.
#
build: ${DESTDIR}
@for d in ${SUBDIR}; do \
if test $${d} != lib -a $${d} != include -a $${d} != etc; then \
echo "===> $$d"; \
${MAKE} -C${.CURDIR}/$${d} all install; \
fi; \
done
${MAKE} -Cshare/man makedb
#
# Build kernels for all boards.
#
kernel:
${MAKE} -Csys/compile all
#
# Filesystem and swap sizes.
#
ROOT_MBYTES = 200
SWAP_MBYTES = 32
U_MBYTES = 100
UFSTOOL = contrib/ufstool/ufstool
#
# Create disk image from DESTDIR directory contents.
#
fs: sdcard.img
.PHONY: sdcard.img
sdcard.img: ${UFSTOOL} etc/rootfs.manifest
test -d ${DESTDIR} || ${MAKE} build
rm -f $@
${UFSTOOL} --repartition=fs=${ROOT_MBYTES}M:swap=${SWAP_MBYTES}M:fs=${U_MBYTES}M $@
${UFSTOOL} --new --partition=1 --manifest=etc/rootfs.manifest $@ ${DESTDIR}
# ${UFSTOOL} --new --partition=3 $@
${UFSTOOL}:
make -C`dirname ${UFSTOOL}`
#
# Write disk image to SD card.
#
installfs:
.if defined(SDCARD)
@[ -f sdcard.img ] || $(MAKE) sdcard.img
sudo dd bs=32k if=sdcard.img of=$(SDCARD)
.else
@echo "Error: No SDCARD defined."
.endif
.include <bsd.subdir.mk>