-
Notifications
You must be signed in to change notification settings - Fork 19
/
Makefile
executable file
·44 lines (40 loc) · 1.16 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
SRCTREE := $(CURDIR)
YOC_FILE := $(SRCTREE)/.yoc
NPROC ?= $(shell nproc)
$(info "NPROC = $(NPROC)")
export SRCTREE YOC_FILE NPROC
ifeq ("$(wildcard $(YOC_FILE))","")
$(error ".yoc is not present, please do 'yoc init' first!!")
endif
#
HOST_TOOLS := $(SRCTREE)/host-tools/Xuantie-900-gcc-elf-newlib-x86_64-V2.6.1/bin
CC := $(HOST_TOOLS)/riscv64-unknown-elf-gcc
CXX := $(HOST_TOOLS)/riscv64-unknown-elf-g++
AR := $(HOST_TOOLS)/riscv64-unknown-elf-ar
STRIP := $(HOST_TOOLS)/riscv64-unknown-elf-strip
export CC CXX AR STRIP
export PATH := $(HOST_TOOLS):$(PATH)
#
TOPSUBDIRS := smart_doorbell autotest smart_pad cv181x_boot cv181xh_boot peripherals_test usb_cam ipc barcode_scan sophpi mpi_sample mpi_self_test tdl_sample
#
.PHONY:all clean install $(TOPSUBDIRS)
TMP = $(foreach f,$(TOPSUBDIRS),$(findstring $f,$(MAKECMDGOALS)))
TMP_SOLUTIONS = $(strip $(TMP))
ifneq ($(TMP_SOLUTIONS), )
SOLUTIONS = $(TMP_SOLUTIONS)
else
SOLUTIONS = smart_doorbell
endif
YOC_COMPRESS := n
#
all: $(TOPSUBDIRS)
#
$(TOPSUBDIRS):
@echo "make $(MAKECMDGOALS) $(MAKEFLAGS)"
$(MAKE) -C solutions/$@ $(patsubst $@,,$(MAKECMDGOALS))
#
clean:
$(MAKE) -C solutions/$(SOLUTIONS) clean
@rm install/ -rf
#
install: