-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
63 lines (48 loc) · 1.26 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
61
62
63
#Makefile for busybox
include ../../../config.mk
CURMAKE := $(abspath $(firstword $(MAKEFILE_LIST)))
CURPATH := $(dir $(CURMAKE))
#Source directory
SRCDIR = busybox
#Output
ifndef ROOTFSPATH
override ROOTFSPATH = $(CURPATH)_ukamafs
endif
#Check XGCC PATH
ifndef XGCCPATH
$(error XGCCPATH missing.)
endif
XCROSSCC = "$(XGCCPATH)$(XCROSS_COMPILER)"
#Config for Builds
ifndef BB_CONFIG
BBCONFIG = ukama_defconfig
else
BBCONFIG = $(BB_CONFIG)
endif
#Overiding Architecture
ifeq ($(ARCH), $(ARCHX86))
override ARCH = $(ARCHX86_64)
endif
.PHONY: subdirs $(SRCDIR) clean info
subdirs: $(SRCDIR)
$(SRCDIR):
@echo Building busybox for $(ARCH) using $(CC)
mkdir -p $(ROOTFSPATH)
#Config
$(MAKE) -j$(NPROCS) -C $@ ARCH=$(ARCH) CROSS_COMPILE=$(XCROSSCC) $(BBCONFIG)
#Make
$(MAKE) -j$(NPROCS) -C $@ ARCH=$(ARCH) CROSS_COMPILE=$(XCROSSCC) install CONFIG_PREFIX=$(ROOTFSPATH)
clean:
@echo Cleaning $(SRCDIR).
rm -rf $(ROOTFSPATH)
for dir in $(SRCDIR); do \
$(MAKE) -j$(NPROCS) -C $$dir -f Makefile $@; \
done
distclean:
@echo DistClean $(SRCDIR).
rm -rf $(ROOTFSPATH)
for dir in $(SRCDIR); do \
$(MAKE) -j$(NPROCS) -C $$dir -f Makefile $@; \
done
info: ;
$(info [$@] Building $(SRCDIR) $(TARGETBOARD) for $(ARCH) with $(CC) )