-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
60 lines (48 loc) · 1.46 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
DIR ?= .
V ?= 0
include Makefile.common
.PHONY : all
all : build-all
.PHONY : clean
clean : clean-all
NAME = bitvisor
FORMAT = elf32-i386
elf = $(NAME).elf
map = $(NAME).map
lds = $(NAME).lds
target = $(elf)
subdirs-1 += core drivers
subdirs-$(CONFIG_STORAGE) += storage
subdirs-$(CONFIG_VPN) += vpn
subdirs-$(CONFIG_IDMAN) += idman
subdirs-1 += net
subdirs-$(CONFIG_IP) += ip
asubdirs-$(CONFIG_CRYPTO) += crypto
psubdirs-1 += process
process-depends-$(CONFIG_CRYPTO) += $(dir)crypto/$(outa_p)
process-depends-$(CONFIG_IDMAN) += $(dir)idman/$(outo_p)
process-depends-$(CONFIG_STORAGE) += $(dir)storage/$(outo_p)
process-depends-$(CONFIG_VPN) += $(dir)vpn/$(outo_p)
$(dir)$(elf) : $(defouto) $(dir)$(lds)
$(V-info) LD $(dir)$(elf)
$(CC) $(LDFLAGS) -Wl,-T,$(dir)$(lds) -Wl,--cref \
-Wl,-Map,$(dir)$(map) -o $(dir)$(elf) $(defouto)
$(OBJCOPY) --output-format $(FORMAT) $(dir)$(elf)
.PHONY : build-all
build-all : $(CONFIG) defconfig
case "`$(SED) 1q $(DIR)/$(depends) 2>/dev/null`" in \
''): >> $(DIR)/$(depends);; esac
$(MAKE) $(V-makeopt-$(V)) -f Makefile.build build-dir DIR=$(DIR) V=$(V)
$(SIZE) $(dir)$(elf)
.PHONY : clean-all
clean-all :
$(MAKE) $(V-makeopt-$(V)) -f Makefile.clean clean-dir DIR=$(DIR) V=$(V)
.PHONY : config
config : $(CONFIG)
$(MAKE) -f Makefile.config config
$(CONFIG) : Makefile.config
: >> $(CONFIG)
$(MAKE) -f Makefile.config update-config
defconfig :
cp defconfig.tmpl defconfig
$(dir)process/$(outp_p) : $(process-depends-1)