summaryrefslogtreecommitdiff
path: root/Makefile
blob: fa411dd49daee54e4d45fb17dc2efe652d546eb7 (plain)
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
TARGET = demo.bin
LIBDEPS = FreeRTOS/libFreeRTOS.a arch/libarch.a os/libos.a
LIBS = -Wl,--start-group -lc $(LIBDEPS) -Wl,--end-group

TARGET_SRCS = test-romfs.o

export ROOTDIR = $(CURDIR)

include common.mk

all: tools libs $(TARGET)

clean: clean-generic
	$(Q)$(MAKE) $(MAKE_OPTS) -C FreeRTOS clean
	$(Q)$(MAKE) $(MAKE_OPTS) -C arch clean
	$(Q)$(MAKE) $(MAKE_OPTS) -C os clean
	$(Q)$(MAKE) $(MAKE_OPTS) -C tools clean
	$(Q)rm -f test-romfs.bin

.PHONY: libs FreeRTOS arch os tools

FreeRTOS/libFreeRTOS.a: FreeRTOS
arch/libarch.a: arch
os/libos.a: os

libs: FreeRTOS arch os

FreeRTOS:
	$(E) "[MAKE]   Entering FreeRTOS"
	$(Q)$(MAKE) $(MAKE_OPTS) -C FreeRTOS

arch:
	$(E) "[MAKE]   Entering arch"
	$(Q)$(MAKE) $(MAKE_OPTS) -C arch

os:
	$(E) "[MAKE]   Entering os"
	$(Q)$(MAKE) $(MAKE_OPTS) -C os

tools:
	$(E) "[MAKE]   Entering tools"
	$(Q)$(MAKE) $(MAKE_OPTS) -C tools

test-romfs.o: tools/mkromfs
	$(E) "[ROMFS]  Building test romfs"
	$(Q) tools/mkromfs -d test-romfs test-romfs.bin
	$(Q) $(TARGET_OBJCOPY_BIN) --prefix-sections '.romfs' test-romfs.bin test-romfs.o
	$(Q)$(MAKE) $(MAKE_OPTS) -C tools

include FreeRTOS/config.mk
include arch/config.mk
include os/config.mk
include target-rules.mk