forked from tworaz/src
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathGNUmakefile.RPI
More file actions
42 lines (35 loc) · 1.56 KB
/
GNUmakefile.RPI
File metadata and controls
42 lines (35 loc) · 1.56 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
# Makefile for metasepi system.
ARCH = evbarm
KERNCONF = RPI
CURDIR = $(shell pwd)
TOOLDIR = obj/tooldir.${ARCH}
RELEASEDIR = obj/releasedir.${ARCH}
DESTDIR = obj/destdir.${ARCH}
NUMCPU = $(shell cat /proc/cpuinfo | grep -c "^processor")
BUILDSH = sh build.sh -U -u -N 0 -j ${NUMCPU} ${MKVARS}
NBMAKE = ${CURDIR}/${TOOLDIR}/bin/nbmake-${ARCH} -j ${NUMCPU}
NBMAKEFS = ${CURDIR}/${TOOLDIR}/bin/nbmakefs
OBJCOPY = ${CURDIR}/${TOOLDIR}/bin/arm--netbsdelf-objcopy
LOGFILTER = -e "===>" -e "^nbgmake" -B 5 -e "Error code"
#LOGFILTER = ""
HSBUILD = metasepi/sys/hsbuild
HSSRC = metasepi/sys/hssrc
HSCODE = $(wildcard $(HSSRC)/*.hs $(HSSRC)/*/*.hs $(HSSRC)/*/*/*.hs $(HSSRC)/*/*/*/*.hs)
### Build kernel
all: obj/build_tools.${ARCH}.stamp ${HSBUILD}/hsmain.c
${BUILDSH} -T ${TOOLDIR} -m ${ARCH} kernel=${KERNCONF}
cd sys/arch/${ARCH}/compile/obj/${KERNCONF} && ${OBJCOPY} -O srec netbsd netbsd.srec
cd sys/arch/${ARCH}/compile/obj/${KERNCONF} && ${OBJCOPY} -I srec -O binary netbsd.srec netbsd.bin
${HSBUILD}/hsmain.c: ${HSCODE}
ajhc -fffi -fcustomthread --include=$(HSSRC) --tdir=$(HSBUILD) -C -o $@ $(HSSRC)/Main.hs
rm -f $(HSBUILD)/sys/queue.h # Use queue.h at NetBSD side
### Setup NetBSD environment
obj/build_tools.${ARCH}.stamp:
env MKCROSSGDB=yes ${BUILDSH} -T ${TOOLDIR} -m ${ARCH} tools | grep ${LOGFILTER}
touch obj/build_tools.${ARCH}.stamp
clean:
rm -rf sys/arch/${ARCH}/compile/obj/${KERNCONF} ${HSBUILD} *~
distclean: clean
rm -f ${DESTDIR} *~
env MKCROSSGDB=yes ${BUILDSH} -T ${TOOLDIR} -m ${ARCH} cleandir
.PHONY: clean distclean