forked from greatscottgadgets/greatfet
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
64 lines (49 loc) · 1.31 KB
/
Makefile
File metadata and controls
64 lines (49 loc) · 1.31 KB
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
#
# This file is part of GreatFET.
# This makefile is full of helper functions to get you up and running fast.
#
SHELL := /bin/bash
# By default, use the system's "python" binary.
PYTHON ?= python
# By default, use cmake as cmake.
CMAKE ?= cmake
all: firmware
.PHONY: all firmware install full_install install_and_flash
#
# Convenience functiont to build our system
#
firmware:
# Create a firmware build directory, and configure our build.
@mkdir -p firmware/build
pushd firmware/build; cmake ..; popd
# Temporary: ensure libopencm3 is built.
$(MAKE) -C firmware/libopencm3 -j$(nproc)
# Build and install the relevant firmware.
$(MAKE) -C firmware/build install -j$(nproc)
#
# Quick shortcut to flash a pre-programmed GreatFET into the latest state.
#
install_and_flash: full_install
gf fw --autoflash
#
# Process for installing the host tools.
#
define install_host
pushd libgreat/host; $(PYTHON) setup.py install; popd
pushd host; $(PYTHON) setup.py install; popd
endef
#
# Full install. Depends on firmware having installed its subcomponents.
#
full_install: firmware
$(call install_host)
#
# Normal install -- installs without the requirement to build firmware first.
#
install: libgreat/README.md
$(call install_host)
#
# Check out libgreat, if it's missing.
#
libgreat/README.md:
git submodule update --init