Skip to content

Commit f2a814f

Browse files
committed
Add initial GNU make Makefile
We have a fairly complicated build process in qcom-deb-images, as evidenced by the current README.md. Giving developers a one-command build instead means: 1. Simplified instructions for developers, or in other words, moving instructions for manual entry from README.md into automated invocation via the build system. 2. Automated dependency/rebuild tracking, reducing the instances where a full rebuild is required, or the easiest option, during development iteration. 3. Building only what is necessary for a given target. 4. The opportunity to move towards running CI before submission in a PR, rather than CI being entirely defined inside .github/workflows/ and therefore inaccessible for running locally. This is too complex to attempt all at once. Instead I'm doing it in multiple small steps, and this is the first step. Overall, my plan is: 1. Introduce a basic Makefile that works. 2. Per item, implement in the Makefile what CI requires that is already implemented in .github/workflows/. 3. Per item, replace complex build invocation steps made directly from .github/workflows/ with calls to the Makefile instead. 4. Once the elements covered by README.md are all covered, I'll update the instructions to use the Makefile instead. Note that CI for the Makefile should therefore not be necessary to implement directly; it'll happen step by step as CI is moved into it through step 3 above. If there are gaps in CI coverage that the Makefile does cover, then we can implement those as separate CI items to call from .github/workflows/ as we wish. In time, this should make .github/workflows/ simpler, and encode our knowledge of how to invoke the various tools (including debos) into the source tree itself, rather than via manual instructions in README.md that are also duplicated in .github/workflows/
1 parent a5d8176 commit f2a814f

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

Makefile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# The user can override DEBOS_OPTS using something like:
2+
# make DEBOS_OPTS=... all
3+
# However these provide a default that work as universally as we can manage.
4+
DEBOS_OPTS := --fakemachine-backend qemu --memory 1GiB --scratchsize 4GiB
5+
DEBOS := debos $(DEBOS_OPTS)
6+
7+
# Provide some mechanism for the developer to seamlessly use an apt cache since
8+
# development iterations can become quite slow otherwise. They can either have
9+
# http_proxy set already, or otherwise default to using the host's configured
10+
# apt proxy for all debos operations. This follows the debos/fakemachine
11+
# pattern of picking up dependencies from the host, such as the kernel.
12+
http_proxy ?= $(shell apt-config dump --format '%v%n' Acquire::http::Proxy)
13+
export http_proxy
14+
15+
all: disk-ufs.img
16+
17+
rootfs.tar.gz: debos-recipes/qualcomm-linux-debian-rootfs.yaml
18+
$(DEBOS) $<
19+
20+
disk-ufs.img: debos-recipes/qualcomm-linux-debian-image.yaml rootfs.tar.gz
21+
$(DEBOS) $<
22+
23+
.PHONY: all

0 commit comments

Comments
 (0)